Repository navigation
feat: Auto-derive version from git tags #97
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,33 @@ | ||
| # Release Process | ||
|
|
||
| 1. Write NEWS entries in the same format as usual. | ||
| ## Pre-Release | ||
|
|
||
| git shortlog 0.6.0.. | grep -i -v trivial | grep -v Merge > NEWS.new | ||
| Write NEWS entries in the same format as usual: | ||
|
|
||
| git shortlog <last-tag>.. | grep -i -v trivial | grep -v Merge > NEWS.new | ||
| # add entries to ./docs/source/versionhistory.rst | ||
|
|
||
| Commit changes to git: | ||
| ## Release | ||
|
|
||
| Commit changes and create an annotated git tag | ||
| (package version is auto-derived from the tag): | ||
|
|
||
| # MAKE SURE THAT setup.py IS ALSO CORRECT | ||
| export release_ver="0.6.1" | ||
| git commit -a -m "Release ${release_ver}" | ||
| git tag -s -f -m "Release ${release_ver}" "${release_ver}" | ||
| git commit -a -m "Release X.Y.Z" | ||
| git tag -s -m "Release X.Y.Z" X.Y.Z | ||
| rm -rf dist/ | ||
| make pkg | ||
| ./env/bin/twine upload dist/uswid-${release_ver}* | ||
| ./env/bin/twine upload dist/uswid-* | ||
|
|
||
| ## Post-Release | ||
|
|
||
| Do post release version bump in setup.py: | ||
| Push commits and tags: | ||
|
|
||
| git commit -a -m "trivial: post release version bump" | ||
| git push | ||
| git push --tags | ||
|
|
||
| ## Notes | ||
|
|
||
| - Version is automatically derived from git tags using setuptools_scm | ||
| - `uswid/_version.py` is generated at build time | ||
| - No manual version updates are required | ||
| - Release flow: commit → tag → build → upload | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| [build-system] | ||
| requires = [ | ||
| "setuptools>=77", | ||
| "setuptools-scm>=8", | ||
| ] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "uswid" | ||
| authors = [{name = "Richard Hughes", email = "richard@hughsie.com"}] | ||
| license = "BSD-2-Clause-Patent" | ||
| license-files = ["LICENSE"] | ||
| keywords = ["swid", "sbom", "coswid"] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Developers", | ||
| "Programming Language :: Python :: 3", | ||
| "Topic :: Utilities", | ||
| "Topic :: System :: Archiving", | ||
| ] | ||
| description = "A pure-python library for embedding CoSWID data" | ||
| readme = "README.md" | ||
| dependencies = [ | ||
| "cbor2", | ||
| "lxml", | ||
| "pefile", | ||
| "importlib-metadata >= 1.0 ; python_version < '3.8'", | ||
| ] | ||
| dynamic = [ | ||
| "version", | ||
| ] | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/hughsie/python-uswid" | ||
|
|
||
| [project.scripts] | ||
| uswid = "uswid.cli:main" | ||
|
|
||
| [tool.setuptools_scm] | ||
| version_scheme = "guess-next-dev" | ||
| local_scheme = "no-local-version" | ||
| version_file = "uswid/_version.py" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
|
|
||
| setup( | ||
| name="uswid", | ||
| version="0.6.1", | ||
| license="BSD-2-Clause-Patent", | ||
| license_files=[ | ||
| "LICENSE", | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # This file is generated by setuptools_scm at build time. | ||
| # Do not edit manually. | ||
| # | ||
| # When building from a git tag, this will contain the exact | ||
| # released version (e.g. "0.6.0"). | ||
| # On development branches, this will be a ".devN" version. | ||
|
|
||
| version = "0.0.0" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.