Skip to content

Commit e21da73

Browse files
authored
bug(medcat): CU-869banbwt Fix issues with installation from source by providing providing package directory (#247)
* Bump version to 2.4.0 for release * CU-869banbwt: Fix issues with installation from source by providing package directory * CU-869banbwt: On the way to fixing versioning * CU-869banbwt: Fix tag regex * CU-869banbwt: Remove unncessary part of pyproject.toml (git describe overwrite) * CU-869banbwt: Update release scripts - do not change version in commit * CU-869banbwt: Simplify tag regex * CU-869banbwt: Make dev status stable / production * CU-869banbwt: Fix version issue for demo app during integration tests * CU-869banbwt: Fix version issue during service integration tests
1 parent eacc2b9 commit e21da73

File tree

6 files changed

+19
-32
lines changed

6 files changed

+19
-32
lines changed

medcat-demo-app/webapp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN pip install -U pip && if [ "$USE_CPU_TORCH" = "true" ]; then \
3030
ARG REINSTALL_CORE_FROM_LOCAL=false
3131
RUN if [ "$REINSTALL_CORE_FROM_LOCAL" = "true" ]; then \
3232
echo "Reinstalling medcat based on relative path"; \
33-
pip install -e "/webapp/medcat-v2[meta-cat,spacy]"; \
33+
SETUPTOOLS_SCM_PRETEND_VERSION="2.4.0-dev0" pip install -e "/webapp/medcat-v2[meta-cat,spacy]"; \
3434
fi
3535

3636
# Get the spacy model (for later copy)

medcat-service/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COPY . /cat
2929
ARG REINSTALL_CORE_FROM_LOCAL=false
3030
RUN if [ "$REINSTALL_CORE_FROM_LOCAL" = "true" ]; then \
3131
echo "Reinstalling medcat based on relative path"; \
32-
pip install -e "./medcat-v2[meta-cat,spacy]"; \
32+
SETUPTOOLS_SCM_PRETEND_VERSION="2.4.0-dev0" pip install -e "./medcat-v2[meta-cat,spacy]"; \
3333
fi
3434

3535
# Now run the simple api

medcat-service/Dockerfile_gpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ COPY . /cat
5050
ARG REINSTALL_CORE_FROM_LOCAL=false
5151
RUN if [ "$REINSTALL_CORE_FROM_LOCAL" = "true" ]; then \
5252
echo "Reinstalling medcat based on relative path"; \
53-
pip install -e "./medcat-v2[meta-cat,spacy]"; \
53+
SETUPTOOLS_SCM_PRETEND_VERSION="2.4.0-dev0" pip install -e "./medcat-v2[meta-cat,spacy]"; \
5454
fi
5555

5656
# Now run the simple api

medcat-v2/.release/prepare_minor_release.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,6 @@ fi
6767
# NOTE: will overwrite release branch if --force is specified
6868
run_or_echo git checkout -B "$RELEASE_BRANCH"
6969

70-
# Update version in pyproject.toml
71-
if [[ "$(uname)" == "Darwin" ]]; then
72-
# macOS (BSD sed)
73-
run_or_echo sed -i \'\' \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml
74-
else
75-
# Linux (GNU sed)
76-
run_or_echo sed -i \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml
77-
fi
78-
79-
run_or_echo git add pyproject.toml
80-
run_or_echo git commit -m \"Bump version to $VERSION for release\"
81-
8270
# Create and push tag
8371
run_or_echo git tag -a \"$VERSION_TAG\" -m \"Release v$VERSION\"
8472
run_or_echo git push origin \"$RELEASE_BRANCH\"

medcat-v2/.release/prepare_patch_release.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,6 @@ for HASH in "${CHERRYPICK_HASHES[@]-}"; do
169169
fi
170170
done
171171

172-
173-
# Update version in pyproject.toml
174-
if [[ "$(uname)" == "Darwin" ]]; then
175-
# macOS (BSD sed)
176-
run_or_echo sed -i \'\' \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml
177-
else
178-
# Linux (GNU sed)
179-
run_or_echo sed -i \'s/^version = \".*\"/version = \"\'$VERSION\'\"/\' pyproject.toml
180-
fi
181-
182-
# add and commit changes
183-
run_or_echo git add pyproject.toml
184-
run_or_echo git commit -m \"Bump version to $VERSION\" --allow-empty
185-
186172
# now do the tagging
187173
# NOTE: can force since without the `--force` flag we would have checked
188174
# for existing tag

medcat-v2/pyproject.toml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "medcat"
33

4-
version = "2.2.0-dev"
4+
dynamic = ["version"]
55

66
description = "Medical Concept Annotation Toolkit (v2)"
77

@@ -33,7 +33,7 @@ classifiers = [
3333
# 3 - Alpha
3434
# 4 - Beta
3535
# 5 - Production/Stable
36-
"Development Status :: 4 - Beta",
36+
"Development Status :: 5 - Production/Stable",
3737

3838
"Intended Audience :: Healthcare Industry",
3939
# "Topic :: Natural Language Processing :: Named Entity Recognition and Linking",
@@ -128,9 +128,22 @@ test = [] # TODO - list
128128
[build-system]
129129
# These are the assumed default build requirements from pip:
130130
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
131-
requires = ["setuptools>=43.0.0", "wheel"]
131+
requires = ["setuptools>=43.0.0", "setuptools_scm>=8", "wheel"]
132132
build-backend = "setuptools.build_meta"
133133

134+
[tool.setuptools]
135+
package-dir = { "medcat" = "medcat" }
136+
137+
[tool.setuptools.packages.find]
138+
include = ["medcat*"]
139+
140+
[tool.setuptools_scm]
141+
# look for .git folder in root of repo
142+
root = ".."
143+
version_scheme = "post-release"
144+
tag_regex = "^medcat/v(?P<version>\\d+(?:\\.\\d+)*)(?:[ab]\\d+|rc\\d+)?$"
145+
local_scheme = "node-and-date"
146+
134147
[tool.ruff.lint]
135148
# 1. Enable some extra checks for ruff
136149
select = ["E", "F"]

0 commit comments

Comments
 (0)