-
Notifications
You must be signed in to change notification settings - Fork 306
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
Clean up MANIFEST.in #986
Clean up MANIFEST.in #986
Conversation
Potentially, in dev environment, a lot of cruft was being included in dists. This results in overly large installs in tox envs. This commit tightens up the recursive-include rules in `MANIFEST.in`. It also adds [check-manifest][] to the the commands run in the `lint` tox env, in an attempt to make sure we're not leaving anything out. [check-manifest]: https://pypi.org/project/check-manifest/
NB: This PR removes the Maybe we should also omit the javascript & css source from the sdist? |
setuptools_scm should include all git-tracked files in the sdist, so we could reduce the MANIFEST.in to just the exclude rules, right?
I'd be for keeping the tests in the sdist. It is the historic behaviour of distutils to include tests and while there seems to be no clear consensus on on the exact purpose of the "sdist", I'm with the following answer in that thread (https://discuss.python.org/t/purpose-of-an-sdist/4639/5). |
I think |
Well, that's kind of cool! As it turns out, (My first thought was how does that work when installing from an sdist, since in that case git metadata is not available? But quick — not necessarily conclusive — testing indicates that it does indeed work. I guess the manifest is coming from the We do need to explicitly include anything that's not in git (e.g. the webpack output.)
I don't have strong feelings, either way. I still see sdists as primarily an instrument of distribution/installation (though, admittedly, given the existence of wheels, that purpose is pretty much obsolete, at least for pure-python distributions.) What about the (Again, I don't have strong feelings either way, but none of this feels required for installation to me.)
As a third (or fourth?) alternative, some distributions appear to use the github-provided archives (e.g. https://github.com/lektor/lektor/archive/refs/tags/v3.3.1.tar.gz), which include everything (no more, no less) that's in git. Which brings up a point: @jcharaoui: I looked quickly at the Debian packaging and it appears that it builds from the github archive (rather than the sdist). That's okay, but when building from clean git source, one has to first run webpack (e.g. via (The sdist on PyPI does include the webpack output.) |
@yagebu: Tangential question: would it be possible to move all the npm/node/tsx config files (the *.js and *.json files) that are in Maybe even better, what about moving all the webpack source to a top-level directory (maybe named Maybe |
In MANIFEST.in, we only need to manually include generated files. But, we also need to exclude a bunch of stuff that is in git which we don't want in the sdist. Also, disuse `check-manifest`, since it doesn't do us much good alongisde `setuptools_scm`.
No strong preference, this to me is part of "documentation" of which we don't have a whole lot to include, so I don't think this needs to be shipped either (in particular since there's
Exclude.
I believe that archive can't be used to build a sdist (with setuptools_scm) since the version and the list of files can't be deduced from the contents of the archive.
I was gonna suggest that at some point and I'm happy to do that in a followup PR :) This is exactly what I did for Fava and that has worked very well. Although I'd name the directory |
Just as an aside, it's Debian's policy is to build everything from source: it's not allowed to distribute code compiled by upstreams. This is in part why Python packagers in Debian prefer to pull code from git releases instead of PyPI since the latter makes it easier to mistakenly distribute pre-compiled code. @dairiki I'm currently preparing an package update for 3.3.1, see https://salsa.debian.org/debian/lektor/ |
@jcharaoui That's fine, but then you'll have to arrange to manually compile the javascript and CSS used by the admin frontend. Normally that's done before we build sdists and wheels for PyPI by running cd lektor/admin
npm install
npm run webpack This generates a number of files — js, CSS, and fonts and images — in (All of those paths quoted above are about to change in PR #1003.) Obviously, this means you'll need |
Potentially, in dev environment, a lot of cruft was being included in dists. This results in overly large installs in tox envs.
This commit tightens up the recursive-include rules in
MANIFEST.in
.It also adds check-manifest to the the commands run in the
lint
tox env, in an attempt to make sure we're not leaving anything out.