Use setuptools_scm for version management - #20
Merged
Conversation
diazona
force-pushed
the
use-setuptools-scm/1/dev
branch
from
November 21, 2021 22:19
6301e81 to
b466118
Compare
diazona
commented
Nov 21, 2021
diazona
force-pushed
the
use-setuptools-scm/1/dev
branch
from
November 30, 2021 23:33
b466118 to
a5b844e
Compare
diazona
marked this pull request as draft
November 30, 2021 23:33
This commit adds a pyproject.toml file specifiny the basic requirements to use setuptools as the build backend. It uses isolated builds, as necessary to make tox use the configuration in pyproject.toml when building the package to use for testing. Otherwise it would just run setup.py, which might miss the configuration in pyproject.toml.
The version requirements were determined by testing with various old versions of setuptools and setuptools_scm. Using setuptools_scm <3.4.1 causes the build to fail, and using setuptools <42 means it fails to automatically determine the version number. Of course, in practice I expect that people will generally be using relatively recent versions of both packages, but the listed requirements express the minimum versions that appear to be compatible with this process.
This commit removes the explicit listing of the version number in both __init__.py and setup.py, and replaces the former with the version number computed by setuptools_scm. As a prerequisite to that, I've added a configuration item in pyproject.toml to have setuptools_scm write the version number to a file. I've imported the version number under the name `VERSION` to keep it compatibile with previous versions of pytest_localserver. If `version` is a more standard identifier, we might want to change or add that in the future.
This new test establishes pytest_localserver.VERSION as part of the API of the package. The test won't catch changes where that constant is replaced by some other string value, but hopefully that's not a concern.
diazona
force-pushed
the
use-setuptools-scm/1/dev
branch
from
December 16, 2021 20:19
1cb8237 to
a269cf6
Compare
diazona
marked this pull request as ready for review
December 18, 2021 10:00
RonnyPfannschmidt
approved these changes
Dec 18, 2021
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is what I have in mind for implementing #8. I'm open to any feedback about whether we should go ahead with this.