Skip to content

Commit

Permalink
implement dynamic version
Browse files Browse the repository at this point in the history
  • Loading branch information
speed1313 committed Sep 24, 2024
1 parent 16c634a commit ef90fd8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ jobs:
enable-cache: true
- name: Sync dependencies
run: rye sync
- name: Get release tag
id: get_tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Write version to _version.py
run: |
python -m pip install --upgrade pip
pip install hatch
hatch version ${RELEASE_TAG}
- name: Build package
run: rye build
- name: publish
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ text2dataset = "text2dataset.main:main"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/text2dataset/_version.py"


[tool.hatch.build]
exclude = [
"/.*",
Expand Down
7 changes: 7 additions & 0 deletions src/text2dataset/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Version specifier.
DON'T TOUCH THIS FILE.
This file is replaced during the release process.
"""

__version__ = "0.0.0"

0 comments on commit ef90fd8

Please sign in to comment.