Skip to content
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

Small improvements to tox configuration #343

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

RobbeSneyders
Copy link
Member

Had issues running tox locally which in the end were unrelated to the configuration. But in the meantime I learned some better practices for tox, which I implemented in this PR.

poetry run liccheck -s license_strategy.ini -r /tmp/requirements.txt -l PARANOID

[testenv]
[testenv:py{38,39,310,311}]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer inherit this configuration in the other test environments, which lead to unnecessary dependency installation etc.

poetry run python -m pytest tests -vv --cov fondant --cov-report term-missing
commands_post=
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split pre and post commands so post script always run, even when command fails.

setenv=PYTHONPATH = {toxinidir}:{toxinidir}
skip_install=true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't let tox install fondant. We need to run the pre-build.sh script first and are overwriting the install with the poetry install command below.

deps=
liccheck>=0.7.3,<0.8
commands=
allowlist_externals=
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer inherited

allowlist_externals=
pre-commit
commands=pre-commit run --all-files --show-diff-on-failure

[testenv:check-licenses]
skip_install=true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary to install fondant.

@@ -13,33 +13,41 @@ python =
3.11: py311

[testenv:pre-commit]
skip_install=true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary to install fondant.

Copy link
Contributor

@mrchtr mrchtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RobbeSneyders! I have tested your changes locally, and everything is working.

@GeorgesLorre
Copy link
Collaborator

Should be faster as well no ? With less installing of packages.

@RobbeSneyders
Copy link
Member Author

Should be faster as well no ? With less installing of packages.

Yes, running a single pytest environment takes ~20 seconds for me now.

@RobbeSneyders RobbeSneyders merged commit 3b43f53 into main Aug 10, 2023
@RobbeSneyders RobbeSneyders deleted the feature/improved-tox branch August 10, 2023 10:02
Hakimovich99 pushed a commit that referenced this pull request Oct 16, 2023
Had issues running tox locally which in the end were unrelated to the
configuration. But in the meantime I learned some better practices for
tox, which I implemented in this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants