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

bug: 1.9.0 sdist is missing tests #55

Closed
mgorny opened this issue Jun 14, 2024 · 7 comments
Closed

bug: 1.9.0 sdist is missing tests #55

mgorny opened this issue Jun 14, 2024 · 7 comments
Assignees

Comments

@mgorny
Copy link

mgorny commented Jun 14, 2024

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

@pawamoy
Copy link
Owner

pawamoy commented Jun 14, 2024

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.

@pawamoy
Copy link
Owner

pawamoy commented Jun 14, 2024

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 😄

pawamoy added a commit that referenced this issue Jun 14, 2024
@pawamoy
Copy link
Owner

pawamoy commented Jun 14, 2024

Pushed a fix as 1.9.1 🙂 Closing, but happy to continue chatting!

@pawamoy pawamoy closed this as completed Jun 14, 2024
@mgorny
Copy link
Author

mgorny commented Jun 14, 2024

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].

@pawamoy
Copy link
Owner

pawamoy commented Jun 14, 2024

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.

@mgorny
Copy link
Author

mgorny commented Jun 14, 2024

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.

@pawamoy
Copy link
Owner

pawamoy commented Jun 14, 2024

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 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants