Problems with leaking development information into the sdist package. #745
Replies: 1 comment 9 replies
-
In general, the config that Flit expects is what's needed for building a package, and thus belongs in pyproject.toml. I see from the linked issue on your own repo that you're specifically thinking about development dependencies. I habitually put those in optional dependencies (and Flit allows some shortcuts with that), but that's not really what optional dependencies are designed for. There is a fairly recent spec for dependency groups which provides a better place for these, but the spec explicitly says it goes in If you are really concerned about hiding development dependencies from sdists (I don't think it matters much), then probably your best option is to put them in The [In case anyone is concerned by the issue title, leaking does not imply a security leak, as far as I'm aware - although you should be aware that publishing a Python package includes publishing anything in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently the pyproject.toml file has become the goto-source for configuring a package as well as the tools used to build that same package. As such, when building an sdist with
flit
those settings “leak” into the published package via that pyproject.toml file.1Splitting dev tools configurations — and I consider
flit
a dev tool separate from the published package! — into a separate file (e.g. develop.toml) works mostly except forflit
:flit --ini-file develop.toml build --setup-py --format sdist
complains:flit
tool configuration is stored in develop.toml. (Also note that incorrect file name in the error message!)flit build --setup-py --format sdist
generates an sdist package whose embedded pyproject.toml contains theflit
configuration and I argue that’s an unnecessary “leak”.I’m not sure how to go about solving this without modifying
flit
’s behavior. I think it’s sensible to use--ini-file
to configure flit and still require pyproject.toml for the package metadata itself; or one could imagine a cmd line switch that removes non-metadata tables from the toml file. However, moving package metadata into develop.toml wouldn’t work well if I want to install my package in editable mode (which requires pyproject.toml).I appreciate your suggestions…
Footnotes
For more details see issue https://github.com/jenstroeger/python-package-template/issues/951 and PR https://github.com/jenstroeger/python-package-template/pull/952. ↩
Beta Was this translation helpful? Give feedback.
All reactions