Skip to content

Commit a5fb036

Browse files
authored
Merge pull request #206 from openzim/delocate_win_only
Require delocate only on Windows
2 parents b2a4e38 + 998ab36 commit a5fb036

File tree

7 files changed

+37
-26
lines changed

7 files changed

+37
-26
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ repos:
1414
rev: v0.6.3
1515
hooks:
1616
- id: ruff
17-
# - repo: https://github.com/RobertCraigie/pyright-python
18-
# rev: v1.1.379
19-
# hooks:
20-
# - id: pyright
21-
# name: pyright (system)
22-
# description: 'pyright static type checker'
23-
# entry: pyright
24-
# language: system
25-
# 'types_or': [python, pyi]
26-
# require_serial: true
27-
# minimum_pre_commit_version: '2.9.2'
17+
- repo: https://github.com/RobertCraigie/pyright-python
18+
rev: v1.1.381
19+
hooks:
20+
- id: pyright
21+
name: pyright (system)
22+
description: 'pyright static type checker'
23+
entry: pyright
24+
language: system
25+
'types_or': [python, pyi]
26+
require_serial: true
27+
minimum_pre_commit_version: '2.9.2'

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- n/a
10+
### Changed
11+
12+
- `delocate` dependency only required on Windows platform
1113

1214
## [3.5.0]
1315

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [
33
"setuptools == 74.1.1",
44
"wheel == 0.44.0",
55
"cython == 3.0.11",
6-
"delocate==0.11.0",
6+
"delocate == 0.11.0 ; platform_system=='Windows'",
77
]
88
build-backend = "setuptools.build_meta"
99

@@ -54,7 +54,7 @@ lint = [
5454
"libzim[build]",
5555
]
5656
check = [
57-
"pyright==1.1.379",
57+
"pyright==1.1.381",
5858
"libzim",
5959
"libzim[build]",
6060
"libzim[test]",
@@ -70,7 +70,7 @@ build = [
7070
"setuptools == 74.1.1",
7171
"wheel == 0.44.0",
7272
"cython == 3.0.11",
73-
"delocate==0.11.0",
73+
"delocate == 0.11.0 ; platform_system=='Windows'",
7474
]
7575
dev = [
7676
"pre-commit==3.8.0",

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
from Cython.Build import cythonize
2929
from Cython.Distutils.build_ext import new_build_ext as build_ext
30-
from delocate.wheeltools import InWheel
3130
from setuptools import Command, Extension, setup
3231

3332

@@ -350,6 +349,8 @@ def repair_windows_wheel(self, wheel: Path, dest_dir: Path):
350349
"""opens windows wheels in target folder and moves all DLLs files inside
351350
subdirectories of the wheel to the root one (where wrapper is expected)"""
352351

352+
from delocate.wheeltools import InWheel
353+
353354
# we're only interested in windows wheels
354355
if not re.match(r"libzim-.+-win_.+", wheel.stem):
355356
return

tests/test_libzim_creator.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313

1414
import pytest
1515

16-
import libzim.writer
17-
from libzim.reader import Archive
18-
from libzim.search import Query, Searcher
19-
from libzim.suggestion import SuggestionSearcher
20-
from libzim.writer import (
16+
import libzim.writer # pyright: ignore [reportMissingModuleSource]
17+
from libzim.reader import Archive # pyright: ignore [reportMissingModuleSource]
18+
from libzim.search import Query, Searcher # pyright: ignore [reportMissingModuleSource]
19+
from libzim.suggestion import ( # pyright: ignore [reportMissingModuleSource]
20+
SuggestionSearcher,
21+
)
22+
from libzim.writer import ( # pyright: ignore [reportMissingModuleSource]
2123
Blob,
2224
ContentProvider,
2325
Creator,

tests/test_libzim_reader.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
import pytest
1010

11-
import libzim.writer
12-
from libzim.reader import Archive
13-
from libzim.search import Query, Searcher
14-
from libzim.suggestion import SuggestionSearcher
11+
import libzim.writer # pyright: ignore [reportMissingModuleSource]
12+
from libzim.reader import Archive # pyright: ignore [reportMissingModuleSource]
13+
from libzim.search import Query, Searcher # pyright: ignore [reportMissingModuleSource]
14+
from libzim.suggestion import ( # pyright: ignore [reportMissingModuleSource]
15+
SuggestionSearcher,
16+
)
1517

1618
# expected data for tests ZIMs (see `all_zims`)
1719
ZIMS_DATA = {

tests/test_libzim_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import re
22
import sys
33

4-
from libzim.version import get_libzim_version, get_versions, print_versions
4+
from libzim.version import ( # pyright: ignore [reportMissingModuleSource]
5+
get_libzim_version,
6+
get_versions,
7+
print_versions,
8+
)
59

610

711
def test_version_print_version_with_stdout(capsys):

0 commit comments

Comments
 (0)