Skip to content

Commit

Permalink
Parse DJ_VERSION from pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
ethho committed Sep 19, 2024
1 parent 16e4347 commit 9dbc10e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
python-version: ${{matrix.py_ver}}
- name: Validate version and release notes
run: |
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+')
RELEASE_BODY=$(python3 -c \
'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \
)
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
python-version: ${{matrix.py_ver}}
- name: Determine package version
run: |
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py)
DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+')
RELEASE_BODY=$(python -c \
'print(open("./CHANGELOG.md").read().split("\n\n")[1].split("\n", 1)[1])' \
)
Expand Down
8 changes: 4 additions & 4 deletions datajoint/version.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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')
# 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_tuple = (0, 14, 3)

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

Expand Down
2 changes: 1 addition & 1 deletion docker-compose-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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
# 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
#
# Intended for updating dependencies and docker image.
# Used to build release artifacts.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) docker compose --profile test up --build --exit-code-from djtest djtest
# DJ_VERSION=$(grep -m 1 version pyproject.toml | grep -oP '\d+\.\d+\.\d+') docker compose --profile test up --build --exit-code-from djtest djtest
services:
db:
image: datajoint/mysql:${MYSQL_VER:-8.0}
Expand Down
2 changes: 1 addition & 1 deletion docs/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
elif echo "$${MODE}" | grep -iE "qa|build" &>/dev/null; then
git branch -D gh-pages || true
git fetch $${UPSTREAM_REPO} gh-pages:gh-pages || true
mike deploy --config-file ./docs/mkdocs.yaml -u $$(grep -oE '\d+\.\d+' /main/$${PACKAGE}/version.py) latest
mike deploy --config-file ./docs/mkdocs.yaml -u $$(grep -m 1 version /main/pyproject.toml | grep -oP '\d+\.\d+\.\d+') latest
mike set-default --config-file ./docs/mkdocs.yaml latest
if echo "$${MODE}" | grep -i qa &>/dev/null; then
mike serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
Expand Down

0 comments on commit 9dbc10e

Please sign in to comment.