-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test on more versions of Python (#563)
* Add Python versions from 3.8 to the GHA test matrix * Improve error message for missing conda-recipe-manager * Remove conda-recipe-manager from environment.yml * Enable new-style type annotations for py<3.10 * Apply ruff fixes * Split double context manager call This enables Python 3.8 compatibility * Switch to setup-micromamba * Install conda-recipe-manager in CI if possible
- Loading branch information
Showing
9 changed files
with
117 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,35 +8,51 @@ on: | |
branches: | ||
- "*" | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
run: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
py_ver: ["3.11", "3.12"] | ||
py_ver: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.py_ver }} | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: conda-incubator/setup-[email protected] | ||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
auto-update-conda: true | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
python-version: ${{ matrix.py_ver }} | ||
#### | ||
# https://github.com/mamba-org/setup-micromamba/issues/225 | ||
micromamba-version: 1.5.10-0 | ||
micromamba-binary-path: /home/runner/micromamba-bin-versioned/micromamba | ||
#### | ||
environment-file: environment.yaml | ||
activate-environment: gs | ||
# Added an extra python to the create-args in order to bust the cache: | ||
create-args: >- | ||
python=${{ matrix.py_ver }} | ||
python | ||
cache-environment: true | ||
- name: Install conda-recipe-manager if possible | ||
# Possible when the Python version is >=3.11 | ||
run: | | ||
if [ $(python -c "import sys; print(sys.version_info[:2] >= (3,11))") = "True" ]; then | ||
echo "Installing conda-recipe-manager" | ||
micromamba install -y -c conda-forge conda-recipe-manager | ||
else | ||
echo "Skipping conda-recipe-manager installation" | ||
fi | ||
- name: Conda info | ||
shell: bash -l {0} | ||
run: | | ||
conda info --all | ||
conda list | ||
- name: Running doctests | ||
shell: bash -l {0} | ||
run: | | ||
pytest grayskull \ | ||
-vv \ | ||
|
@@ -51,7 +67,6 @@ jobs: | |
--junit-prefix=Linux-py${{ matrix.py_ver }}-serial | ||
- name: Running serial tests | ||
shell: bash -l {0} | ||
run: | | ||
pytest tests \ | ||
-vv \ | ||
|
@@ -67,7 +82,6 @@ jobs: | |
--junit-prefix=Linux-py${{ matrix.py_ver }}-serial | ||
- name: Running parallel tests | ||
shell: bash -l {0} | ||
run: | | ||
pytest tests \ | ||
-vv \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ dependencies: | |
- libcblas | ||
- beautifulsoup4 | ||
- semver >=3.0.0,<4.0.0 | ||
- conda-recipe-manager >=0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import re | ||
from abc import ABC | ||
from pathlib import Path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.