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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.

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

poetry
commands_pre=
poetry lock
poetry install --all-extras
poetry show
poetry export -f requirements.txt --output /tmp/requirements.txt
commands=
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.

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=
pytest>=7.4.0,<8
pytest-cov>=4.1.0,<5
allowlist_externals=
poetry
/bin/bash
/usr/bin/bash
commands=
commands_pre=
bash ./scripts/pre-build.sh
poetry lock
poetry install --all-extras
poetry show
commands=
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.

bash ./scripts/post-build.sh