From 60816dda3fcc4d3c0cae26c3178985ab48635c28 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sun, 16 Mar 2025 21:49:56 -0500 Subject: [PATCH] wrap up conversion to SSG Signed-off-by: Brian S. Stephan --- incorporealcms/__init__.py | 9 +++++++++ incorporealcms/ssg.py | 3 ++- requirements/requirements-dev.txt | 12 ++++++------ requirements/requirements.txt | 10 +++++----- tox.ini | 3 --- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/incorporealcms/__init__.py b/incorporealcms/__init__.py index 4a6a0cc..f3b08a7 100644 --- a/incorporealcms/__init__.py +++ b/incorporealcms/__init__.py @@ -12,6 +12,15 @@ from termcolor import cprint from incorporealcms.config import Config +# dynamically generate version number +try: + # packaged/pip install -e . value + from ._version import version as __version__ +except ImportError: + # local clone value + from setuptools_scm import get_version + __version__ = get_version(root='..', relative_to=__file__) + def init_instance(instance_path: str, extra_config: dict = None): """Create the instance context, with allowances for customizing path and test settings.""" diff --git a/incorporealcms/ssg.py b/incorporealcms/ssg.py index a175039..2015f90 100644 --- a/incorporealcms/ssg.py +++ b/incorporealcms/ssg.py @@ -11,7 +11,7 @@ import tempfile from termcolor import cprint -from incorporealcms import init_instance +from incorporealcms import __version__, init_instance from incorporealcms.markdown import handle_markdown_file_path @@ -176,6 +176,7 @@ def build(): ) args = parser.parse_args() + cprint(f"incorporealcms-build v{__version__}", 'green') # check output path before doing work if not os.path.isdir(args.output_dir): # if it doesn't exist, great, we'll just move the temporary dir later; diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 8d243c1..cf9ec78 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -43,7 +43,7 @@ click==8.1.8 # typer colorama==0.4.6 # via tox -coverage[toml]==7.6.12 +coverage[toml]==7.7.0 # via pytest-cov cryptography==44.0.2 # via @@ -112,7 +112,7 @@ jeepney==0.9.0 # via # keyring # secretstorage -jinja2==3.1.3 +jinja2==3.1.6 # via # incorporeal-cms (pyproject.toml) # reuse @@ -123,13 +123,13 @@ keyring==25.6.0 # via twine license-expression==30.4.1 # via reuse -lxml==5.2.1 +lxml==5.3.1 # via feedgen -markdown==3.6 +markdown==3.7 # via incorporeal-cms (pyproject.toml) markdown-it-py==3.0.0 # via rich -markupsafe==2.1.5 +markupsafe==3.0.2 # via jinja2 marshmallow==3.26.1 # via safety @@ -252,7 +252,7 @@ setuptools-scm==8.2.0 # via incorporeal-cms (pyproject.toml) shellingham==1.5.4 # via typer -six==1.16.0 +six==1.17.0 # via python-dateutil snowballstemmer==2.2.0 # via pydocstyle diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 38acbc6..d302042 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -6,17 +6,17 @@ # feedgen==1.0.0 # via incorporeal-cms (pyproject.toml) -jinja2==3.1.3 +jinja2==3.1.6 # via incorporeal-cms (pyproject.toml) -lxml==5.2.1 +lxml==5.3.1 # via feedgen -markdown==3.6 +markdown==3.7 # via incorporeal-cms (pyproject.toml) -markupsafe==2.1.5 +markupsafe==3.0.2 # via jinja2 python-dateutil==2.9.0.post0 # via feedgen -six==1.16.0 +six==1.17.0 # via python-dateutil termcolor==2.5.0 # via incorporeal-cms (pyproject.toml) diff --git a/tox.ini b/tox.ini index 41e3e8c..ca3ad1e 100644 --- a/tox.ini +++ b/tox.ini @@ -74,6 +74,3 @@ source = [coverage:run] branch = True - -omit = - **/_version.py