Skip to content

Commit

Permalink
Use datajoint/_version.py written by setuptools_scm
Browse files Browse the repository at this point in the history
  • Loading branch information
ethho committed Sep 19, 2024
1 parent 0812fe1 commit fc5a27f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jupyter_custom.js
.eggs
*.code-workspace
docs/site
datajoint/_version.py


!.vscode/settings.json
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ USER root
RUN \
chown -R ${HOST_UID:-1000}:mambauser /main && \
chown -R ${HOST_UID:-1000}:mambauser /src && \
micromamba run -n base pip install -q --no-cache-dir /main && \
${CONDA_BIN} run -n base pip install -q --no-cache-dir /main && \
rm -r /main/*
USER ${MAMBA_USER}
10 changes: 9 additions & 1 deletion datajoint/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
__version__ = "0.14.3"
try:
# Use datajoint/_version.py written by setuptools_scm if it exists
# This module is not tracked in VCS and defines a __version_tuple__ like
# (0, 14, 3, 'dev224', 'g0812fe17.d20240919')
from ._version import __version_tuple__ as version_tuple
except ImportError:
version_tuple = (0, 14, 3)

__version__ = ".".join(str(x) for x in version_tuple[:3])

assert len(__version__) <= 10 # The log table limits version to the 10 characters
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ datajoint = "datajoint.cli:cli"
[tool.setuptools]
packages = ["datajoint"]

[tool.setuptools_scm]
version_file = "datajoint/_version.py"

[build-system]
requires = [
"setuptools>=60",
Expand Down

0 comments on commit fc5a27f

Please sign in to comment.