Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tiran
Copy link
Contributor

@tiran tiran commented Jun 29, 2024

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.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the
    conventional commits.
  • Changelog updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

@mergify mergify bot added CI/CD Affects CI/CD configuration testing Relates to testing ci-failure PR has at least one CI failure labels Jun 29, 2024
@mergify mergify bot removed the ci-failure PR has at least one CI failure label Jun 29, 2024
@tiran tiran mentioned this pull request Jun 29, 2024
Copy link
Contributor

@bjhargrave bjhargrave left a 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.

@mergify mergify bot added the ci-failure PR has at least one CI failure label Jun 29, 2024
@mergify mergify bot removed the ci-failure PR has at least one CI failure label Jun 30, 2024
@tiran tiran mentioned this pull request Jun 30, 2024
5 tasks
@mergify mergify bot added the ci-failure PR has at least one CI failure label Jul 1, 2024
`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]>
@mergify mergify bot removed the ci-failure PR has at least one CI failure label Jul 2, 2024
@tiran tiran marked this pull request as ready for review July 2, 2024 09:11
@mergify mergify bot added the one-approval PR has one approval from a maintainer label Jul 2, 2024
@mergify mergify bot merged commit aa35c74 into instructlab:main Jul 3, 2024
@mergify mergify bot removed the one-approval PR has one approval from a maintainer label Jul 3, 2024
@tiran tiran deleted the tox-fix branch July 3, 2024 06:13
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu
CMAKE_ARGS={env:CMAKE_ARGS:-DLLAMA_NATIVE=off}
package = wheel
wheel_build_env = pkg
Copy link
Contributor

@booxter booxter Jul 17, 2024

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?

mergify bot added a commit that referenced this pull request Feb 26, 2025
PR #1526 moved this to a `tox` target.


Approved-by: booxter

Approved-by: courtneypacheco
mergify bot added a commit that referenced this pull request Feb 26, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Affects CI/CD configuration testing Relates to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants