Compare commits

...

4 Commits

Author SHA1 Message Date
Wing Lian
68fc0eeab3 strip only starting 'v' char; e.g don't strip from '.dev' 2026-01-21 09:31:17 -05:00
Wing Lian
729221e9bb ensure version is available 2026-01-20 11:26:15 -05:00
Wing Lian
5d0d76e4f4 update pypi publish to update VERSION file 2026-01-20 10:26:51 -05:00
Wing Lian
3f9555822e use VERSION file and set dev version 2026-01-20 10:22:17 -05:00
5 changed files with 13 additions and 10 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 VERSION file
run: |
sed -i -E 's/version="([0-9.]+)",/version="${{ steps.tag.outputs.TAG_NAME }}",/g' setup.py
echo "${{ steps.tag.outputs.TAG_NAME }}" | sed 's/^v//' > VERSION
- 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

@@ -1,7 +1,11 @@
"""Axolotl - Train and fine-tune large language models"""
import pkgutil
from importlib.metadata import PackageNotFoundError, version
__path__ = pkgutil.extend_path(__path__, __name__) # Make this a namespace package
__version__ = "0.13.1"
try:
__version__ = version("axolotl")
except PackageNotFoundError:
__version__ = "unknown"