Skip to content

Commit

Permalink
[CI/MAINT]: Tidy CI files and uncompatible dependencies versions (#15)
Browse files Browse the repository at this point in the history
* Pin docs versions correctly

* Minimal requirements: pyproject & ci file accordance

* Remove unnecesary reqs files, fix versions
  • Loading branch information
echedey-ls authored Nov 3, 2024
1 parent 74ed46b commit 0bbd1e7
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 70 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,16 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
suffix: [''] # placeholder as an alternative to "-min"
include:
# run with minimal versions of dependencies just on one matrix job, where the coverage report will only get uploaded
- os: ubuntu-latest
# run with minimal versions of dependencies
# this is also used to upload the coverage report
python-version: "3.8"
python-version: "3.8" # update to match lowest supported version
suffix: -min
exclude:
- os: macos-latest
# exclude this version because its PyYAML version does not work (only in macos)
python-version: "3.8"

runs-on: ${{ matrix.os }}
env:
# Dev requirement filename, e.g., ci/requirements-py3.9-min.txt or ci/requirements-py3.9.txt
# these are pip-compatible requirements files
REQUIREMENTS: ci/requirements-py${{ matrix.python-version }}${{ matrix.suffix }}.txt
# pip-compatible requirements file that specifies the minimal versions of dependencies
# to test against. Makes sense only when running with the "-min" suffix.
MIN_REQUIREMENTS: ci/requirements-pip-minimal.txt

steps:
# Check out only a limited depth and then pull tags to save time
Expand All @@ -49,18 +44,19 @@ jobs:
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Install Python ${{ matrix.python-version }}${{ matrix.suffix }}
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up test requirements
# sets versions of dependencies in the requirements file first to avoid installing newer versions
- name: Set up test minimal requirements
if: matrix.suffix == '-min'
# install minimal versions of dependencies in the requirements file first to avoid installing newer versions automatically
run: |
pip install -r ${{ env.REQUIREMENTS }}
pip install -r ${{ env.MIN_REQUIREMENTS }}
pip freeze
- name: Set up environment
- name: Set up tests environment
run: |
pip install .[test]
pip freeze
Expand All @@ -73,7 +69,7 @@ jobs:
- name: Upload coverage report
uses: codecov/codecov-action@v4
# only upload coverage report once, for the minimal version of dependencies
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' && matrix.suffix == '-min'
if: matrix.os == 'ubuntu-latest' && matrix.suffix == '-min'
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
7 changes: 7 additions & 0 deletions ci/requirements-pip-minimal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pin here the minimal versions of the dependencies to run CI tests against
matplotlib==3.5.0
numpy==1.20.3
pandas==1.5.0
pvlib==0.8.1
ruamel.yaml==0.15.100
scipy==1.7.1
6 changes: 0 additions & 6 deletions ci/requirements-py3.10.txt

This file was deleted.

6 changes: 0 additions & 6 deletions ci/requirements-py3.11.txt

This file was deleted.

6 changes: 0 additions & 6 deletions ci/requirements-py3.12.txt

This file was deleted.

6 changes: 0 additions & 6 deletions ci/requirements-py3.13.txt

This file was deleted.

6 changes: 0 additions & 6 deletions ci/requirements-py3.8-min.txt

This file was deleted.

6 changes: 0 additions & 6 deletions ci/requirements-py3.8.txt

This file was deleted.

6 changes: 0 additions & 6 deletions ci/requirements-py3.9.txt

This file was deleted.

24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta"
name = "pvpltools"
dynamic = ["version"]
dependencies = [
"matplotlib",
"numpy",
"pandas",
"matplotlib>=3.5.0",
"numpy>=1.20.3",
"pandas>=1.5.0",
"openpyxl",
"pvlib",
"ruamel.yaml>=0.15",
"scipy",
"pvlib>=0.8.1",
"ruamel.yaml>=0.15.0",
"scipy>=1.7.1",
]
requires-python = ">=3.8"
authors = [
Expand All @@ -34,12 +34,12 @@ test = [
"flake8",
]
docs = [
"sphinx~=7.4",
"pydata-sphinx-theme~=0.15",
"sphinx-gallery~=0.18",
"sphinx_toggleprompt~=0.5",
"sphinx_favicon~=1.0",
"sphinx-copybutton~=0.5",
"sphinx~=7.4.0",
"pydata-sphinx-theme~=0.15.0",
"sphinx-gallery~=0.18.0",
"sphinx_toggleprompt~=0.5.0",
"sphinx_favicon~=1.0.0",
"sphinx-copybutton~=0.5.0",
]
all = ["pvpltools[test,docs]"]

Expand Down

0 comments on commit 0bbd1e7

Please sign in to comment.