-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Clearly differentiate between venv and tox setups in CONTRIBUTING.md #16067
Clearly differentiate between venv and tox setups in CONTRIBUTING.md #16067
Conversation
The blurb on how to use `tox` existed in the middle of the [**Running tests** section](/mypy/blob/master/CONTRIBUTING.md#running-tests), and was bookended without headings by non-`tox` workflow material. This more clearly delineates between `tox` and non-`tox` workflows for the newcomer. This also non-invasively allows running arbitrary commands using `testenv:dev`. ``` sh % tox -e dev # ... works as before % tox -e dev -- mypy runtests.py # ... runs dev commands and then runs mypy on runtests.py dev: commands[2]> mypy runtests.py Success: no issues found in 1 source file # ... % tox -e dev --override testenv:dev.allowlist_externals+=env -- env # ... runs dev commands and then runs env in dev environment test_case.py dev: commands[2]> env HOME=/home/posita LANG=en_US.UTF-8 LANGUAGE=en_US.UTF8 TERM=xterm-256color PATH=/home/posita/dev/3p/mypy/.tox/dev/bin:/home/posita/dev/3p/mypy/venv/bin:... PYTHONHASHSEED=... PIP_DISABLE_PIP_VERSION_CHECK=1 PYTHONIOENCODING=utf-8 TOX_ENV_NAME=dev TOX_WORK_DIR=/home/posita/dev/3p/mypy/.tox TOX_ENV_DIR=/home/posita/dev/3p/mypy/.tox/dev VIRTUAL_ENV=/home/posita/dev/3p/mypy/.tox/dev TOX_PACKAGE=/home/posita/dev/3p/mypy/.tox/.tmp/package/28/mypy-1.7.0+dev.6d19f9ddf110d4ad3af63d472e8d7aaf69e6260c.dirty-0.editable-py3-none-any.whl # ... ```
The failing check in this PR also seems present on the parent commit in |
yeah: |
This comment has been minimized.
This comment has been minimized.
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.
Thank you, one small comment!
CONTRIBUTING.md
Outdated
tox -e dev --override testenv:dev.allowlist_externals+=env -- env # inspect the environment | ||
``` | ||
|
||
If you don't already have `tox` installed, you can use a virtual 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 think we don't need this last bit, since it's covered above
``` | ||
|
||
If you don't already have `tox` installed, you can use a virtual environment as | ||
described above to install `tox` via `pip` (e.g., ``python3 -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.
@hauntsaninja, please let me know if this addresses your #16067 (comment), or you think this should be even shorter or eliminated altogether.
Diff from mypy_primer, showing the effect of this PR on open source code: vision (https://github.com/pytorch/vision): typechecking got 1.23x slower (43.3s -> 53.3s)
(Performance measurements are based on a single noisy sample)
|
Thank you! |
Documentation changes are visible here. Commit message below.
The blurb on how to use
tox
existed in the middle of the Running tests section, and was bookended without headings by non-tox
workflow material. This more clearly delineates betweentox
and non-tox
workflows for the newcomer.This also non-invasively allows running arbitrary commands using
testenv:dev
.