Skip to content

Cleanup datapipes #4110

Cleanup datapipes

Cleanup datapipes #4110

Workflow file for this run

name: Lint
on:
push:
branches:
- main
- release/*
pull_request:
jobs:
style:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Check out source repository
uses: actions/checkout@v3
- name: Install lint utilities
run: |
pip install pre-commit
pre-commit install-hooks
- name: Lint Python code and config files
run: pre-commit run --all-files
- name: Required modifications
if: ${{ failure() }}
run: git --no-pager diff
mypy:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: ubuntu-latest
steps:
- name: Get PyTorch Channel
shell: bash
run: |
if [[ "${{ github.base_ref }}" == release/* ]] || [[ "${{ github.ref }}" == refs/heads/release/* ]] || [[ "${{ github.ref }}" == refs/tags/v* ]]; then
PT_CHANNEL="https://download.pytorch.org/whl/test/cpu/torch_test.html"
else
PT_CHANNEL="https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html"
fi
echo "value=$PT_CHANNEL" >> $GITHUB_OUTPUT
id: pytorch_channel
- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Check out source repository
uses: actions/checkout@v3
- name: Install PyTorch
run: |
pip3 install networkx
pip3 install --pre torch -f "${{ steps.pytorch_channel.outputs.value }}"
- name: Install dependencies
run: |
pip3 install -r requirements.txt
pip3 install mypy==1.8.0 numpy types-requests
- name: Build TorchData
run: |
pip3 install .
- name: Run mypy
env:
MYPY_FORCE_COLOR: 1
TERM: xterm-color
run: |
set -eux
STATUS=
if ! mypy --config=mypy.ini; then
STATUS=fail
fi
if [ -n "$STATUS" ]; then
echo 'Please fix the above mypy warnings.'
false
fi
complete_documentation:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Check out source repository
uses: actions/checkout@v3
- name: Check if documentation is complete
run: python ./.github/scripts/check_complete_doc.py