Skip to content

Commit

Permalink
Adding versioning + auto alembic upgrade + upgrade/downgrade debug fo…
Browse files Browse the repository at this point in the history
…r latest version
  • Loading branch information
paulstretenowich committed Sep 10, 2024
1 parent fc28f13 commit a9eaf4b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
16 changes: 16 additions & 0 deletions _version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '1.0.7.dev7+gfc28f13.d20240910'
__version_tuple__ = version_tuple = (1, 0, 7, 'dev7', 'gfc28f13.d20240910')
2 changes: 1 addition & 1 deletion entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ if [[ -v C3G_INIT_DB ]]; then
echo instanciating data base
flask --app $APP init-db $DB_OPS
fi

alembic upgrade head
gunicorn "project_tracking:create_app()" "${@}"
3 changes: 3 additions & 0 deletions migration/alembic/versions/d1dc98f61aee_major_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ def downgrade() -> None:
op.drop_column('experiment', 'ext_src')
op.drop_column('experiment', 'ext_id')
op.rename_table('specimen', 'patient')
op.drop_column('patient', 'ext_src')
op.drop_column('patient', 'ext_id')
op.add_column('patient', sa.Column('fms_id', sa.VARCHAR(), autoincrement=False, nullable=True))
op.drop_table('reference')
sa.Enum('VALID', 'ON_HOLD', 'INVALID', name='stateenum').drop(op.get_bind())
# ### end Alembic commands ###
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.pytest.ini_options]
Expand All @@ -13,9 +13,15 @@ testpaths = [
run.branch = true
run.source = ["project_tracking"]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "_version.py"

[project]
name = "project_tracking"
version = "0.0.1"
dynamic = ["version"]
authors = [
{ name="P-O Quirion", email="po.quirion@mcgill.ca" },
{ name="Paul Streteowich", email="paul.stretenowich@mcgill.ca" },
Expand Down

0 comments on commit a9eaf4b

Please sign in to comment.