Skip to content

Commit 74de0db

Browse files
committed
Drop deprecated setup_requires, fix encode_fs_path annotations on Python < 3.14
Move the cffi build requirement from setup_requires (deprecated fetch_build_eggs path) to [build-system] requires in pyproject.toml. Also quote the encode_fs_path signature annotations in full: mixing a runtime PEP 604 union (PathStrOrBytes) with a string forward reference raised TypeError at import time on Python < 3.14, breaking the wheel tests on 3.11. Python 3.14's lazy annotation evaluation (PEP 649) had masked the issue locally. Assisted-by: Kimi Code CLI
1 parent c9366e5 commit 74de0db

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

pygit2/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def encode_fs_path(s: PathStrOrBytes) -> bytes: ...
7676
@overload
7777
def encode_fs_path(s: 'ffi.NULL_TYPE | None') -> 'ffi.NULL_TYPE': ...
7878
def encode_fs_path(
79-
s: PathStrOrBytes | 'ffi.NULL_TYPE | None',
80-
) -> bytes | 'ffi.NULL_TYPE':
79+
s: 'PathStrOrBytes | ffi.NULL_TYPE | None',
80+
) -> 'bytes | ffi.NULL_TYPE':
8181
if s is None or s == ffi.NULL:
8282
return ffi.NULL
8383

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools"]
2+
requires = ["setuptools", "cffi>=2.0"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.cibuildwheel]

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def run(self) -> None:
154154
ext_modules=ext_modules,
155155
# Requirements
156156
python_requires='>=3.11',
157-
setup_requires=['cffi>=2.0'],
158157
install_requires=['cffi>=2.0'],
159158
# URLs
160159
url='https://github.com/libgit2/pygit2',

0 commit comments

Comments
 (0)