Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set lower bounds for supported dependency versions #356

Merged
merged 5 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Set lower bounds for supported dependency versions
Follow NEP29 and set lower bounds for the dependencies (all minor
versions from the last 2 years). The only exception is xrft, which is
new and likely requires v1.0 to work with Harmonica. Setup CI to run on
lowest Python with lowest dependencies, highest Python with highest
dependencies, and highest Python with optional dependencies. Use
Dependente to extract the version information from setup.cfg instead of
the custom export tool we had.
  • Loading branch information
leouieda committed Oct 26, 2022
commit ec3aead3b72c6497beaacd77b245b990fbd7a172
16 changes: 8 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,25 @@ jobs:
# Needed for caching
use-only-tar-bz2: true

- name: Collect requirements - run-time
run: python tools/export_requirements.py > requirements-full.txt

- name: Collect requirements - other
- name: Collect requirements
run: |
echo "Install Dependente to capture dependencies:"
mamba install dependente==0.1.0 -c conda-forge
echo ""
echo "Capturing run-time dependencies:"
dependente --source install > requirements-full.txt
echo "Capturing dependencies from:"
for requirement in $REQUIREMENTS
do
echo " $requirement"
cat $requirement >> requirements-full.txt
done

- name: List requirements
run: |
echo ""
echo "Collected dependencies:"
cat requirements-full.txt

- name: Setup caching for conda packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: conda-${{ runner.os }}-${{ env.PYTHON }}-${{ hashFiles('requirements-full.txt') }}
Expand Down
41 changes: 25 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ jobs:
- ubuntu
- macos
- windows
python:
- "3.7"
- "3.9"
dependencies:
- oldest
- latest
- optional
include:
- dependencies: oldest
python: "3.7"
- dependencies: latest
python: "3.9"
- dependencies: optional
python: "3.9"
env:
REQUIREMENTS: env/requirements-tests.txt
REQUIREMENTS: env/requirements-build.txt env/requirements-tests.txt
# Used to tag codecov submissions
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
Expand Down Expand Up @@ -81,39 +87,42 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Collect requirements - run-time
run: python tools/export_requirements.py > requirements-full.txt

- name: Collect requirements - other
- name: Collect requirements
run: |
echo "Install Dependente to capture dependencies:"
python -m pip install dependente==0.1.0
echo ""
echo "Capturing run-time dependencies:"
if [[ "${{ matrix.dependencies }}" == "oldest" ]]; then
dependente --source install --oldest > requirements-full.txt
elif [[ "${{ matrix.dependencies }}" == "optional" ]]; then
dependente --source install,extras > requirements-full.txt
else
dependente --source install > requirements-full.txt
fi
echo "Capturing dependencies from:"
for requirement in $REQUIREMENTS
do
echo " $requirement"
cat $requirement >> requirements-full.txt
done

- name: List requirements
run: |
echo ""
echo "Collected dependencies:"
cat requirements-full.txt

- name: Get the pip cache folder
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
echo "dir="$(pip cache dir) >> $GITHUB_OUTPUT

- name: Setup caching for pip packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-full.txt') }}

- name: Install requirements
run: |
# Install the build requirements before anything else so pip can use
# wheels for other packages.
python -m pip install --requirement env/requirements-build.txt
python -m pip install --requirement requirements-full.txt

- name: Build source and wheel distributions
Expand Down
20 changes: 10 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ include_package_data = True
packages = find:
python_requires = >=3.7
install_requires =
numpy
pandas
scipy
scikit-learn
numba
pooch>=0.7.0
xarray
verde>=1.5.0
xrft
numpy>=1.19
pandas>=1.1
scipy>=1.5
scikit-learn>=0.24
numba>=0.52
pooch>=1.2
xarray>=0.16
verde>=1.5
xrft>=1.0

[options.extras_require]
visualizations =
pyvista
pyvista>=0.27
vtk>=9

[options.package_data]
Expand Down
19 changes: 0 additions & 19 deletions tools/export_requirements.py

This file was deleted.