Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require delocate only on Windows #206

Merged
merged 3 commits into from
Sep 25, 2024
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
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