%pyproject_save_files: Also save top level typing stub files (.pyi)

This commit is contained in:
Gordon Messmer 2025-10-23 11:08:54 -07:00 committed by Miro Hrončok
parent fbd3dcd22b
commit 10f0ca0ffa
5 changed files with 12 additions and 0 deletions

View File

@ -170,6 +170,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
* Thu Oct 16 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.5-1
- %%pyproject_extras_subpkg: Only %%ghost the dist-info directory, not the content
- That way, accidentally unpackaged files within are reported as errors
- %%pyproject_save_files: Also save top level typing stub files (.pyi)
* Mon Sep 01 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.4-1
- Don't exit from pyproject-srpm-macros implementation of %%pyproject_buildrequires

View File

@ -395,6 +395,9 @@ def classify_paths(
# extension modules can have 2 suffixes
name = BuildrootPath(path.stem).stem
add_file_to_module(paths, name, "extension", "files", path)
elif path.suffix == ".pyi":
name = path.stem
add_file_to_module(paths, name, "stub", "files", path)
elif path.suffix == ".py":
name = path.stem
# we add the .pyc files, but not top-level __pycache__

View File

@ -213,6 +213,10 @@ classified:
- /usr/lib/python3.7/site-packages/__pycache__/tldr.cpython-37{,.opt-?}.pyc
dirs: []
type: script
- files:
- /usr/lib/python3.7/site-packages/tldr.pyi
dirs: []
type: stub
other:
files:
- /usr/bin/tldr
@ -7572,6 +7576,7 @@ dumped:
- /usr/lib/python3.7/site-packages/tldr-0.5.dist-info/WHEEL
- /usr/lib/python3.7/site-packages/tldr-0.5.dist-info/top_level.txt
- /usr/lib/python3.7/site-packages/tldr.py
- /usr/lib/python3.7/site-packages/tldr.pyi
- /usr/share/man/man1/tldr*
- - tldr
- - mistune
@ -15665,6 +15670,7 @@ records:
tldr-0.5.dist-info/WHEEL,sha256=S8S5VL-stOTSZDYxHyf0KP7eds0J72qrK0Evu3TfyAY,92
tldr-0.5.dist-info/top_level.txt,sha256=xHSI9WD6Y-_hONbi2b_9RIn9oiO7RBGHU3A8geJq3mI,5
tldr.py,sha256=aJlA3tIz4QYYy8e7DZUhPyLCqTwnfFjA7Nubwm9bPe0,12779
tldr.pyi,sha256=GxQ4ZGLPQObN92QW_Hb8IJPEuYINNn186FjrRovM09g,13
mistune:
path: /usr/lib64/python3.7/site-packages/mistune-0.8.3.dist-info/RECORD

View File

@ -9,3 +9,4 @@ tldr-0.5.dist-info/RECORD,,
tldr-0.5.dist-info/WHEEL,sha256=S8S5VL-stOTSZDYxHyf0KP7eds0J72qrK0Evu3TfyAY,92
tldr-0.5.dist-info/top_level.txt,sha256=xHSI9WD6Y-_hONbi2b_9RIn9oiO7RBGHU3A8geJq3mI,5
tldr.py,sha256=aJlA3tIz4QYYy8e7DZUhPyLCqTwnfFjA7Nubwm9bPe0,12779
tldr.pyi,sha256=GxQ4ZGLPQObN92QW_Hb8IJPEuYINNn186FjrRovM09g,13

View File

@ -103,6 +103,7 @@ def test_parse_record_tldr():
str(SITELIB / "tldr-0.5.dist-info/WHEEL"),
str(SITELIB / "tldr-0.5.dist-info/top_level.txt"),
str(SITELIB / "tldr.py"),
str(SITELIB / "tldr.pyi"),
]
assert output == expected