From cde8ea63880e0f7526efe71d152c5bbe912803f7 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Thu, 1 Feb 2024 12:55:39 -0900 Subject: [PATCH] Pin max versions of all major dependencies for future compatibility (#462) --- .github/workflows/python-tests.yml | 5 +++-- dev-environment.yml | 17 +++++++++-------- environment.yml | 15 ++++++++------- requirements.txt | 15 ++++++++------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 4872797e..f168dee0 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -36,6 +36,7 @@ jobs: use-mamba: true channel-priority: strict activate-environment: geoutils-dev + python-version: - name: Get month for resetting cache id: get-date @@ -48,7 +49,7 @@ jobs: path: ${{ env.CONDA }}/envs key: conda-${{ matrix.os }}-${{ matrix.python-version }}-${{ env.cache_date }}-${{ hashFiles('dev-environment.yml') }}-${{ env.CACHE_NUMBER }} env: - CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed + CACHE_NUMBER: 1 # Increase this value to reset cache if environment.yml has not changed id: cache # The trick below is necessary because the generic environment file does not specify a Python version, and ONLY @@ -60,7 +61,7 @@ jobs: run: | mamba install pyyaml python=${{ matrix.python-version }} python .github/scripts/generate_yml_env_fixed_py.py --pyv ${{ matrix.python-version }} --add "graphviz" "environment.yml" - mamba env update -n xdem-dev -f environment-ci-py${{ matrix.python-version }}.yml + mamba env update -n geoutils-dev -f environment-ci-py${{ matrix.python-version }}.yml - name: Install project run: pip install -e . --no-dependencies diff --git a/dev-environment.yml b/dev-environment.yml index 7d45fa5d..c1c63ebd 100644 --- a/dev-environment.yml +++ b/dev-environment.yml @@ -3,15 +3,16 @@ channels: - conda-forge dependencies: - python>=3.9,<3.12 - - geopandas>=0.12.0 - - matplotlib - - pyproj - - rasterio>=1.3 - - numpy - - scipy + - geopandas>=0.12.0,<0.14 + - matplotlib=3.* + - pyproj=3.* + - rasterio>=1.3,<2 + - pandas=1.* + - numpy=1.* + - scipy=1.* - tqdm - xarray - - rioxarray + - rioxarray=0.* # Development-specific, to mirror manually in setup.cfg [options.extras_require]. - pip @@ -20,7 +21,7 @@ dependencies: - scikit-image # Test dependencies - - pytest + - pytest=7.* - pytest-xdist - pytest-lazy-fixture - pyyaml diff --git a/environment.yml b/environment.yml index 1940594e..d389d95d 100644 --- a/environment.yml +++ b/environment.yml @@ -3,12 +3,13 @@ channels: - conda-forge dependencies: - python>=3.9,<3.12 - - geopandas>=0.12.0 - - matplotlib - - pyproj - - rasterio>=1.3 - - numpy - - scipy + - geopandas>=0.12.0,<0.14 + - matplotlib=3.* + - pyproj=3.* + - rasterio>=1.3,<2 + - pandas=1.* + - numpy=1.* + - scipy=1.* - tqdm - xarray - - rioxarray + - rioxarray=0.* diff --git a/requirements.txt b/requirements.txt index 39f6d95f..fcb0a3b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,15 @@ # This file is auto-generated from environment.yml, do not modify. # See that file for comments about the need/usage of each dependency. -geopandas>=0.12.0 -matplotlib -pyproj -rasterio>=1.3 -numpy -scipy +geopandas>=0.12.0,<0.14 +matplotlib==3.* +pyproj==3.* +rasterio>=1.3,<2 +pandas==1.* +numpy==1.* +scipy==1.* tqdm xarray -rioxarray +rioxarray==0.* setuptools>=64 setuptools_scm[toml]>=8