bug: 1.9.0 sdist is missing tests
Closed this issue ยท 7 comments
Description of the bug
The 1.9.0 sdist tarball no longer includes the tests
directory. As a result, we can no longer run tests when building the Gentoo package from it.
To Reproduce
$ wget https://files.pythonhosted.org/packages/33/f6/cf5be34d03d508261464ad11bad0f63bd5d3e94a15591089b0069105b757/markdown_exec-1.9.0.tar.gz
$ tar -tf markdown_exec-1.9.0.tar.gz | grep test
Full traceback
n/a
Expected behavior
Tests included in the archive, as they were in 1.8.2.
Environment information
n/a
Additional context
n/a
Oops! Thanks for the heads up. It's probably because I now specify source-includes = ["share"]
in pyproject.toml. I thought this would add to rather than overwrite defaults. Let me fix this.
By the way @mgorny, I never really paid attention to what I include in my source dists: do you need anything else apart from the tests folder? How can I make your life easier? Do you prefer handling the test dependencies yourself or should I include a requirements file of some kind? If you don't have time to teach me system packaging, feel free to just point me at online resources ๐
Pushed a fix as 1.9.1 ๐ Closing, but happy to continue chatting!
Pushed a fix as 1.9.1 ๐ Closing, but happy to continue chatting!
Thanks.
By the way @mgorny, I never really paid attention to what I include in my source dists: do you need anything else apart from the tests folder? How can I make your life easier? Do you prefer handling the test dependencies yourself or should I include a requirements file of some kind? If you don't have time to teach me system packaging, feel free to just point me at online resources ๐
Well, for our purposes, test files (and any test data, should that be required) is enough. In general, we also recommend including documentation sources, since users sometimes wish to be able to use documentation offline, though FWICS we've never used them for markdown-exec
.
As for dependencies, my personal recommendation is to put them in pyproject.toml
optional-dependencies
section, e.g. as test
optional. Then it's easy to install them e.g. via pip install .[test]
.
Thanks. I'm always conflicted with the idea of listing "development dependencies" in optional-dependencies
, since "extras" are, IIUC, rather used to declare additional groups of "production" dependencies, allowing more features to be used.
But more than "development" dependencies, they could be called "packaging" dependencies too ๐ค But then if I include test deps, and docs sources, I should include docs deps, and all scripting around it, which might become necessary, and therefore every other dev deps used by these scripts. Quickly I end up with all my dev-deps in optional dependencies and all my custom scripts in the source dist ๐ค
Anyway, I'll try to think about it and find resources that talk about it.
I suppose some projects work around that problem by installing tests within the package, and making it possible to run them after installing it (i.e. to verify that it still works). But that's rather a controversial topic.
Actually thinking about it, if you're going to list test dependencies in a file, please include it in sdist. Whenever I'm updating the Gentoo package, I'm looking at the diff, so having the dependencies there would help me know that I need to update the package as well. I generally check setup.*
, pyproject.toml
and *requirement*
, so any file like that would work.
Sounds good! Including more stuff in the sdist is the least I can do. You might hate me a bit though... my dev-deps requirements file is called devdeps.txt
๐