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
61 changes: 14 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "pypy-3.11"
wlroots-version: ["0.17.4"]
steps:
Expand Down Expand Up @@ -179,32 +179,20 @@ jobs:
WLR_LIBINPUT_NO_DEVICES: '1'
WLR_RENDERER: pixman
WLR_RENDERER_ALLOW_SOFTWARE: '1'
ruff-test:
name: ruff tests
runs-on: ubuntu-24.04
env:
python-version: "3.13"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Run ruff check
uses: astral-sh/ruff-action@v3
mypy-test:
name: mypy tests
pre-commit-test:
name: pre-commit tests
runs-on: ubuntu-24.04
needs: build-wayland
env:
python-version: "3.13"
python-version: "3.14"
wlroots-version: "0.17.4"
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install -y --no-install-recommends \
libinput-dev \
libpixman-1-dev \
libxkbcommon-dev \
- name: Download wayland libraries
uses: actions/download-artifact@v4
Expand All @@ -220,36 +208,15 @@ jobs:
python-version: ${{ env.python-version }}
- name: Install Python dependencies
run: |
pip install wheel
pip install -r requirements.txt
pip install mypy types-cffi types-dataclasses
- name: Run mypy test
run: |
mypy -p wlroots
mypy -p tiny
black-test:
name: black tests
runs-on: ubuntu-24.04
env:
python-version: "3.13"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install Python dependencies
run: |
pip install black
- name: Run black test
run: black --check wlroots tiny
pip install .
- name: Run pre-commit test
uses: pre-commit/action@v3.0.1
packaging-test:
name: packaging tests
runs-on: ubuntu-24.04
needs: build-wayland
env:
python-version: "3.13"
python-version: "3.14"
wlroots-version: "0.17.4"
steps:
- name: Download wayland libraries
Expand All @@ -262,6 +229,8 @@ jobs:
run: |
sudo apt update
sudo apt-get install -y --no-install-recommends \
libinput-dev \
libpixman-1-dev \
libxkbcommon-dev \
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -271,9 +240,7 @@ jobs:
python-version: ${{ env.python-version }}
- name: Install Python dependencies
run: |
pip install wheel
pip install -r requirements.txt
pip install check-manifest twine
pip install .[packaging]
- name: Run packaging test
run: |
check-manifest
Expand All @@ -285,7 +252,7 @@ jobs:
runs-on: ubuntu-24.04
needs: build-wayland
env:
python-version: "3.13"
python-version: "3.14"
wlroots-version: "0.17.4"
steps:
- name: Download wayland libraries
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Download wayland libraries
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -278,11 +278,11 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "pypy-3.11"
steps:
- name: Install dependencies
Expand Down Expand Up @@ -323,7 +323,7 @@ jobs:
container: quay.io/pypa/manylinux_2_34_x86_64
needs: build-wayland
env:
python-version: "3.13"
python-version: "3.14"
steps:
- name: Download wayland libraries
uses: actions/download-artifact@v4
Expand Down
17 changes: 9 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
# Use the latest supported version here
language_version: python3.13
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.0
rev: v0.14.4
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: ruff
- id: mypy
files: "^(wlroots|tiny)\/.*"
45 changes: 22 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ build-backend = "setuptools.build_meta"
name = "pywlroots"
description = "Python binding to the wlroots library using cffi"
authors = [{name = "Sean Vig", email = "sean.v.775@gmail.com"}]
requires-python = ">=3.9"
requires-python = ">=3.10"
license = "NCSA"
readme = "README.rst"
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Desktop Environment :: Window Managers",
Expand All @@ -39,10 +39,10 @@ dynamic = ["version"]

[project.optional-dependencies]
test = ["pytest"]
typecheck = [
"mypy",
"types-cffi",
"types-dataclasses",
packaging = [
"build",
"check-manifest",
"twine",
]

[project.urls]
Expand Down Expand Up @@ -71,31 +71,30 @@ lint.select = ['E', 'F', 'I', 'N', 'W', 'UP', 'RUF']
lint.ignore = ["E501"]
line-length = 88

[tool.black]
line-length = 88
[tool.check-manifest]
ignore = [
"wlroots/_build.py",
"wlroots/include/*.h",
]

[tool.mypy]
check_untyped_defs = true
# disallow_any_decorated = true
# disallow_any_explicit = true
# disallow_any_expr = true
# disallow_any_generics = true
# disallow_any_unimported = true
# disallow_incomplete_defs = true
packages = ["wlroots", "tiny"]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
strict_equality = true
disallow_subclassing_any = true
# disallow_untyped_calls = true
# disallow_untyped_decorators = true
# disallow_untyped_defs = true
disallow_untyped_decorators = true
disallow_any_generics = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
# warn_return_any = true
no_implicit_optional = true
show_error_codes = true
strict_equality = true
warn_incomplete_stub = true
warn_no_return = true
warn_redundant_casts = true
# warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = [
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
# Copyright (c) Sean Vig 2018

import glob
import os
import subprocess
import sys

from setuptools import setup
from setuptools.command.sdist import sdist


class SdistClean(sdist):
def run(self):
# These files are not tracked by git and as a result check-manifest complains
# when present, '_build.py' needs to be removed manually since it keeps being
# created by other setup commands and '.h' files are needen only during build
files = glob.glob("wlroots/include/*.h")
files.append("wlroots/_build.py")
for file in files:
try:
os.remove(file)
except Exception:
pass
sdist.run(self)


sys.path.insert(0, "wlroots")

subprocess.run(["python", "wlroots/include/check_headers.py", "--generate"])
setup(
cmdclass={"sdist": SdistClean},
cffi_modules=["wlroots/ffi_build.py:ffi_builder"],
)
3 changes: 2 additions & 1 deletion tiny/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import logging
import sys
from collections.abc import Sequence

from pywayland.server import Display

Expand All @@ -26,7 +27,7 @@
from .server import TinywlServer


def main(argv) -> None:
def main(argv: Sequence[str] | None) -> None:
with Display() as display:
_, allocator, renderer, backend, _ = build_compositor(display)
device_manager = DataDeviceManager(display) # noqa: F841
Expand Down
4 changes: 3 additions & 1 deletion tiny/keyboard_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from pywayland.server import Listener

if TYPE_CHECKING:
from typing import Any

from wlroots.wlr_types import InputDevice, Keyboard
from wlroots.wlr_types.keyboard import KeyboardKeyEvent

Expand All @@ -25,7 +27,7 @@ def __init__(
keyboard.modifiers_event.add(Listener(self.keyboard_handle_modifiers))
keyboard.key_event.add(Listener(self.keyboard_handle_key))

def keyboard_handle_modifiers(self, listener: Listener, data) -> None:
def keyboard_handle_modifiers(self, listener: Listener, data: Any) -> None:
"""Activates the keyboard and sends the modifiers event to the active surface"""
self.tinywl_server.send_modifiers(self.keyboard.modifiers, self.input_device)

Expand Down
Loading