Skip to content

Commit

Permalink
Set minimum Python version for development shells (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp-noaa authored Feb 19, 2025
1 parent 8607764 commit 32743fe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ run_tests() {
echo TESTING PYTHON $PYTHON_VERSION
env=python-$PYTHON_VERSION
devpkgs=$(jq .packages.dev[] recipe/meta.json | tr -d ' "')
conda create --yes --name $env --quiet python=$PYTHON_VERSION $devpkgs
conda create --yes --name $env --quiet $devpkgs
conda activate $env
conda install --yes python=$PYTHON_VERSION
. notebooks/install-deps
set -x
python --version
git clean -dfx
pip install --editable src # sets new Python version in entry-point scripts
make test && make test-nb
Expand Down
10 changes: 5 additions & 5 deletions recipe/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
"docformatter ==1.7.*",
"f90nml ==1.4.*",
"iotaa ==1.1.*",
"isort ==5.13.*",
"isort ==6.0.*",
"jinja2 ==3.1.*",
"jq ==1.7.*",
"jsonschema >=4.18,<4.24",
"lxml ==5.3.*",
"lxml ==5.2.*",
"make ==4.4.*",
"mypy ==1.14.*",
"mypy ==1.15.*",
"pip",
"pylint ==3.3.*",
"pytest ==8.3.*",
"pytest-cov ==6.0.*",
"pytest-xdist ==3.6.*",
"python >=3.9,<3.13",
"python <3.13,==3.9,>=3.9",
"pyyaml ==6.0.*",
"requests ==2.32.*",
"setuptools"
Expand All @@ -30,7 +30,7 @@
"iotaa ==1.1.*",
"jinja2 ==3.1.*",
"jsonschema >=4.18,<4.24",
"lxml ==5.3.*",
"lxml ==5.2.*",
"python >=3.9,<3.13",
"pyyaml ==6.0.*",
"requests ==2.32.*"
Expand Down
13 changes: 8 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% set info = load_file_data("uwtools/resources/info.json") %}
{% set pymin = "3.9" %}

package:
name: uwtools
Expand All @@ -10,29 +11,31 @@ build:
noarch: python
number: {{ info["buildnum"] }}
requirements:
build:
host:
- pip
- python {{ pymin }}
- setuptools
run:
- f90nml 1.4.*
- iotaa 1.1.*
- jinja2 3.1.*
- jsonschema >=4.18,<4.24
- lxml 5.3.*
- python >=3.9,<3.13
- lxml 5.2.*
- python >={{ pymin }},<3.13
- pyyaml 6.0.*
- requests 2.32.*
test:
requires:
- black 24.10.*
- docformatter 1.7.*
- isort 5.13.*
- isort 6.0.*
- jq 1.7.*
- make 4.4.*
- mypy 1.14.*
- mypy 1.15.*
- pylint 3.3.*
- pytest 8.3.*
- pytest-cov 6.0.*
- pytest-xdist 3.6.*
- python {{ pymin }}
about:
license: LGPL
1 change: 1 addition & 0 deletions recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ unittest() {
}

test "${CONDA_BUILD:-}" = 1 && cd ../test_files || cd $(dirname $0)/../src
python --version
if [[ -n "${1:-}" ]]; then
# Run single specified code-quality tool.
$1
Expand Down

0 comments on commit 32743fe

Please sign in to comment.