diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76b485f6d3..a872a09fb2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,25 +3,50 @@ name: build on: [push, pull_request] jobs: - build: + lint: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install linting dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 isort==4.3.21 yapf interrogate + - name: Lint with flake8 + run: flake8 . + - name: Lint with isort + run: isort --recursive --check-only --diff mmaction/ tools/ tests/ demo/ + - name: Format python codes with yapf + run: yapf -r -d mmaction/ tools/ configs/ tests/ demo/ + - name: Check docstring + run: interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmaction + build: env: CUDA: 10.1.105-1 CUDA_SHORT: 10.1 UBUNTU_VERSION: ubuntu1804 FORCE_CUDA: 1 + MMCV_CUDA_ARGS: -gencode=arch=compute_61,code=sm_61 + runs-on: ubuntu-latest strategy: matrix: python-version: [3.6, 3.7] - torch: [1.3.0, 1.5.0] + torch: [1.3.0+cpu, 1.5.0+cpu] include: - - torch: 1.3.0 - torchvision: 0.4.2 - cuda_arch: "6.0" - - torch: 1.5.0 - torchvision: 0.6.0 - cuda_arch: "7.0" + - torch: 1.3.0+cpu + torchvision: 0.4.2+cpu + - torch: 1.5.0+cpu + torchvision: 0.6.0+cpu + - torch: 1.5.0+cpu + torchvision: 0.6.0+cpu + python-version: 3.8 + - torch: 1.5.0+cu101 + torchvision: 0.6.0+cu101 + python-version: 3.7 steps: - uses: actions/checkout@v2 @@ -30,6 +55,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install CUDA + if: ${{matrix.torch == '1.5.0+cu101'}} run: | export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} @@ -44,36 +70,26 @@ jobs: export PATH=${CUDA_HOME}/bin:${PATH} sudo apt-get install -y ninja-build - name: Install Pillow + if: ${{matrix.torchvision == '0.4.2+cpu'}} run: pip install Pillow==6.2.2 - if: ${{matrix.torchvision < 0.5}} - name: Install TurboJpeg lib run: sudo apt-get install -y libturbojpeg - name: Install PyTorch - run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} + run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html - name: Install mmaction dependencies run: | pip install mmcv pip install -r requirements.txt - - name: Lint with flake8 - run: flake8 . - - name: Lint with isort - run: isort --recursive --check-only --diff mmaction/ tools/ tests/ - - name: Format with yapf - run: yapf -r -d mmaction/ tools/ configs/ tests/ - - name: Check docstring - run: interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmaction - name: Build and install - env: - CUDA_ARCH: ${{matrix.cuda_arch}} - run: | - rm -rf .eggs - python setup.py check -m + run: rm -rf .eggs && pip install -e . - name: Run unittests and generate coverage report run: | coverage run --branch --source mmaction -m pytest tests/ coverage xml coverage report -m + # Only upload coverage report for python3.7 && pytorch1.5 - name: Upload coverage to Codecov + if: ${{matrix.torch == '1.5.0+cu101' && matrix.python-version == '3.7'}} uses: codecov/codecov-action@v1.0.10 with: file: ./coverage.xml diff --git a/setup.py b/setup.py index e641cd2478..2bbe3c061f 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,8 @@ def write_version_py(): sha = get_hash() with open('mmaction/VERSION', 'r') as f: SHORT_VERSION = f.read().strip() - VERSION_INFO = ', '.join(SHORT_VERSION.split('.')) + VERSION_INFO = ', '.join( + [x if x.isdigit() else f'"{x}"' for x in SHORT_VERSION.split('.')]) VERSION = SHORT_VERSION + '+' + sha version_file_str = content.format(time.asctime(), VERSION, SHORT_VERSION, @@ -109,6 +110,8 @@ def parse_line(line): info = {'line': line} if line.startswith('-e '): info['package'] = line.split('#egg=')[1] + elif '@git+' in line: + info['package'] = line else: # Remove versioning from the package pat = '(' + '|'.join(['>=', '==', '>']) + ')' @@ -160,8 +163,10 @@ def gen_packages_items(): setup( name='mmaction', version=get_version(), - description='Open MMLab Action Recognition Toolbox', + description='OpenMMLab Action Understanding Toolbox', long_description=readme(), + maintainer='MMAction Authors', + maintainer_email='openmmlab@gmail.com', packages=find_packages(exclude=('configs', 'tools', 'demo')), package_data={'mmaction.ops': ['*/*.so']}, classifiers=[