From 141bef04142946ce1d9247c26e96452ae0a0711a Mon Sep 17 00:00:00 2001 From: rgaudin Date: Mon, 23 Sep 2024 09:03:55 +0000 Subject: [PATCH 1/3] Fixed #205: only require delocate on Windows --- CHANGELOG.md | 4 +++- pyproject.toml | 4 ++-- setup.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ca24c7..984665d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- n/a +### Changed + +- `delocate` dependency only required on Windows platform ## [3.5.0] diff --git a/pyproject.toml b/pyproject.toml index 276494a..a420591 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools == 74.1.1", "wheel == 0.44.0", "cython == 3.0.11", - "delocate==0.11.0", + "delocate == 0.11.0 ; platform_system=='Windows'", ] build-backend = "setuptools.build_meta" @@ -70,7 +70,7 @@ build = [ "setuptools == 74.1.1", "wheel == 0.44.0", "cython == 3.0.11", - "delocate==0.11.0", + "delocate == 0.11.0 ; platform_system=='Windows'", ] dev = [ "pre-commit==3.8.0", diff --git a/setup.py b/setup.py index 93538ae..81d9114 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ from Cython.Build import cythonize from Cython.Distutils.build_ext import new_build_ext as build_ext -from delocate.wheeltools import InWheel from setuptools import Command, Extension, setup @@ -350,6 +349,8 @@ def repair_windows_wheel(self, wheel: Path, dest_dir: Path): """opens windows wheels in target folder and moves all DLLs files inside subdirectories of the wheel to the root one (where wrapper is expected)""" + from delocate.wheeltools import InWheel + # we're only interested in windows wheels if not re.match(r"libzim-.+-win_.+", wheel.stem): return From 8113c42b1a9b3df69c2fe9381cd86a10d8af2910 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Mon, 23 Sep 2024 09:44:22 +0000 Subject: [PATCH 2/3] ignore source missing for libzim in tests --- tests/test_libzim_creator.py | 12 +++++++----- tests/test_libzim_reader.py | 10 ++++++---- tests/test_libzim_version.py | 6 +++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/test_libzim_creator.py b/tests/test_libzim_creator.py index 5e89b3a..cc9ef27 100644 --- a/tests/test_libzim_creator.py +++ b/tests/test_libzim_creator.py @@ -13,11 +13,13 @@ import pytest -import libzim.writer -from libzim.reader import Archive -from libzim.search import Query, Searcher -from libzim.suggestion import SuggestionSearcher -from libzim.writer import ( +import libzim.writer # pyright: ignore [reportMissingModuleSource] +from libzim.reader import Archive # pyright: ignore [reportMissingModuleSource] +from libzim.search import Query, Searcher # pyright: ignore [reportMissingModuleSource] +from libzim.suggestion import ( # pyright: ignore [reportMissingModuleSource] + SuggestionSearcher, +) +from libzim.writer import ( # pyright: ignore [reportMissingModuleSource] Blob, ContentProvider, Creator, diff --git a/tests/test_libzim_reader.py b/tests/test_libzim_reader.py index 2fcc458..28da539 100644 --- a/tests/test_libzim_reader.py +++ b/tests/test_libzim_reader.py @@ -8,10 +8,12 @@ import pytest -import libzim.writer -from libzim.reader import Archive -from libzim.search import Query, Searcher -from libzim.suggestion import SuggestionSearcher +import libzim.writer # pyright: ignore [reportMissingModuleSource] +from libzim.reader import Archive # pyright: ignore [reportMissingModuleSource] +from libzim.search import Query, Searcher # pyright: ignore [reportMissingModuleSource] +from libzim.suggestion import ( # pyright: ignore [reportMissingModuleSource] + SuggestionSearcher, +) # expected data for tests ZIMs (see `all_zims`) ZIMS_DATA = { diff --git a/tests/test_libzim_version.py b/tests/test_libzim_version.py index cf06cf9..41d3d73 100644 --- a/tests/test_libzim_version.py +++ b/tests/test_libzim_version.py @@ -1,7 +1,11 @@ import re import sys -from libzim.version import get_libzim_version, get_versions, print_versions +from libzim.version import ( # pyright: ignore [reportMissingModuleSource] + get_libzim_version, + get_versions, + print_versions, +) def test_version_print_version_with_stdout(capsys): From 998ab36785b8cbf74154b38055492a77aa9e5098 Mon Sep 17 00:00:00 2001 From: rgaudin Date: Mon, 23 Sep 2024 09:45:42 +0000 Subject: [PATCH 3/3] upating pyright and restoring its precommit --- .pre-commit-config.yaml | 22 +++++++++++----------- pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc4fa53..0f0bad0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,14 +14,14 @@ repos: rev: v0.6.3 hooks: - id: ruff -# - repo: https://github.com/RobertCraigie/pyright-python -# rev: v1.1.379 -# hooks: -# - id: pyright -# name: pyright (system) -# description: 'pyright static type checker' -# entry: pyright -# language: system -# 'types_or': [python, pyi] -# require_serial: true -# minimum_pre_commit_version: '2.9.2' +- repo: https://github.com/RobertCraigie/pyright-python + rev: v1.1.381 + hooks: + - id: pyright + name: pyright (system) + description: 'pyright static type checker' + entry: pyright + language: system + 'types_or': [python, pyi] + require_serial: true + minimum_pre_commit_version: '2.9.2' diff --git a/pyproject.toml b/pyproject.toml index a420591..eb9a1f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ lint = [ "libzim[build]", ] check = [ - "pyright==1.1.379", + "pyright==1.1.381", "libzim", "libzim[build]", "libzim[test]",