Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding versioning + auto alembic upgrade + upgrade/downgrade debug fo… #36

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="[email protected]" },
{ name="Paul Streteowich", email="[email protected]" },
Expand Down