8000 Use environment marker to restrict flake8 install by Avasam · Pull Request #9510 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 2 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cache: pip
cache-dependency-path: requirements-tests.txt
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt)
run: pip install -r requirements-tests.txt
- name: Run stubtest
run: python tests/stubtest_stdlib.py

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stubtest_stdlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator Author
@Avasam Avasam Jan 12, 2023

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.

Copy link
Member
@AlexWaygood AlexWaygood Jan 12, 2023

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!

Copy link
Collaborator Author
@Avasam Avasam Jan 12, 2023

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

Copy link
Member

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 👍

- name: Run stubtest
run: python tests/stubtest_stdlib.py
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements-tests.txt
- run: pip install $(grep mypy== requirements-tests.txt) packaging pathspec termcolor tomli typing-extensions
- run: pip install -r requirements-tests.txt
- run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }}

regression-tests:
Expand Down
14 changes: 7 additions & 7 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
aiohttp==3.8.3
black==22.12.0 # must match .pre-commit-config.yaml
flake8==6.0.0 # must match .pre-commit-config.yaml
flake8-bugbear==22.12.6 # must match .pre-commit-config.yaml
flake8-noqa==1.3.0 # must match .pre-commit-config.yaml
flake8-pyi==22.11.0 # must match .pre-commit-config.yaml
isort==5.11.4 # must match .pre-commit-config.yaml
black==22.12.0 # must match .pre-commit-config.yaml
flake8==6.0.0; python_version >= "3.8" # must match .pre-commit-config.yaml
flake8-bugbear==22.12.6; python_version >= "3.8" # must match .pre-commit-config.yaml
flake8-noqa==1.3.0; python_version >= "3.8" # must match .pre-commit-config.yaml
flake8-pyi==22.11.0; python_version >= "3.8" # must match .pre-commit-config.yaml
isort==5.11.4 # must match .pre-commit-config.yaml
mypy==0.991
packaging==22.0
pathspec
pycln==2.1.2 # must match .pre-commit-config.yaml
pycln==2.1.2 # must match .pre-commit-config.yaml
pyyaml==6.0
pytype==2023.1.10; platform_system != "Windows" and python_version < "3.11"
termcolor>=2
Expand Down
0