use VERSION file and set dev version

This commit is contained in:
Wing Lian
2026-01-20 10:22:17 -05:00
parent 6e42def14b
commit 3f9555822e
5 changed files with 8 additions and 11 deletions

View File

@@ -48,9 +48,9 @@ jobs:
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
- name: Update version in src/axolotl/__init__.py
run: |
sed -i -E 's/version="([0-9.]+)",/version="${{ steps.tag.outputs.TAG_NAME }}",/g' setup.py
sed -i -E's/__version__ = "([0-9.]+)"/__version__ = "${{ steps.tag.outputs.TAG_NAME }}"/g' src/axolotl/__init__.py
- name: Build a source dist
run: |

1
VERSION Normal file
View File

@@ -0,0 +1 @@
0.14.0.dev0

View File

@@ -24,6 +24,9 @@ Repository = "https://github.com/axolotl-ai-cloud/axolotl.git"
py-modules = ["setuptools_axolotl_dynamic_dependencies"]
include-package-data = true
[tool.setuptools.dynamic]
version = { file = "VERSION" }
[tool.setuptools.cmdclass]
build_py = "setuptools_axolotl_dynamic_dependencies.BuildPyCommand"

View File

@@ -1,6 +1,5 @@
"""setup.py for axolotl"""
import ast
import os
import platform
import re
@@ -130,15 +129,11 @@ def parse_requirements(extras_require_map):
def get_package_version():
with open(
Path(os.path.dirname(os.path.abspath(__file__)))
/ "src"
/ "axolotl"
/ "__init__.py",
Path(os.path.dirname(os.path.abspath(__file__))) / "VERSION",
"r",
encoding="utf-8",
) as fin:
version_match = re.search(r"^__version__\s*=\s*(.*)$", fin.read(), re.MULTILINE)
version_ = ast.literal_eval(version_match.group(1))
version_ = fin.read().strip()
return version_

View File

@@ -3,5 +3,3 @@
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__) # Make this a namespace package
__version__ = "0.13.1"