Skip to content

Commit

Permalink
Use setuptools_scm for version
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Dec 12, 2024
1 parent 3c021c8 commit 529860f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.egg-info
.direnv/
.envrc
.idea
__pycache__
python/coglet/_version.py
uv.lock
.envrc
.direnv/
python/.coverage*
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = 'coglet'
version = '0.1.0'
dynamic = ['version']
description = 'Minimum viable Cog runtime'
readme = 'README.md'
requires-python = '>=3.9'
Expand All @@ -27,7 +27,7 @@ test = [
]

[build-system]
requires = ['setuptools']
requires = ['setuptools', 'setuptools-scm']
build-backend = 'setuptools.build_meta'

[tool.pytest.ini_options]
Expand All @@ -51,3 +51,6 @@ extend-select = ['I']
[tool.setuptools.packages.find]
where = ['python']
exclude = ['tests*']

[tool.setuptools_scm]
version_file = "python/coglet/_version.py"
5 changes: 5 additions & 0 deletions python/coglet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import sys
import warnings

try:
from ._version import __version__
except ImportError:
__version__ = '0.0.0+unknown'

warnings.warn(
(
'coglet/_compat/ is being added to the front of sys.path '
Expand Down
4 changes: 2 additions & 2 deletions python/coglet/_compat/cog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import coglet
from coglet.api import (
BaseModel,
BasePredictor,
Expand All @@ -8,8 +9,7 @@
Secret,
)

__version__ = '0.0.8001+coglet'
__version_tuple__ = (0, 0, 8001, '', 'coglet')
__version__ = coglet.__version__

__all__ = [
'BaseModel',
Expand Down

0 comments on commit 529860f

Please sign in to comment.