From 247da52e227a68aae079d3698b23d6d907989349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Ke=C3=A7eci?= Date: Thu, 24 Oct 2024 02:25:42 +0300 Subject: [PATCH 1/3] Update requirements-dev.txt --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 96366e6..86af08e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,9 @@ pytest Sphinx -sphinx-copybutton ~= 0.5.2 +sphinx-copybutton >= 0.5.2 sphinx-rtd-theme ruff -bump-my-version ~= 0.17.4 +bump-my-version >= 0.17.4 build twine cibuildwheel From d77fcc2dab8c7efd7e82e67236792abac1927f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Ke=C3=A7eci?= Date: Thu, 24 Oct 2024 02:30:08 +0300 Subject: [PATCH 2/3] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6781527..cf7d3e6 100755 --- a/setup.py +++ b/setup.py @@ -96,7 +96,7 @@ def run(self): sub_commands = [("build_ecodes", has_ecodes)] + _build_ext.build_ext.sub_commands -cflags = ["-std=c99", "-Wno-error=declaration-after-statement"] +cflags = ["-std=c++23", "-Wno-error=declaration-after-statement"] setup( ext_modules=[ Extension("evdev._input", sources=["evdev/input.c"], extra_compile_args=cflags), From 876b87b4e52ae983ab9556d6a34422dcf0b46ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Ke=C3=A7eci?= Date: Thu, 24 Oct 2024 02:33:14 +0300 Subject: [PATCH 3/3] Update setup.py --- setup.py | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/setup.py b/setup.py index cf7d3e6..8417d45 100755 --- a/setup.py +++ b/setup.py @@ -2,9 +2,9 @@ import sys import textwrap from pathlib import Path - from setuptools import setup, Extension, Command from setuptools.command import build_ext as _build_ext +from subprocess import run, CalledProcessError curdir = Path(__file__).resolve().parent @@ -26,6 +26,7 @@ def create_ecodes(headers=None): files = ["linux/input.h", "linux/input-event-codes.h", "linux/uinput.h"] headers = [os.path.join(path, file) for path in include_paths for file in files] + # Filtrele ve mevcut başlık dosyalarını bul headers = [header for header in headers if os.path.isfile(header)] if not headers: msg = """\ @@ -38,38 +39,25 @@ def create_ecodes(headers=None): emerge sys-kernel/linux-headers pacman -S kernel-headers - In case they are installed in a non-standard location, you may use - the '--evdev-headers' option to specify one or more colon-separated - paths. For example: - - python setup.py \\ - build \\ - build_ecodes --evdev-headers path/input.h:path/input-event-codes.h \\ - build_ext --include-dirs path/ \\ - install - - If you prefer to avoid building this package from source, then please consider - installing the `evdev-binary` package instead. Keep in mind that it may not be - fully compatible with, or support all the features of your current kernel. + If they are installed in a non-standard location, use the '--evdev-headers' option. """ - sys.stderr.write(textwrap.dedent(msg)) sys.exit(1) - from subprocess import run - - print("writing %s (using %s)" % (ecodes_path, " ".join(headers))) - with ecodes_path.open("w") as fh: - cmd = [sys.executable, "evdev/genecodes.py", *headers] - run(cmd, check=True, stdout=fh) + # Komutu çalıştır ve hata yönetimi ekle + try: + print(f"Writing {ecodes_path} using headers: {' '.join(headers)}") + with ecodes_path.open("w") as fh: + cmd = [sys.executable, "evdev/genecodes.py", *headers] + run(cmd, check=True, stdout=fh) + except CalledProcessError as e: + sys.stderr.write(f"Error during code generation: {e}\n") + sys.exit(1) class build_ecodes(Command): - description = "generate ecodes.c" - - user_options = [ - ("evdev-headers=", None, "colon-separated paths to input subsystem headers"), - ] + description = "Generate ecodes.c" + user_options = [("evdev-headers=", None, "Paths to input subsystem headers")] def initialize_options(self): self.evdev_headers = None