mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Add lint to ensure .github/ pypi dependencies are pinned (#64463)
Summary: Example failing run: https://github.com/pytorch/pytorch/pull/64463/checks?check_run_id=3501249102 Pull Request resolved: https://github.com/pytorch/pytorch/pull/64463 Reviewed By: janeyx99 Differential Revision: D30744930 Pulled By: driazati fbshipit-source-id: 4dd97054db1d4c776a4512bc3d664987cd7b6d23
This commit is contained in:
parent
7e88d0b370
commit
a22c936b63
2
.github/templates/bazel_ci_workflow.yml.j2
vendored
2
.github/templates/bazel_ci_workflow.yml.j2
vendored
|
|
@ -90,7 +90,7 @@ on:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Test PyTorch
|
||||
run: |
|
||||
|
|
|
|||
6
.github/templates/linux_ci_workflow.yml.j2
vendored
6
.github/templates/linux_ci_workflow.yml.j2
vendored
|
|
@ -170,7 +170,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -232,7 +232,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
@ -338,7 +338,7 @@ jobs:
|
|||
{%- if is_coverage %}
|
||||
- name: Report coverage
|
||||
run: |
|
||||
python3 -mpip install codecov
|
||||
python3 -mpip install codecov==2.1.12
|
||||
python3 -mcodecov
|
||||
{%- endif %}
|
||||
- name: Zip test reports for upload
|
||||
|
|
|
|||
2
.github/templates/windows_ci_workflow.yml.j2
vendored
2
.github/templates/windows_ci_workflow.yml.j2
vendored
|
|
@ -170,7 +170,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
2
.github/workflows/build_linux_conda.yml
vendored
2
.github/workflows/build_linux_conda.yml
vendored
|
|
@ -107,7 +107,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
2
.github/workflows/build_linux_libtorch.yml
vendored
2
.github/workflows/build_linux_libtorch.yml
vendored
|
|
@ -106,7 +106,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
2
.github/workflows/build_linux_wheels.yml
vendored
2
.github/workflows/build_linux_wheels.yml
vendored
|
|
@ -105,7 +105,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
2
.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml
generated
vendored
2
.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
|
|||
2
.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml
generated
vendored
2
.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
|
|||
4
.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml
generated
vendored
4
.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -302,7 +302,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
4
.github/workflows/generated-linux-bionic-py3.6-clang9.yml
generated
vendored
4
.github/workflows/generated-linux-bionic-py3.6-clang9.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -302,7 +302,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
6
.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml
generated
vendored
6
.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -302,7 +302,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
@ -446,7 +446,7 @@ jobs:
|
|||
docker run --rm -v "$(pwd)":/v -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .
|
||||
- name: Report coverage
|
||||
run: |
|
||||
python3 -mpip install codecov
|
||||
python3 -mpip install codecov==2.1.12
|
||||
python3 -mcodecov
|
||||
- name: Zip test reports for upload
|
||||
if: always()
|
||||
|
|
|
|||
4
.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml
generated
vendored
4
.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -302,7 +302,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
4
.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml
generated
vendored
4
.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -302,7 +302,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
4
.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml
generated
vendored
4
.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml
generated
vendored
|
|
@ -229,7 +229,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -302,7 +302,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
2
.github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml
generated
vendored
2
.github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml
generated
vendored
|
|
@ -249,7 +249,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Test PyTorch
|
||||
run: |
|
||||
|
|
|
|||
2
.github/workflows/generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml
generated
vendored
2
.github/workflows/generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml
generated
vendored
|
|
@ -227,7 +227,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
|
|||
4
.github/workflows/generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml
generated
vendored
4
.github/workflows/generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml
generated
vendored
|
|
@ -227,7 +227,7 @@ jobs:
|
|||
run: |
|
||||
COMMIT_TIME=$(git log --max-count=1 --format=%ct || echo 0)
|
||||
export COMMIT_TIME
|
||||
pip3 install requests
|
||||
pip3 install requests==2.26
|
||||
python3 -m tools.stats.upload_binary_size_to_scuba || exit 0
|
||||
- name: Chown workspace
|
||||
run: |
|
||||
|
|
@ -300,7 +300,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
2
.github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml
generated
vendored
2
.github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml
generated
vendored
|
|
@ -150,7 +150,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
2
.github/workflows/generated-win-vs2019-cpu-py3.yml
generated
vendored
2
.github/workflows/generated-win-vs2019-cpu-py3.yml
generated
vendored
|
|
@ -142,7 +142,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
2
.github/workflows/generated-win-vs2019-cuda10.1-py3.yml
generated
vendored
2
.github/workflows/generated-win-vs2019-cuda10.1-py3.yml
generated
vendored
|
|
@ -152,7 +152,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
2
.github/workflows/generated-win-vs2019-cuda11.3-py3.yml
generated
vendored
2
.github/workflows/generated-win-vs2019-cuda11.3-py3.yml
generated
vendored
|
|
@ -152,7 +152,7 @@ jobs:
|
|||
image: python:3.9
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pip install typing-extensions
|
||||
run: pip install typing-extensions==3.10
|
||||
- name: Clone pytorch/pytorch
|
||||
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
|
||||
- name: Generating test matrix
|
||||
|
|
|
|||
18
.github/workflows/lint.yml
vendored
18
.github/workflows/lint.yml
vendored
|
|
@ -64,6 +64,18 @@ jobs:
|
|||
run: |
|
||||
# shellcheck disable=SC2016
|
||||
(! git --no-pager grep -InP '# type:\s*ignore(?!\[)' -- '**.py' '**.pyi' ':(exclude)test/test_jit.py' || (echo 'The above lines have unqualified `type: ignore`; please convert them to `type: ignore[xxxx]`'; false))
|
||||
- name: Ensure GitHub PyPi dependencies are pinned
|
||||
if: always()
|
||||
run: |
|
||||
(! git --no-pager grep --color=always -InP \
|
||||
'(pip|pip3|python -m pip|python3 -m pip|python3 -mpip|python -mpip) install ([a-z][\.a-z-0-9]*+(?!(=|.*\.whl))([[:blank:]]|))+' \
|
||||
-- .github \
|
||||
':(exclude)**.rst' \
|
||||
':(exclude)**.py' \
|
||||
':(exclude)**.md' \
|
||||
':(exclude)**.diff' \
|
||||
':(exclude)third_party' ||
|
||||
(echo "The above lines have unpinned PyPi installs; please pin them to a specific version: e.g. 'thepackage==1.2'"; false))
|
||||
# note that this next step depends on a clean checkout;
|
||||
# if you run it locally then it will likely to complain
|
||||
# about all the generated files in torch/test
|
||||
|
|
@ -287,7 +299,7 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
set -eux
|
||||
pip3 install typing-extensions --user # for tools/linter/translate_annotations.py
|
||||
pip3 install typing-extensions==3.10 --user # for tools/linter/translate_annotations.py
|
||||
pip3 install -r requirements-flake8.txt --user
|
||||
flake8 --version
|
||||
- name: Run flake8
|
||||
|
|
@ -416,7 +428,7 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
set -eux
|
||||
pip3 install cmakelint --user
|
||||
pip3 install cmakelint==1.4.1 --user
|
||||
cmakelint --version
|
||||
- name: Run cmakelint
|
||||
run: |
|
||||
|
|
@ -442,7 +454,7 @@ jobs:
|
|||
pip3 install numpy==1.20 --user # https://github.com/pytorch/pytorch/pull/60472
|
||||
pip3 install expecttest==0.1.3 mypy==0.812 --user
|
||||
# Needed to check tools/render_junit.py
|
||||
pip3 install junitparser rich --user
|
||||
pip3 install junitparser==2.1.1 rich==10.9.0 --user
|
||||
- name: Run autogen
|
||||
run: |
|
||||
set -eux
|
||||
|
|
|
|||
1
Makefile
1
Makefile
|
|
@ -85,6 +85,7 @@ quick_checks:
|
|||
--step 'Ensure canonical include' \
|
||||
--step 'Ensure no versionless Python shebangs' \
|
||||
--step 'Ensure no unqualified noqa' \
|
||||
--step 'Ensure GitHub PyPi dependencies are pinned' \
|
||||
--step 'Ensure no unqualified type ignore' \
|
||||
--step 'Ensure no direct cub include' \
|
||||
--step 'Ensure correct trailing newlines' \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user