-
Notifications
You must be signed in to change notification settings - Fork 2.1k
test: create e2e
environment; stop testing spacy in unit tests
#9212
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
Conversation
Pull Request Test Coverage Report for Build 14400855624Details
💛 - Coveralls |
e2e
environment; stop testing spacy in unit tests
pyproject.toml
Outdated
extra-dependencies = [ | ||
dependencies = [ |
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.
test
inherit from default
but does not need its dependencies (reno
, ruff
, ...).
Using dependencies
here then allows to use extra-dependencies
in the e2e
environment.
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.
If we want to prevent tool.hatch.envs.test
from inheritting from tool.hatch.envs.default
and only install the project dependencies because it doesn't need its dependencies (reno
, ruff
, ...) then we could add here
[tool.hatch.envs.test]
template = "test"
or
[tool.hatch.envs.test]
template = "project"
I believe the former should work based on https://hatch.pypa.io/1.9/config/environment/overview/#self-referential-environments
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.
Ok I've now made test
a self-referential environment:
- previously, it inherited from
default
and overrode dependencies - now it does not inherit from
default
; specifies its dependencies
it has a similar effect, but maybe it is clearer
@@ -95,13 +95,6 @@ extra-dependencies = [ | |||
"openai-whisper>=20231106", # LocalWhisperTranscriber | |||
"arrow>=1.3.0", # Jinja2TimeExtension | |||
|
|||
# NamedEntityExtractor | |||
"spacy>=3.8,<3.9", | |||
"spacy-curated-transformers>=0.2,<=0.3", |
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.
"spacy-curated-transformers>=0.2,<=0.3",
: this is no longer needed.
e2e
environment; stop testing spacy in unit testse2e
environment; stop testing spacy in unit tests
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.
Looks quite good to me already. I have two comments I would like to briefly discuss. believe we can change something so that test
and e2
don't install reno, ruff etc if they are really not needed.
And I have a question about files_yaml
and how it combines multiple file paths.
pyproject.toml
Outdated
extra-dependencies = [ | ||
dependencies = [ |
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.
If we want to prevent tool.hatch.envs.test
from inheritting from tool.hatch.envs.default
and only install the project dependencies because it doesn't need its dependencies (reno
, ruff
, ...) then we could add here
[tool.hatch.envs.test]
template = "test"
or
[tool.hatch.envs.test]
template = "project"
I believe the former should work based on https://hatch.pypa.io/1.9/config/environment/overview/#self-referential-environments
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.
LGTM! 👍
Unfortunately, using a self-referential environment has some consequences on DataDog tracing: https://github.com/deepset-ai/haystack/actions/runs/14399778757/job/40383320064 I tried to debug this for some time, but it's not easy... Since we haven't changed anything on the Tracer, it's not a big deal (we are not introducing bugs). For this reason, we decided to NOT use a self-referential environment (but get the same effect by overriding dependencies). |
Related Issues
NamedEntityExtractorBackend
to core integrations #9187Proposed Changes:
e2e
hatch environment, which inherits fromtest
and installs the additional dependencies needed for e2e tests (Spacy in this case)test
environmentHow did you test it?
CI: unit, integration and e2e test correctly run.
Notes for the reviewer
CI speed improvements in this case are difficult to measure precisely due to GitHub runner variability, and I want to avoid cherry-picking data.
I verified locally that
test
ande2e
are separate environments, withtest
not installing Spacy (and not downloading the 400 Mb model).Even if the improvements are small or difficult to measure, I would still incorporate this change. The dependency resolution for Spacy is not always trivial and has caused CI slowdowns in the past (#9159).
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
and added!
in case the PR includes breaking changes.