diff --git a/.github/workflows/os-coverage.yml b/.github/workflows/os-coverage.yml index 7b33a7b..ec513bc 100644 --- a/.github/workflows/os-coverage.yml +++ b/.github/workflows/os-coverage.yml @@ -7,38 +7,48 @@ jobs: strategy: fail-fast: true max-parallel: 15 - matrix: - os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-latest] - python-version: [3.7, 3.8, 3.9] + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.7', '3.8', '3.9', '3.10'] exclude: - # temporary exclusion until py3.8 deps work on Windows - - python-version: 3.7 - os: windows-2019 - - python-version: 3.8 - os: windows-2019 - + - python-version: '3.7' + os: windows-latest # https://pytorch.org/get-started/locally/#windows-python (actually 3.7 seems to be the problem) + defaults: + run: + shell: bash steps: - - uses: actions/checkout@v2 + - name: Check out repository + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - name: Install dependencies + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-pip-wheels + uses: actions/cache@v3 + with: + path: ~/.cache + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependencies # hack for 🐛: don't let poetry try installing Torch https://github.com/pytorch/pytorch/issues/88049 run: | - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - - source $HOME/.poetry/env - python -m pip install --upgrade --user pip - pip install pytest pytest-cov - poetry lock - poetry build - poetry install - poetry run pip install 'setuptools==59.5.0' - # pinning setuptools is a temporary fix to: pytorch-lightning 1.5.10 requires setuptools==59.5.0 - # supposedly poetry allows pinning ver. of setuptools in pyproject.ml files but it is not working atm https://github.com/python-poetry/poetry/issues/4511 - - - name: Run tests + pip install pytest pytest-cov papermill poethepoet>=0.10.0 + pip install torch>=1.8.1 torchvision pytorch-lightning scikit-learn torchsde torchcde>=0.2.3 scipy matplotlib ipykernel ipywidgets + poetry install --only-root + poetry run pip install setuptools + + - name: Run pytest checks run: | - source $HOME/.poetry/env + source $VENV poetry run coverage run --source=torchdyn -m pytest + + - name: Report coverage + uses: codecov/codecov-action@v3.1.1 diff --git a/pyproject.toml b/pyproject.toml index b178534..48ebb84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ python = "^3.7" torch = "^1.8.1" torchsde="*" torchcde="^0.2.3" -sklearn = "*" +scikit-learn = "*" pytorch-lightning = "*" torchvision = "*" scipy = "*"