Skip to content

Commit 0df99f0

Browse files
author
Jeff Whitaker
authored
Merge pull request #1407 from ocefpaf/fix_latest_pip_egg
fix latest pip egg deprecation
2 parents e43933f + b851447 commit 0df99f0

6 files changed

Lines changed: 24 additions & 12 deletions

File tree

.github/workflows/build_latest.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ jobs:
6363
- name: Install python dependencies via pip
6464
run: |
6565
python -m pip install --upgrade pip
66-
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
66+
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
6767
6868
- name: Install netcdf4-python
6969
run: |
7070
export PATH=${NETCDF_DIR}/bin:${PATH}
7171
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c-${NETCDF_VERSION}/plugins/plugindir
72-
python setup.py install
72+
python -m pip install . --no-build-isolation
73+
7374
- name: Test
7475
run: |
7576
export PATH=${NETCDF_DIR}/bin:${PATH}

.github/workflows/build_master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ jobs:
5151
- name: Install python dependencies via pip
5252
run: |
5353
python -m pip install --upgrade pip
54-
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py mypy types-setuptools typing-extensions
54+
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py mypy types-setuptools typing-extensions
5555
5656
- name: Install netcdf4-python
5757
run: |
5858
export PATH=${NETCDF_DIR}/bin:${PATH}
5959
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c/plugins/plugindir
60-
python setup.py install
60+
python -m pip install . --no-build-isolation
6161
6262
- name: Test
6363
run: |

.github/workflows/build_old.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ jobs:
6363
- name: Install python dependencies via pip
6464
run: |
6565
python -m pip install --upgrade pip
66-
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
66+
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
6767
6868
- name: Install netcdf4-python
6969
run: |
7070
export PATH=${NETCDF_DIR}/bin:${PATH}
7171
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c-${NETCDF_VERSION}/plugins/plugindir
72-
python setup.py install
72+
python -m pip install . --no-build-isolation
73+
7374
- name: Test
7475
run: |
7576
export PATH=${NETCDF_DIR}/bin:${PATH}

.github/workflows/cibuildwheel.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ jobs:
8484
# These needs to rotate every new Python release.
8585
run: |
8686
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
87-
CIBW_SKIP="pp* cp36-* cp37-* *-musllinux* cp39-* cp310-* cp311-*"
87+
CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux* cp39-* cp310-* cp311-* cp312-*"
8888
else
89-
CIBW_SKIP="pp* cp36-* cp37-* *-musllinux*"
89+
CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux*"
9090
fi
9191
echo "CIBW_SKIP=$CIBW_SKIP" >> $GITHUB_ENV
9292
echo "Setting CIBW_SKIP=$CIBW_SKIP"
@@ -100,7 +100,7 @@ jobs:
100100
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/ocefpaf/manylinux2014_x86_64-netcdf
101101
CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/ocefpaf/manylinux2014_aarch64-netcdf
102102
# Emulation testing is slow, testing only latest Python.
103-
CIBW_TEST_SKIP: "cp38-*_aarch64 cp39-*_aarch64 cp310-*_aarch64 cp311-*_aarch64"
103+
CIBW_TEST_SKIP: "cp39-*_aarch64 cp310-*_aarch64 cp311-*_aarch64 cp312-*_aarch64"
104104
CIBW_ENVIRONMENT: ${{ matrix.CIBW_ENVIRONMENT }}
105105
CIBW_BEFORE_BUILD_MACOS: brew install hdf5 netcdf
106106
CIBW_TEST_REQUIRES: pytest cython packaging typing-extensions

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description = "Provides an object-oriented python interface to the netCDF versio
1313
authors = [
1414
{name = "Jeff Whitaker", email = "jeffrey.s.whitaker@noaa.gov"},
1515
]
16-
requires-python = ">=3.8"
16+
requires-python = ">=3.9"
1717
keywords = [
1818
"numpy", "netcdf", "data", "science", "network", "oceanography",
1919
"meteorology", "climate",
@@ -22,11 +22,11 @@ license = {text = "MIT"}
2222
classifiers = [
2323
"Development Status :: 3 - Alpha",
2424
"Programming Language :: Python :: 3",
25-
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
2827
"Programming Language :: Python :: 3.11",
2928
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
3030
"Intended Audience :: Science/Research",
3131
"License :: OSI Approved :: MIT License",
3232
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -46,6 +46,9 @@ tests = [
4646
"packaging",
4747
"pytest",
4848
]
49+
parallel = [
50+
"mpi4py",
51+
]
4952

5053
[project.readme]
5154
text = """\

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from setuptools.dist import Distribution
88
from typing import List
99

10+
11+
1012
open_kwargs = {'encoding': 'utf-8'}
1113

1214

@@ -397,7 +399,12 @@ def _populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs):
397399
print(f"netcdf lib {has_has_not} parallel functions")
398400

399401
if has_parallel_support:
400-
import mpi4py
402+
try:
403+
import mpi4py
404+
except ImportError:
405+
msg = "Parallel support requires mpi4py but it is not installed."
406+
raise ImportError(msg)
407+
401408
inc_dirs.append(mpi4py.get_include())
402409
# mpi_incdir should not be needed if using nc-config
403410
# (should be included in nc-config --cflags)

0 commit comments

Comments
 (0)