Skip to content

Commit

Permalink
Merge pull request #206 from openzim/delocate_win_only
Browse files Browse the repository at this point in the history
Require delocate only on Windows
  • Loading branch information
rgaudin authored Sep 25, 2024
2 parents b2a4e38 + 998ab36 commit a5fb036
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 26 deletions.
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -54,7 +54,7 @@ lint = [
"libzim[build]",
]
check = [
"pyright==1.1.379",
"pyright==1.1.381",
"libzim",
"libzim[build]",
"libzim[test]",
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions tests/test_libzim_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions tests/test_libzim_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 5 additions & 1 deletion tests/test_libzim_version.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit a5fb036

Please sign in to comment.