Skip to content

Commit 9dbc10e

Browse files
committed
Parse DJ_VERSION from pyproject.toml
1 parent 16e4347 commit 9dbc10e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.github/workflows/development.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
python-version: ${{matrix.py_ver}}
3535
- name: Validate version and release notes
3636
run: |
37-
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
37+
DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+')
3838
RELEASE_BODY=$(python3 -c \
3939
'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \
4040
)
@@ -167,7 +167,7 @@ jobs:
167167
python-version: ${{matrix.py_ver}}
168168
- name: Determine package version
169169
run: |
170-
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
170+
DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+')
171171
RELEASE_BODY=$(python -c \
172172
'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \
173173
)

datajoint/version.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
try:
2-
# Use datajoint/_version.py written by setuptools_scm if it exists
3-
# This module is not tracked in VCS and defines a __version_tuple__ like
4-
# (0, 14, 3, 'dev224', 'g0812fe17.d20240919')
2+
# Use datajoint/_version.py written by setuptools_scm if it exists
3+
# This module is not tracked in VCS and defines a __version_tuple__ like
4+
# (0, 14, 3, 'dev224', 'g0812fe17.d20240919')
55
from ._version import __version_tuple__ as version_tuple
66
except ImportError:
7-
version_tuple = (0, 14, 3)
7+
version_tuple = (0, 14, 3)
88

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

docker-compose-build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PY_VER=3.9 IMAGE=djbase DISTRO=debian DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) HOST_UID=$(id -u) docker compose -f docker-compose-build.yaml up --exit-code-from app --build
1+
# PY_VER=3.9 IMAGE=djbase DISTRO=debian DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+') HOST_UID=$(id -u) docker compose -f docker-compose-build.yaml up --exit-code-from app --build
22
#
33
# Intended for updating dependencies and docker image.
44
# Used to build release artifacts.

docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test up --build --exit-code-from djtest djtest
1+
# DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+') docker compose --profile test up --build --exit-code-from djtest djtest
22
services:
33
db:
44
image: datajoint/mysql:${MYSQL_VER:-8.0}

docs/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
elif echo "$${MODE}" | grep -iE "qa|build" &>/dev/null; then
2828
git branch -D gh-pages || true
2929
git fetch $${UPSTREAM_REPO} gh-pages:gh-pages || true
30-
mike deploy --config-file ./docs/mkdocs.yaml -u $$(grep -oE '\d+\.\d+' /main/$${PACKAGE}/version.py) latest
30+
mike deploy --config-file ./docs/mkdocs.yaml -u $$(grep -m 1 version /main/pyproject.toml | grep -oP '\d+\.\d+\.\d+') latest
3131
mike set-default --config-file ./docs/mkdocs.yaml latest
3232
if echo "$${MODE}" | grep -i qa &>/dev/null; then
3333
mike serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80

0 commit comments

Comments
 (0)