-
Notifications
You must be signed in to change notification settings - Fork 250
Update Python version support and dependencies; refactor tokenizer and tests #560
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM python:3.10-bullseye | ||
| FROM python:3.13-slim | ||
|
|
||
| # install base packages | ||
| RUN apt-get clean \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,17 @@ | |
| from scispacy.custom_sentence_segmenter import pysbd_sentencizer | ||
|
|
||
|
|
||
| try: | ||
| _shared_nlp = spacy.load("en_core_sci_sm") | ||
| except OSError: # pragma: no cover - depends on optional model download | ||
| pytest.skip( | ||
| "en_core_sci_sm is required for whitespace tests; install the model to run them.", | ||
| allow_module_level=True, | ||
| ) | ||
|
|
||
|
|
||
| class TestWhitespace: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's more idiomatic to use see https://github.com/cthoyt/ssslm/blob/50dda51b40c885082dffef340fb11d932461ae80/tests/test_ner/test_scispacy.py#L10-L27, in which a more explicit check is made for the installation of |
||
| nlp = spacy.load("en_core_sci_sm") | ||
| nlp = _shared_nlp | ||
|
|
||
| @pytest.mark.parametrize("text", ["lorem ipsum"]) | ||
| def test_tokenizer_splits_single_space(self, text): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just replaced with a new function? if this is sufficient, why not re-implement the old function by using a call to the new one?