Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- master
paths:
- ".github/workflows/ci.yml"
- "pyproject.toml"
- "mypy.ini"
- "**/*.py"
pull_request:
paths:
- ".github/workflows/ci.yml"
- "pyproject.toml"
- "mypy.ini"
- "**/*.py"

concurrency:
# Cancel previous runs for the same PR
# Don't cancel successive pushes to master
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
mypy:
# Arm runners are faster (as long as the same wheels are available)
runs-on: ubuntu-24.04-arm
timeout-minutes: &timeout-minutes 5
strategy:
# mypy is os and python-version sensitive. Test on all supported combinations
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- run: uv sync --locked
- run: mypy . --python-version=${{ matrix.python-version }}
29 changes: 0 additions & 29 deletions .github/workflows/type-checking.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/build/
/.mypy_cache/
/src/EWMHlib.egg-info/
.python-version
10 changes: 7 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04 # Keep in sync with runs-on in .github/workflows/ci.yml
tools:
python: "3.11"
python: "3.14" # Keep in sync with python-version in .github/workflows/ci.yml
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
Expand All @@ -32,4 +32,8 @@ sphinx:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: requirements.txt
# https://docs.readthedocs.com/platform/latest/build-customization.html#install-dependencies-with-uv
- method: uv
command: sync
groups:
- docs
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ EWMHlib authors, contributors and maintainers:
Kalmat https://github.com/Kalmat
Mestrelion https://github.com/MestreLion
ReaperMantis https://github.com/ReaperMantis
Avasam https://github.com/Avasam
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# EWMH-lib
[![Type Checking](https://github.com/Kalmat/EWMHlib/actions/workflows/type-checking.yml/badge.svg)](https://github.com/Kalmat/EWMHlib/actions/workflows/type-checking.yml)
[![CI](https://github.com/Kalmat/EWMHlib/actions/workflows/ci.yml/badge.svg)](https://github.com/Kalmat/EWMHlib/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/ewmhlib.svg)](https://badge.fury.io/py/ewmhlib)
[![Documentation Status](https://readthedocs.org/projects/ewmhlib/badge/?version=latest)](https://ewmhlib.readthedocs.io/en/latest/?badge=latest)

Expand Down Expand Up @@ -280,17 +280,17 @@ Aimed to facilitate understanding and handling complex reply data structures and

## Install <a name="install"></a>

To install this module on your system, you can use pip:
To install this module on your system, you can use pip:

pip3 install ewmhlib
python -m pip install ewmhlib

or
or using uv:

python3 -m pip install ewmhlib
uv add ewmhlib

Alternatively, you can download the wheel file (.whl) available in the [Download page](https://pypi.org/project/EWMHlib/#files) and the [dist folder](https://github.com/Kalmat/EWMHlib/tree/master/dist), and run this (don't forget to replace 'x.xx' with proper version number):

pip install EWMHlib-x.xx-py3-none-any.whl
python -m pip install EWMHlib-x.xx-py3-none-any.whl

You may want to add `--force-reinstall` option to be sure you are installing the right dependencies version.

Expand All @@ -309,13 +309,19 @@ If you want to use this code or contribute, you can either:
* Create a fork of the [repository](https://github.com/Kalmat/EWMHlib), or
* [Download the repository](https://github.com/Kalmat/EWMHlib/archive/refs/heads/master.zip), uncompress, and open it on your IDE of choice (e.g. PyCharm)

Be sure you install all dependencies described on "docs/requirements.txt" by using pip
Be sure you install all dev dependencies by running:

uv sync

or
python -m venv .venv
python -m pip install -e . --group=dev

## Test <a name="test"></a>

To test this module on your own system, cd to "tests" folder and run:

python3 test_ewmhlib.py
uv run test_ewmhlib.py


## List of EWMH-compliant window managers
Expand Down
15 changes: 15 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[mypy]
# This project is Linux-only, but can be developed on any platform
platform = linux

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make it so that opening this project on other platforms (Windows, macOS) is still possible for development, but mypy on the CLI and in IDE will pretend its using linux stdlib and code paths.

mypy_path = src/, typings/
exclude = build/, dist/
strict = True

# Leverage type inference for function return type
disallow_untyped_calls = False
disallow_incomplete_defs = False
disallow_untyped_defs = False

disable_error_code =
# https://github.com/python/mypy/issues/6232 (redefinition with correct type)
attr-defined, assignment,
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["uv_build>=0.11.21,<0.12"]
build-backend = "uv_build"

[project.urls]
Homepage = "https://github.com/Kalmat/EWMHlib"
Repository = "https://github.com/Kalmat/EWMHlib.git"
Issues = "https://github.com/Kalmat/EWMHlib/issues"
Changelog = "https://github.com/Kalmat/EWMHlib/blob/HEAD/CHANGES.txt"
Documentation = "https://ewmhlib.readthedocs.io/"

[project]
name = "EWMHlib"
version = "0.2"
description = "Extended Window Manager Hints implementation in Python 3"
authors = [
{ name = "Kalmat", email = "palookjones@gmail.com" }
]
readme = "README.md"
license = "BSD-3-Clause"
license-files = ["LICENSE.txt"]
requires-python = ">=3.9"
keywords=[
"ewmh",
"Extended-Window-manager-hints",
"window-manager",
"window",
"manager",
"hints",
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: X11 Applications",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"python-xlib>=0.21; sys_platform == 'linux'",
"typing_extensions>=4.4.0",
]

[dependency-groups]
docs = [
"myst-parser",
]
dev = [
{ include-group = "docs" },
"mypy>=0.990,<2",
"types-python-xlib>=0.32",
]

[tool.uv]
# This project is Linux-only
environments = ["sys_platform == 'linux'"]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows uv to simplify its resolution and not have to account for other platforms

exclude-newer = "1 week"
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

22 changes: 0 additions & 22 deletions setup.cfg

This file was deleted.

63 changes: 0 additions & 63 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/ewmhlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

from importlib.metadata import version as _importlib_version

__all__ = [
"version", "displaysCount", "getDisplays", "getDisplaysInfo", "getRoots",
Expand All @@ -12,7 +12,7 @@
"Props", "Structs"
]

__version__ = "0.2"
__version__ = _importlib_version("ewmhlib")


def version(numberOnly: bool = True):
Expand Down
Loading