Skip to content

Bump pypa/gh-action-pypi-publish from 1.4.2 to 1.13.0 in /.github/workflows #18

Bump pypa/gh-action-pypi-publish from 1.4.2 to 1.13.0 in /.github/workflows

Bump pypa/gh-action-pypi-publish from 1.4.2 to 1.13.0 in /.github/workflows #18

Workflow file for this run

name: Run test suite
on: [pull_request]
jobs:
check_version:
strategy:
matrix:
python-version: [ 3.8 ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check version
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/patrick-kidger/torchcde.git
master_info=$(pip list | grep torchcde)
master_version=$(echo ${master_info} | cut -d " " -f2)
pip uninstall -y torchcde
python setup.py install
pr_info=$(pip list | grep torchcde)
pr_version=$(echo ${pr_info} | cut -d " " -f2)
python -c "import itertools as it;
import sys;
master_version = sys.argv[1];
pr_version = sys.argv[2];
master_version_ = [int(i) for i in master_version.split('.')];
pr_version_ = [int(i) for i in pr_version.split('.')];
master_version__ = tuple(m for p, m in it.zip_longest(pr_version_, master_version_, fillvalue=0));
pr_version__ = tuple(p for p, m in it.zip_longest(pr_version_, master_version_, fillvalue=0));
sys.exit(pr_version__ <= master_version__)" ${master_version} ${pr_version}
test:
needs: [ check_version ]
strategy:
matrix:
python-version: [ 3.6, 3.8 ]
os: [ ubuntu-latest, macOS-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
- name: Install torchcde
run: |
python -m pip install torch==1.9.0
python setup.py install
- name: Install Signatory
if: matrix.os != 'macos-latest'
shell: bash
run: |
signatory_version=$(python -c "import re
import subprocess
version_msg = subprocess.run('pip install --use-deprecated=legacy-resolver signatory==', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
version_re = re.compile(rb'from versions: ([0-9\. ,]*)\)')
last_version = version_re.search(version_msg.stderr).group(1).split(b', ')[-1].decode('utf-8').split('.')
assert len(last_version) == 6
last_version = '.'.join(last_version[:3])
print(last_version)")
torch_info=$(pip list | grep '^torch ')
torch_version=$(echo ${torch_info} | cut -d " " -f2)
python -m pip install signatory==${signatory_version}.${torch_version}
- name: Lint with flake8
run: |
python -m flake8 .
- name: Test with pytest
run: |
python -m pytest