From 2f3ebbc44ff55bbb0b78419624adbf3ef6343a64 Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Thu, 5 Dec 2024 22:12:40 -0500 Subject: [PATCH] auto-versioning and adding axolotl.__version__ (#2127) * auto-versioning and adding axolotl.__version__ * removing file meant for codecov PR * adding dynamic dependencies, project metadata * extras/optional-dependencies are dynamic too --------- Co-authored-by: Dan Saunders Co-authored-by: Wing Lian --- pyproject.toml | 16 ++++++++++++++++ setup.py | 4 ++-- src/axolotl/__init__.py | 8 ++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..815e243274 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[build-system] +requires = ["setuptools>=64", "wheel", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "axolotl" +dynamic = ["version", "dependencies", "optional-dependencies"] +description = "LLM Trainer" +readme = "README.md" +requires-python = ">=3.10" + +[project.urls] +Homepage = "https://axolotl-ai-cloud.github.io/axolotl/" +Repository = "https://github.com/axolotl-ai-cloud/axolotl.git" + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py index 336da98f4b..ac2fd9d421 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ """setup.py for axolotl""" - import platform import re from importlib.metadata import PackageNotFoundError, version @@ -96,7 +95,8 @@ def parse_requirements(): setup( name="axolotl", - version="0.5.2", + use_scm_version=True, + setup_requires=["setuptools_scm"], description="LLM Trainer", long_description="Axolotl is a tool designed to streamline the fine-tuning of various AI models, offering support for multiple configurations and architectures.", package_dir={"": "src"}, diff --git a/src/axolotl/__init__.py b/src/axolotl/__init__.py index e69de29bb2..e555ece480 100644 --- a/src/axolotl/__init__.py +++ b/src/axolotl/__init__.py @@ -0,0 +1,8 @@ +"""Axolotl - Train and fine-tune large language models""" + +try: + from importlib.metadata import version + + __version__ = version("axolotl") +except ImportError: + __version__ = "unknown"