Move package/subpackage version inside package source #142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves package versions' from
setup.cfg
tosrc/<subpackage>/_version.py
in an attribute named__version__
. Anattr:
directive is used insetup.cfg
to access this versioning information for packaging metadata purposes.Ive tested installing subpackages locally in editable and non-editable modes. Likewise, Ive also tested that both wheels and tar gz archives of a subpackage created using
python -m build
also install properly without issue. That is not to say there is not a way to break it though.Note: it is required that the
__version__
attribute be imported in a subpackage's top level__init__.py
. Seesetuptools #1753
for more detail. I don't think this is a deal breaker (meaning adding complexity to the packaging process) and overly boiler plate, given that in the future I would like to introduce a public api for each subpackage that discriminates the current subpackage version to the user.Changes
__version__
in a_version.py
file. (this file sits even with the top level__init__.py
).Todos
events
are required after the discussion in Events package structure question #141 .Checklist