You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sdist is incomplete for tests: test_meson_python_file_handling assumes missing packages/ workspace #452
Hi,
while packaging griffe 2.0.2 for openSUSE, the test suite fails when run from the PyPI source tarball (sdist), even though most of the suite passes.
FileNotFoundError: [Errno 2] No such file or directory: 'packages/griffelib/src'
From the test:
pth_file.write_text(
"hello=1\ninstall({'griffe', 'hello'}, 'packages/griffelib', ['/tmp/ninja'], False)",
encoding="utf8",
)
...
assert paths == [Path("packages/griffelib/src")]
The problem seems to be that the test assumes a repository/workspace checkout layout where packages/griffelib/src exists. However, in the published sdist, the packages/ directory is not included.
Relevant pyproject.toml bits:
the sdist include list does not include /packages
but the project still defines a workspace with members = ["packages/*"]
So either:
the sdist should include the packages/ tree needed by the tests, or
this test should not assume checkout-only paths when run from an sdist
In downstream packaging, we currently have to skip this single test when testing from the released tarball.
Would you prefer a patch to the test, or should the sdist contents be adjusted?
We can either include packages/ in the sdist, or consider that no tests should run for the griffe meta-package, since it doesn't contain code and only depends on griffelib and griffecli.
By the way, do you also package griffelib and griffecli separately? If so, I don't think we include tests in the sdists for those: do you use the tests from the Git repository? Or do you use no tests at all?
This project architecture is quite new for me (monorepo), so I'm not sure how people usually deal with OS-packaging.
By the way, do you also package griffelib and griffecli separately? If so, I don't think we include tests in the sdists for those: do you use the tests from the Git repository? Or do you use no tests at all?
Thank you! So, I suggest we add tests and all other necessary files to the sdists for griffelib and griffecli, and leave the griffe sdist empty. Tests should run against griffelib and griffecli, and not against griffe (this would be redundant). To avoid running tests for griffecli when testing griffelib, and inversely, I'll add pytest markers to all tests, so you can pass the right markers to filter tests. Or maybe I can try splitting the test suite in two, but it might be a bit more difficult. WDYT?
Activity
pawamoy commentedon Apr 14, 2026
Thanks for the report @mcepl!
We can either include
packages/in the sdist, or consider that no tests should run for thegriffemeta-package, since it doesn't contain code and only depends ongriffelibandgriffecli.By the way, do you also package
griffelibandgriffecliseparately? If so, I don't think we include tests in the sdists for those: do you use the tests from the Git repository? Or do you use no tests at all?This project architecture is quite new for me (monorepo), so I'm not sure how people usually deal with OS-packaging.
mcepl commentedon Apr 14, 2026
Yes, we do:
And yes,
griffecliandgriffelibdon’t run any tests. I should fix that (and if you packaged tests to the tarball as well, it would be appreciated).pawamoy commentedon Apr 15, 2026
Thank you! So, I suggest we add tests and all other necessary files to the sdists for
griffelibandgriffecli, and leave thegriffesdist empty. Tests should run againstgriffelibandgriffecli, and not againstgriffe(this would be redundant). To avoid running tests forgriffecliwhen testinggriffelib, and inversely, I'll add pytest markers to all tests, so you can pass the right markers to filter tests. Or maybe I can try splitting the test suite in two, but it might be a bit more difficult. WDYT?@johnslavik interested in your opinion too!
mcepl commentedon Apr 16, 2026
Big +1 from me!
tests: Split test suite in two (CLI/lib)
pawamoy commentedon Jun 19, 2026
Done in #464, next published sdists should have tests included, except for the meta distribution
griffe:griffe: meta-distribution, depending ongriffecliandgriffelib, no testsgriffecli: CLI package, depending ongriffelib, tests for the CLI onlygriffelib: library providing thegriffepackage, no deps, tests for the libraryLet me know if you have trouble with specific tests and I'll add some
@skipifmarkers.