-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
add initial tox.ini #3196
add initial tox.ini #3196
Conversation
ugh, native toml not supporting https://tox.wiki/en/latest/config.html#conditional-settings makes it a non-trivial conversion. I think the way to get around that is with more explicit environments + https://tox.wiki/en/latest/config.html#string-substitution-references; but... that's for another day/person |
If you review I propose delaying further CI/ |
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.
I think this mostly makes sense, wondering about mypy runs, and I thought there was some sort of tox github actions thing that was useful for some reason the last time I used tox.
mypy --platform linux | ||
mypy --platform darwin | ||
mypy --platform win32 |
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.
Shouldn't this use mypy_annotate
?
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.
hm. Maybe, but mypy_annotate
is less needed with tox supressing output of succesful commands and in general reformatting the output. One of the problems with check.sh
was simply finding what it was that failed, which I think is what prompted the creation of it. But we don't want it when running outside of CI, so needs some logic to differentiate.
But if we don't use it here then it should just be removed.
I'll procrastinate on it a little bit, and see what the output looks like in practice. I suspect the end result is going to be removing mypy_annotate
@jakkdl thanks for pinging! Love that it's being worked on. I'll review shortly :) |
I'd vote for |
- name: Check Formatting | ||
if: matrix.check_formatting == '1' | ||
run: | ||
python -m pip install tox && |
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.
You may want to use tox-uv
too. Though, it's okay to omit. Especially in the initial effort.
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.
not sure there's much, if any, speedup when we're only running a single environment
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.
I haven't compared them, but I'd imagine that provisioning that env would be faster. You don't separate the provisioning step in this PR, so I can't see how much it takes. But it's probably not important enough right now.
[testenv:docs] | ||
deps = | ||
-r docs-requirements.txt | ||
# base_python synced with .readthedocs.yml |
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.
We can also make RTD just call tox in a follow-up. This is what I do these days.
base_python = 3.13 | ||
set_env = | ||
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 | ||
commands = |
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.
Let's also add --python-version=
in follow-ups.
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.
python versions are specified in pyproject.toml
for both tools
edit: ah you mean parametrizing the version
@CoolCat467 there's a plugin: https://github.com/tox-dev/tox-gh. It also demonstrates separating the invocation into preparation and testing. But I think this is something to look into separately, beyond the initial effort. I don't exactly like how the jobs are mixed up right now, but I believe this is out of the scope, so I choose not to start those discussions just yet. |
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.
I think this is ready to be merged and can be iterated on separately. Though, if you have a minute to accept the commands_pre
thing and add descriptions, it'd be nice to include into the scope of this PR.
# protip: install uv-tox for faster venv generation | ||
|
||
[testenv] | ||
description = "Base environment for running tests depending on python version." |
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.
@jakkdl is configparser able to handle the quotes well? I think this is the first time I see them in this context.. Does the output of tox l
look good?
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.
...no 😅
❯ tox l
default environments:
py39 -> "Base environment for running tests depending on python version."
py310 -> "Base environment for running tests depending on python version."
py311 -> "Base environment for running tests depending on python version."
py312 -> "Base environment for running tests depending on python version."
I started out on a tox.ini because it's handy to have; it's not complete enough to close #3170, but it should be sufficient for #2699 once the CI is updated to use it.
nox
for that not to be a nightmare.tox.ini
I didn't realize this until most of the file was written.ci.yml
to actually use this. We'd probably want https://github.com/tox-dev/tox-gh or https://github.com/ymyzk/tox-gh-actions to do that properlyeverybody's very welcome to push commits to this PR, but I don't think we should block merging it until the tox/nox config is perfect (leaving that for followup PRs) Cause I Wanna Use It ™️