-
Notifications
You must be signed in to change notification settings - Fork 450
Fix various issues with tox and tests #1526
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
bjhargrave
left a comment
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.
This change does not seem to result in tox actually running the unit tests.
See https://github.com/instructlab/instructlab/actions/runs/9723803470/job/26839329939#step:12:27 for no output from the test execution.
`tox -e py3-unit` or `make tests` no longer works when the default Python interpreter is 3.12. InstructLab currently requires Python 3.10 or 3.11. All tox environments without a fully qualified Python version prefix now enforce Python 3.11 as default `basepython`. We cannot set `basepython = python3.11` in `[testenv]`, because that breaks `[testenv:py310]` enviroments. The `[testenv:py3-*]` also enforce Python 3.11 as `basepython`. `tox` no longer uses `requirements-dev.txt`. The requirements file installs additional packages that are not needed for testing, e.g. tox within tox. It also pulls in all dependencies from `requirements.txt`. We want to verify that `pip install instructlab` installs all dependencies automatically. Other changes and improvements: - run `mypy` with `make tests` instead of `make verify`. The verify target is for fast local testing without installing Torch stack. - use a tox label to run all fast verify targets - update Ruff to 0.5.0 - drop `ruff.sh` and use two separate targest for ruff checking and ruff fixing. Ruff and isort don't need much time and disk space to install. Signed-off-by: Christian Heimes <[email protected]>
| PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu | ||
| CMAKE_ARGS={env:CMAKE_ARGS:-DLLAMA_NATIVE=off} | ||
| package = wheel | ||
| wheel_build_env = pkg |
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.
@tiran I've noticed that pkg environment is built using python3.12. I am not sure it's an actual issue. (For what I observe, tests still pass.)
$ .tox/pkg/bin/python --version
Python 3.12.3
The following change seems to switch to 3.11:
--- a/tox.ini
+++ b/tox.ini
@@ -34,6 +34,9 @@ allowlist_externals =
[testenv:py3]
basepython = python3.11
+[testenv:pkg]
+basepython = {[testenv:py3]basepython}
+
[testenv:py3-unit]
basepython = {[testenv:py3]basepython}
Since you are clearly more knowledgeable about packaging / tox, I'd like to ask: do you anticipate any problems with us using py3.12 for wheel build environment? Or it's a non-issue?
PR #1526 moved this to a `tox` target. Approved-by: booxter Approved-by: courtneypacheco
PR #1526 moved this to a `tox` target.<hr>This is an automatic backport of pull request #3188 done by [Mergify](https://mergify.com). Approved-by: ktdreyer Approved-by: courtneypacheco
tox -e py3-unitormake testsno longer works when the default Python interpreter is 3.12. InstructLab currently requires Python 3.10 or 3.11. All tox environments without a fully qualified Python version prefix now enforce Python 3.11 as defaultbasepython. We cannot setbasepython = python3.11in[testenv], because that breaks[testenv:py310]enviroments. The[testenv:py3-*]also enforce Python 3.11 asbasepython.toxno longer usesrequirements-dev.txt. The requirements file installs additional packages that are not needed for testing, e.g. tox within tox. It also pulls in all dependencies fromrequirements.txt. We want to verify thatpip install instructlabinstalls all dependencies automatically.Other changes and improvements:
mypywithmake testsinstead ofmake verify. The verify target is for fast local testing without installing Torch stack.ruff.shand use two separate targest for ruff checking and ruff fixing. Ruff and isort don't need much time and disk space to install.Checklist:
conventional commits.