Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 4de8931

Browse files
authored
CU-8693kp0gw: Pin more recent versions for major dependencies; Avoid major bumps where applicable (#392)
* CU-8693kp0gw: Pin more recent versions for major dependencies; Avoid major bumps where applicable * CU-8693kp0gw: Bump default spacy model version (3.4.0 -> 3.6.0) * CU-8693kp0gw: Bump fakse test-spacy model version compatibility range * CU-8693kp0gw: Fix spacy compatibility tests for new fake model * CU-8693kp0gw: Undo what I thought was a typo fix (moved back from 'movar~virus' to 'movar~viruse')
1 parent d9a1fac commit 4de8931

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.
2-
https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.4.0/en_core_web_md-3.4.0-py3-none-any.whl
2+
https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.6.0/en_core_web_md-3.6.0-py3-none-any.whl
33
flake8==4.0.1
44
mypy==1.0.0
55
mypy-extensions==0.4.3

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.
2-
https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.4.0/en_core_web_md-3.4.0-py3-none-any.whl
2+
https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.6.0/en_core_web_md-3.6.0-py3-none-any.whl

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
'medcat.tokenizers', 'medcat.utils.meta_cat', 'medcat.pipeline', 'medcat.utils.ner',
1919
'medcat.utils.saving', 'medcat.utils.regression', 'medcat.stats'],
2020
install_requires=[
21-
'numpy>=1.22.0', # first to support 3.11
21+
'numpy>=1.22.0,<1.26.0', # 1.22.0 is first to support python 3.11; post 1.26.0 there's issues with scipy
2222
'pandas>=1.4.2', # first to support 3.11
23-
'gensim>=4.3.0', # first to support 3.11
24-
'spacy>=3.1.0',
25-
'scipy~=1.9.2', # first to support 3.11
26-
'transformers>=4.34.0',
23+
'gensim>=4.3.0,<5.0.0', # 5.3.0 is first to support 3.11; avoid major version bump
24+
'spacy>=3.6.0,<4.0.0', # Some later model packs (e.g HPO) are made with 3.6.0 spacy model; avoid major version bump
25+
'scipy~=1.9.2', # 1.9.2 is first to support 3.11
26+
'transformers>=4.34.0,<5.0.0', # avoid major version bump
2727
'accelerate>=0.23.0', # required by Trainer class in de-id
28-
'torch>=1.13.0', # first to support 3.11
28+
'torch>=1.13.0,<3.0.0', # 1.13 is first to support 3.11; 2.1.2 has been compatible, but avoid major 3.0.0 for now
2929
'tqdm>=4.27',
30-
'scikit-learn>=1.1.3', # first to supporrt 3.11
31-
'dill>=0.3.4', # allow later versions with later versions of datasets (tested with 0.3.6)
32-
'datasets>=2.2.2', # allow later versions, tested with 2.7.1
30+
'scikit-learn>=1.1.3,<2.0.0', # 1.1.3 is first to supporrt 3.11; avoid major version bump
31+
'dill>=0.3.6,<1.0.0', # stuff saved in 0.3.6/0.3.7 is not always compatible with 0.3.4/0.3.5; avoid major bump
32+
'datasets>=2.2.2,<3.0.0', # avoid major bump
3333
'jsonpickle>=2.0.0', # allow later versions, tested with 3.0.0
3434
'psutil>=5.8.0',
3535
# 0.70.12 uses older version of dill (i.e less than 0.3.5) which is required for datasets

tests/resources/ff_core_fake_dr/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"version":"3.1.0",
55
"description":"This is a FAKE model",
66
"author":"Fakio Martimus",
7-
"spacy_version":">=3.1.0,<3.2.0"
7+
"spacy_version":">=3.1.0,<4.0.0"
88
}

tests/test_ner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ def tearDownClass(cls) -> None:
6767
cls.pipe.destroy()
6868

6969
def test_aa_cdb_names_output(self):
70-
print("Fixing 'movar~viruse' -> 'movar-virus' for newere en_core_web_md")
71-
target_result = {'S-229004': {'movar~virus', 'movar', 'movar~viruses'}, 'S-229005': {'cdb'}}
70+
target_result = {'S-229004': {'movar~viruse', 'movar', 'movar~viruses'}, 'S-229005': {'cdb'}}
7271
self.assertEqual(self.cdb.cui2names, target_result)
7372

7473
def test_ab_entities_length(self):

tests/utils/test_spacy_compatibility.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_reads_info(self):
149149

150150

151151
class GetSpacyModelVersionTests(GetSpacyModelInfoTests):
152-
expected_spacy_version = ">=3.1.0,<3.2.0"
152+
expected_spacy_version = ">=3.1.0,<4.0.0"
153153

154154
@classmethod
155155
def setUpClass(cls) -> None:
@@ -253,9 +253,9 @@ def test_is_in_range(self):
253253
self.assertTrue(b)
254254

255255
class ModelPackHasInCompatibleSpacyRangeTests(unittest.TestCase):
256-
test_spacy_version = "3.2.0"
256+
test_spacy_version = "3.0.0"
257257

258-
def test_is_in_range(self):
258+
def test_is_not_in_range(self):
259259
with custom_spacy_version(self.test_spacy_version):
260260
b = medcat_model_pack_has_compatible_spacy_model(FAKE_MODELPACK_MODEL_DIR)
261261
self.assertFalse(b)

0 commit comments

Comments
 (0)