diff --git a/medcat-demo-app/webapp/Dockerfile b/medcat-demo-app/webapp/Dockerfile index 4ce1c9ecf..4c0d581d4 100644 --- a/medcat-demo-app/webapp/Dockerfile +++ b/medcat-demo-app/webapp/Dockerfile @@ -30,7 +30,7 @@ RUN pip install -U pip && if [ "$USE_CPU_TORCH" = "true" ]; then \ ARG REINSTALL_CORE_FROM_LOCAL=false RUN if [ "$REINSTALL_CORE_FROM_LOCAL" = "true" ]; then \ echo "Reinstalling medcat based on relative path"; \ - pip install -e "/webapp/medcat-v2[meta-cat,spacy]"; \ + SETUPTOOLS_SCM_PRETEND_VERSION="2.4.0-dev0" pip install -e "/webapp/medcat-v2[meta-cat,spacy]"; \ fi # Get the spacy model (for later copy) diff --git a/medcat-service/Dockerfile b/medcat-service/Dockerfile index 0c1ca1796..cf6eb8fe9 100644 --- a/medcat-service/Dockerfile +++ b/medcat-service/Dockerfile @@ -29,7 +29,7 @@ COPY . /cat ARG REINSTALL_CORE_FROM_LOCAL=false RUN if [ "$REINSTALL_CORE_FROM_LOCAL" = "true" ]; then \ echo "Reinstalling medcat based on relative path"; \ - pip install -e "./medcat-v2[meta-cat,spacy]"; \ + SETUPTOOLS_SCM_PRETEND_VERSION="2.4.0-dev0" pip install -e "./medcat-v2[meta-cat,spacy]"; \ fi # Now run the simple api diff --git a/medcat-service/Dockerfile_gpu b/medcat-service/Dockerfile_gpu index 5f756bf2b..2086e64f5 100644 --- a/medcat-service/Dockerfile_gpu +++ b/medcat-service/Dockerfile_gpu @@ -50,7 +50,7 @@ COPY . /cat ARG REINSTALL_CORE_FROM_LOCAL=false RUN if [ "$REINSTALL_CORE_FROM_LOCAL" = "true" ]; then \ echo "Reinstalling medcat based on relative path"; \ - pip install -e "./medcat-v2[meta-cat,spacy]"; \ + SETUPTOOLS_SCM_PRETEND_VERSION="2.4.0-dev0" pip install -e "./medcat-v2[meta-cat,spacy]"; \ fi # Now run the simple api diff --git a/medcat-v2/.release/prepare_minor_release.sh b/medcat-v2/.release/prepare_minor_release.sh index 415d9ac97..ee9299dfe 100644 --- a/medcat-v2/.release/prepare_minor_release.sh +++ b/medcat-v2/.release/prepare_minor_release.sh @@ -67,18 +67,6 @@ fi # NOTE: will overwrite release branch if --force is specified run_or_echo git checkout -B "$RELEASE_BRANCH" -# Update version in pyproject.toml -if [[ "$(uname)" == "Darwin" ]]; then - # macOS (BSD sed) - run_or_echo sed -i \'\' \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml -else - # Linux (GNU sed) - run_or_echo sed -i \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml -fi - -run_or_echo git add pyproject.toml -run_or_echo git commit -m \"Bump version to $VERSION for release\" - # Create and push tag run_or_echo git tag -a \"$VERSION_TAG\" -m \"Release v$VERSION\" run_or_echo git push origin \"$RELEASE_BRANCH\" diff --git a/medcat-v2/.release/prepare_patch_release.sh b/medcat-v2/.release/prepare_patch_release.sh index d4700235c..31aba83aa 100644 --- a/medcat-v2/.release/prepare_patch_release.sh +++ b/medcat-v2/.release/prepare_patch_release.sh @@ -169,20 +169,6 @@ for HASH in "${CHERRYPICK_HASHES[@]-}"; do fi done - -# Update version in pyproject.toml -if [[ "$(uname)" == "Darwin" ]]; then - # macOS (BSD sed) - run_or_echo sed -i \'\' \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml -else - # Linux (GNU sed) - run_or_echo sed -i \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml -fi - -# add and commit changes -run_or_echo git add pyproject.toml -run_or_echo git commit -m \"Bump version to $VERSION\" --allow-empty - # now do the tagging # NOTE: can force since without the `--force` flag we would have checked # for existing tag diff --git a/medcat-v2/pyproject.toml b/medcat-v2/pyproject.toml index b7bc6095d..2488f6ade 100644 --- a/medcat-v2/pyproject.toml +++ b/medcat-v2/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "medcat" -version = "2.2.0-dev" +dynamic = ["version"] description = "Medical Concept Annotation Toolkit (v2)" @@ -33,7 +33,7 @@ classifiers = [ # 3 - Alpha # 4 - Beta # 5 - Production/Stable - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Healthcare Industry", # "Topic :: Natural Language Processing :: Named Entity Recognition and Linking", @@ -128,9 +128,22 @@ test = [] # TODO - list [build-system] # These are the assumed default build requirements from pip: # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support -requires = ["setuptools>=43.0.0", "wheel"] +requires = ["setuptools>=43.0.0", "setuptools_scm>=8", "wheel"] build-backend = "setuptools.build_meta" +[tool.setuptools] +package-dir = { "medcat" = "medcat" } + +[tool.setuptools.packages.find] +include = ["medcat*"] + +[tool.setuptools_scm] +# look for .git folder in root of repo +root = ".." +version_scheme = "post-release" +tag_regex = "^medcat/v(?P\\d+(?:\\.\\d+)*)(?:[ab]\\d+|rc\\d+)?$" +local_scheme = "node-and-date" + [tool.ruff.lint] # 1. Enable some extra checks for ruff select = ["E", "F"]