Skip to content

Commit

Permalink
MNT: update actions; add min version test
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Dec 23, 2023
1 parent 575bf92 commit f409191
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-cache-${{ hashFiles('requirements/*/*.txt') }}
key: pip-cache-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
pip-cache
- name: Install python requirements
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install -r requirements-dev.txt
python3 -m pip install --upgrade pip build setuptools wheel
python3 -m pip install -r requirements/requirements-dev.txt
- name: Create cache directory
run: |
Expand Down
50 changes: 23 additions & 27 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']
name: Tests on ${{ matrix.python-version }}
include:
- name-suffix: "(Minimum Versions)"
python-version: "3.8"
extra-requirements: "-c requirements/minver.txt"
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"
name: Tests on ${{ matrix.python-version }} ${{ matrix.name-suffix }}
steps:
- name: Setup python
uses: actions/setup-python@v4
Expand All @@ -28,14 +35,14 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-cache-${{ hashFiles('requirements/*/*.txt') }}
key: pip-cache-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
pip-cache
- name: Install python requirements
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install -r requirements-dev.txt
python3 -m pip install --upgrade pip build setuptools wheel
python3 -m pip install -r requirements/requirements-dev.txt ${{ matrix.extra-requirements }}
- name: Install Fast-F1 from sources
run: |
Expand All @@ -57,14 +64,15 @@ jobs:
run: |
pytest -ra
run-lint-checks:
runs-on: ubuntu-latest
name: Linting Ruff
name: Linting (Ruff)
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.12'

- name: Checkout repo
uses: actions/checkout@v3
Expand All @@ -73,16 +81,16 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-cache-${{ hashFiles('requirements/*/*.txt') }}
key: pip-cache-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
pip-cache
- name: Install python requirements
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
python3 -m pip install --upgrade pip build setuptools wheel
python3 -m pip install -r requirements/requirements-dev.txt
- name: Install Fast-F1 from sources
- name: Install FastF1 from sources
run: |
python3 -m pip install -e .
Expand All @@ -94,19 +102,6 @@ jobs:
# ruff with default config
ruff check .
- name: Run tests (master push)
if: ${{ github.ref == 'refs/heads/master' && env.GITHUB_EVENT_NAME == 'push'}}
env:
LAST_PUSH_SHA: ${{ github.event.before }}
run: |
mkdir test_cache # make sure cache dir exists
git fetch origin --quiet
# flake8 with default config
flake8 fastf1 examples scripts
# flake8 check new shorter line length only on diff
echo "Flake8 line length check on diff against $LAST_PUSH_SHA"
git diff $LAST_PUSH_SHA -U0 --relative | flake8 --max-line-length 79 --diff --select E501 fastf1 examples scripts
run-readme-render-test:
name: Test readme renders on PyPi
Expand All @@ -124,14 +119,14 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-cache-${{ hashFiles('requirements/*/*.txt') }}
key: pip-cache-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
pip-cache
- name: Install python requirements
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install -r requirements-dev.txt
python3 -m pip install --upgrade pip build setuptools wheel
python3 -m pip install -r requirements/requirements-dev.txt
- name: Install Fast-F1 from sources
run: |
Expand All @@ -142,6 +137,7 @@ jobs:
mkdir test_cache # not really need but pytest setup relies on it
pytest -rf --prj-doc
run-sphinx-build-test:
name: Test Docs
uses: ./.github/workflows/docs.yml
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ readme = "README.md"

license = { file = "LICENSE" }

# minimum python version additionally needs to be changed in the test matrix
requires-python = ">=3.8"
# minimum package versions additionally need to be changed in requirement/minver.txt
dependencies = [
"matplotlib>=3.4.2,<4.0.0",
"numpy>=1.20.3,<2.0.0",
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions requirements/minver.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
matplotlib==3.4.2
numpy==1.20.3
pandas==1.2.4
requests==2.28.0
requests-cache==0.8.0
scipy==1.6.3
timple==0.1.6
websockets==8.1

0 comments on commit f409191

Please sign in to comment.