-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use environment marker to restrict flake8 install #9510
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
@@ -44,6 +44,6 @@ jobs: | |||
cache: pip | |||
cache-dependency-path: requirements-tests.txt | |||
- name: Install dependencies | |||
run: pip install $(grep mypy== requirements-tests.txt) | |||
run: pip install -r requirements-tests.txt |
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.
Arguably only installing the 1-2 dependency we need for a single test doesn't sound like a bad idea either.
And might be doable for other tests as well.
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.
Ah, it would be good to keep the stubtest stdlib ones as they are. Because stubtest does runtime inspection, the --no-site-packages
flag doesn't provide the same level of isolation as it does for when we're just running mypy; and unlike stubtest third-party, this script doesn't create venvs on the fly. It's useful to be 100% sure that it's running in as isolated an environment as possible.
Looks like we don't need the tomli requirement in daily.yml
though!
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.
But keep -r requirements-tests.txt
for third party right?
I meant daily, and that's also stubtest-stdlib
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.
Yup, the third-party one depends on utils.py
, and we can be sure it's testing packages in isolation because of the way it creates venvs on the fly 👍
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.
LGTM. Thanks!
From #8974 (comment)
Use of environment marker to indicate that a dependency isn't usable with Python 3.7