Skip to content

Commit

Permalink
Use setuptools_scm to generate package version - Merge pull request #14
Browse files Browse the repository at this point in the history
… from gotmax23/setuptools-scm

Use setuptools_scm to generate package version
  • Loading branch information
NikitaBeloglazov authored Feb 23, 2024
2 parents 1d245f5 + 74f64f4 commit 193b231
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 87 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build
- name: Mark version
run: python3 tags_marker.py
- name: Build package
run: python -m build
- name: Store the distribution packages
Expand Down
14 changes: 12 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=61.0", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
name = "clipman"
version = "!!{PLACEHOLDER}!!" # PLEASE RUN tags_marker.py BEFORE PACKAGING
dynamic = ["version"] # setuptools_scm
authors = [
{name="NikitaBeloglazov", email="[email protected]"},
]
Expand All @@ -28,3 +28,13 @@ classifiers = [
[project.urls]
"Homepage" = "https://github.com/NikitaBeloglazov/clipman"
"Bug Tracker" = "https://github.com/NikitaBeloglazov/clipman/issues"

[tool.setuptools_scm]
# DO NOT add numbers to version. I decide which version I need to post
version_scheme = "release-branch-semver"

# get only tag, 3.2.0, not an 3.2.0.dev17+g2868326.d20240223abcdefghijklmnopqrstuvwxyz
git_describe_command = "git describe --tags main"

# overwrites an fallback template
version_file = "src/clipman/__version__.py"
9 changes: 6 additions & 3 deletions src/clipman/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
Created for storing version number.
The version number will be placed here based on the tag in Github using the tags_marker.py script.
The version number will be placed here based on the tag in Github using the setuptools_scm.
This file must be overwritten
Having "!!{PLACEHOLDER}!!" in final releases is NOT allowed.
Having 0.0.0 in final releases is NOT allowed.
If you see this comment, setuptools_scm was not started
"""
__version__="!!{PLACEHOLDER}!!"
__version__ = version = '0.0.0'
__version_tuple__ = version_tuple = (0, 0, 0)
80 changes: 0 additions & 80 deletions tags_marker.py

This file was deleted.

0 comments on commit 193b231

Please sign in to comment.