Skip to content

Use setuptools_scm for version management - #20

Merged
diazona merged 4 commits into
masterfrom
use-setuptools-scm/1/dev
Dec 21, 2021
Merged

Use setuptools_scm for version management#20
diazona merged 4 commits into
masterfrom
use-setuptools-scm/1/dev

Conversation

@diazona

@diazona diazona commented Nov 19, 2021

Copy link
Copy Markdown
Contributor

This is what I have in mind for implementing #8. I'm open to any feedback about whether we should go ahead with this.

@diazona
diazona requested review from coordt and redtoad November 19, 2021 02:44
@diazona diazona linked an issue Nov 19, 2021 that may be closed by this pull request
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread setup.py
@diazona
diazona force-pushed the use-setuptools-scm/1/dev branch from 6301e81 to b466118 Compare November 21, 2021 22:19
Comment thread pytest_localserver/__init__.py
@diazona
diazona force-pushed the use-setuptools-scm/1/dev branch from b466118 to a5b844e Compare November 30, 2021 23:33
@diazona
diazona marked this pull request as draft November 30, 2021 23:33
@diazona diazona added this to the 0.6.0 milestone Dec 1, 2021
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
diazona force-pushed the use-setuptools-scm/1/dev branch from 1cb8237 to a269cf6 Compare December 16, 2021 20:19
@diazona
diazona marked this pull request as ready for review December 18, 2021 10:00
@diazona diazona self-assigned this Dec 18, 2021
@diazona

diazona commented Dec 18, 2021

Copy link
Copy Markdown
Contributor Author

@coordt @redtoad any final thoughts? Otherwise I'll merge this in a day or two

@diazona
diazona merged commit bc0d4d6 into master Dec 21, 2021
@diazona
diazona deleted the use-setuptools-scm/1/dev branch December 21, 2021 00:59
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

Successfully merging this pull request may close these issues.

Use setuptools_scm for version management

2 participants