Skip to content

Commit

Permalink
Fix GHA warning and align mypy version to pytorch core (pytorch#891)
Browse files Browse the repository at this point in the history
Summary:
- Follow up work after pytorch#889
- Update `mypy` version during testing to `0.960` as PyTorch Core https://github.com/pytorch/pytorch/blob/4b898a7304246275b250b159dd0ac8e68a6df95d/.circleci/docker/requirements-ci.txt#L83

Pull Request resolved: pytorch#891

Reviewed By: NivekT, dahsh

Differential Revision: D41189285

Pulled By: ejguan

fbshipit-source-id: 5664fe680c5e4b10682888e07680b5f45c86a006
  • Loading branch information
ejguan authored and facebook-github-bot committed Nov 10, 2022
1 parent bf08410 commit 59d1462
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_build_test_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
steps:
- name: Download Artifacts from Github
continue-on-error: true
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: torchdata-artifact
- name: Determine if Wheel Uploading is needed
Expand Down Expand Up @@ -378,7 +378,7 @@ jobs:
python -m pytest --no-header -v test --ignore=test/test_period.py --ignore=test/test_text_examples.py --ignore=test/test_audio_examples.py
- name: Upload Conda Package to Github
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: torchdata-artifact
path: conda-bld/*/torchdata-*.tar.bz2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
pip3 install --pre torch -f "${{ steps.pytorch_channel.outputs.value }}"
- name: Install dependencies
run: |
pip3 install requests mypy==0.812 graphviz numpy
pip3 install -r requirements.txt
pip3 install mypy==0.960 numpy types-requests
- name: Build TorchData
run: |
python setup.py develop
Expand Down
27 changes: 15 additions & 12 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@ files = torchdata

exclude = examples, test, packaging

python_version = 3.7
python_version = 3.8

#
# Third party dependencies that don't have types.
#
[mypy-iopath.*]
[mypy-aistore.*]
ignore_missing_imports = True

[mypy-setuptools.*]
[mypy-datasets.*]
ignore_missing_imports = True

[mypy-scipy.*]
[mypy-dill.*]
ignore_missing_imports = True

[mypy-expecttest.*]
ignore_missing_imports = True

[mypy-datasets.*]
[mypy-fsspec.*]
ignore_missing_imports = True

[mypy-rarfile.*]
[mypy-google.*]
ignore_missing_imports = True

[mypy-fsspec.*]
[mypy-graphviz.*]
ignore_missing_imports = True

[mypy-dill.*]
[mypy-iopath.*]
ignore_missing_imports = True

[mypy-torcharrow.*]
[mypy-rarfile.*]
ignore_missing_imports = True

[mypy-pyarrow.*]
[mypy-scipy.*]
ignore_missing_imports = True

[mypy-graphviz.*]
[mypy-setuptools.*]
ignore_missing_imports = True

[mypy-aistore.*]
[mypy-torcharrow.*]
ignore_missing_imports = True

[mypy-packaging.*]
Expand All @@ -59,3 +59,6 @@ ignore_missing_imports = True

[mypy-psutil.*]
ignore_missing_imports = True

[mypy-pyarrow.*]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion torchdata/datapipes/iter/util/tfrecordloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import operator
from functools import reduce

def prod(xs):
def prod(xs): # type: ignore[no-redef]
return reduce(operator.mul, xs, 1)


Expand Down

0 comments on commit 59d1462

Please sign in to comment.