Skip to content

Commit 0bbd1e7

Browse files
authored
[CI/MAINT]: Tidy CI files and uncompatible dependencies versions (#15)
* Pin docs versions correctly * Minimal requirements: pyproject & ci file accordance * Remove unnecesary reqs files, fix versions
1 parent 74ed46b commit 0bbd1e7

10 files changed

+31
-70
lines changed

.github/workflows/pytest.yml

+12-16
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,16 @@ jobs:
2323
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2424
suffix: [''] # placeholder as an alternative to "-min"
2525
include:
26+
# run with minimal versions of dependencies just on one matrix job, where the coverage report will only get uploaded
2627
- os: ubuntu-latest
27-
# run with minimal versions of dependencies
28-
# this is also used to upload the coverage report
29-
python-version: "3.8"
28+
python-version: "3.8" # update to match lowest supported version
3029
suffix: -min
31-
exclude:
32-
- os: macos-latest
33-
# exclude this version because its PyYAML version does not work (only in macos)
34-
python-version: "3.8"
3530

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

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

52-
- name: Install Python ${{ matrix.python-version }}${{ matrix.suffix }}
47+
- name: Install Python ${{ matrix.python-version }}
5348
uses: actions/setup-python@v5
5449
with:
5550
python-version: ${{ matrix.python-version }}
5651

57-
- name: Set up test requirements
58-
# sets versions of dependencies in the requirements file first to avoid installing newer versions
52+
- name: Set up test minimal requirements
53+
if: matrix.suffix == '-min'
54+
# install minimal versions of dependencies in the requirements file first to avoid installing newer versions automatically
5955
run: |
60-
pip install -r ${{ env.REQUIREMENTS }}
56+
pip install -r ${{ env.MIN_REQUIREMENTS }}
6157
pip freeze
6258
63-
- name: Set up environment
59+
- name: Set up tests environment
6460
run: |
6561
pip install .[test]
6662
pip freeze
@@ -73,7 +69,7 @@ jobs:
7369
- name: Upload coverage report
7470
uses: codecov/codecov-action@v4
7571
# only upload coverage report once, for the minimal version of dependencies
76-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' && matrix.suffix == '-min'
72+
if: matrix.os == 'ubuntu-latest' && matrix.suffix == '-min'
7773
with:
7874
fail_ci_if_error: true
7975
token: ${{ secrets.CODECOV_TOKEN }}

ci/requirements-pip-minimal.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# pin here the minimal versions of the dependencies to run CI tests against
2+
matplotlib==3.5.0
3+
numpy==1.20.3
4+
pandas==1.5.0
5+
pvlib==0.8.1
6+
ruamel.yaml==0.15.100
7+
scipy==1.7.1

ci/requirements-py3.10.txt

-6
This file was deleted.

ci/requirements-py3.11.txt

-6
This file was deleted.

ci/requirements-py3.12.txt

-6
This file was deleted.

ci/requirements-py3.13.txt

-6
This file was deleted.

ci/requirements-py3.8-min.txt

-6
This file was deleted.

ci/requirements-py3.8.txt

-6
This file was deleted.

ci/requirements-py3.9.txt

-6
This file was deleted.

pyproject.toml

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta"
66
name = "pvpltools"
77
dynamic = ["version"]
88
dependencies = [
9-
"matplotlib",
10-
"numpy",
11-
"pandas",
9+
"matplotlib>=3.5.0",
10+
"numpy>=1.20.3",
11+
"pandas>=1.5.0",
1212
"openpyxl",
13-
"pvlib",
14-
"ruamel.yaml>=0.15",
15-
"scipy",
13+
"pvlib>=0.8.1",
14+
"ruamel.yaml>=0.15.0",
15+
"scipy>=1.7.1",
1616
]
1717
requires-python = ">=3.8"
1818
authors = [
@@ -34,12 +34,12 @@ test = [
3434
"flake8",
3535
]
3636
docs = [
37-
"sphinx~=7.4",
38-
"pydata-sphinx-theme~=0.15",
39-
"sphinx-gallery~=0.18",
40-
"sphinx_toggleprompt~=0.5",
41-
"sphinx_favicon~=1.0",
42-
"sphinx-copybutton~=0.5",
37+
"sphinx~=7.4.0",
38+
"pydata-sphinx-theme~=0.15.0",
39+
"sphinx-gallery~=0.18.0",
40+
"sphinx_toggleprompt~=0.5.0",
41+
"sphinx_favicon~=1.0.0",
42+
"sphinx-copybutton~=0.5.0",
4343
]
4444
all = ["pvpltools[test,docs]"]
4545

0 commit comments

Comments
 (0)