-
Notifications
You must be signed in to change notification settings - Fork 26
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
Run tests against fondant package with tox #283
Conversation
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.
Thanks Robbe!
Left a few questions
tox.ini
Outdated
|
||
[testenv:check-licenses] | ||
deps= | ||
liccheck==0.7.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.
can we have soft dependency versions here like we had in pyproject.toml
? (same for pytest, and pytest-cov)
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.
Good point. Updated.
[tox] | ||
isolated_build = True | ||
envlist = | ||
pre-commit |
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.
do these dependencies only get built when running tox then? does it automatically invoke pip install
on them since we no longer have them in the pyproject.toml
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.
Yes, installs in this file are only installed by tox when executing the related environment. If a dependency is only needed for a single environment type, I moved them from pyproject.toml
to here, and I added tox
to pyproject.toml
.
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.
alright thanks for the clarification
This PR contains a couple of changes to make sure we test against the built fondant package instead of against the raw source code. This is best practice, but I also need this for the next PR I'll open as there the tests will fail if they are not run against the built package. - Introduce tox, which makes it easy to build the fondant package before running our tests - Move the fondant source code into a `src` folder, so we don't accidentally test against the source code. See these articles for more info (https://hynek.me/articles/testing-packaging/, https://blog.ganssle.io/articles/2019/08/test-as-installed.html) - Ruff now recognizes `fondant` as a third party package in our components and tests, and has reorganized the imports accordingly Each of these changes is contained in a separate PR. To run tests locally, you can just run one of the following commands: - `tox` this will automatically skip test environments that require other python versions - `tox -e py310` to select a specific environment to run, skipping other environments like pre-commit
This PR contains a couple of changes to make sure we test against the built fondant package instead of against the raw source code. This is best practice, but I also need this for the next PR I'll open as there the tests will fail if they are not run against the built package.
src
folder, so we don't accidentally test against the source code. See these articles for more info (https://hynek.me/articles/testing-packaging/, https://blog.ganssle.io/articles/2019/08/test-as-installed.html)fondant
as a third party package in our components and tests, and has reorganized the imports accordinglyEach of these changes is contained in a separate PR.
To run tests locally, you can just run one of the following commands:
tox
this will automatically skip test environments that require other python versionstox -e py310
to select a specific environment to run, skipping other environments like pre-commit