Skip to content

Commit

Permalink
Merge pull request #616 from mraspaud/fix-setuptools-version
Browse files Browse the repository at this point in the history
Update cibuildwheel to fix setuptools 74.0.0 compatibility
  • Loading branch information
djhoese authored Aug 28, 2024
2 parents 280c225 + 8fe29a0 commit 5c05460
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 143 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
uses: pypa/cibuildwheel@v2.20.0
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *i686 *-musllinux*"
CIBW_SKIP: "cp36-* cp37-* cp38-* cp313-* pp* *i686 *-musllinux*"
CIBW_ARCHS: "${{ matrix.cibw_archs }}"
CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\""
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
Expand Down
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.5.6'
rev: 'v0.6.2'
hooks:
- id: ruff
# once https://github.com/astral-sh/ruff/issues/2402 is fully resolved then we can get rid of flake8:
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down
21 changes: 20 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel", "numpy>=2.0.0rc1,<2.3", "Cython>=3", "versioneer"]
requires = ["setuptools", "wheel", "numpy>=2.0.0rc1,<2.3", "Cython>=3", "versioneer[toml]"]
build-backend = "setuptools.build_meta"

[tool.ruff]
Expand Down Expand Up @@ -36,3 +36,22 @@ warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
warn_unused_configs = true

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "pyresample/version.py"
versionfile_build = "pyresample/version.py"
tag_prefix = "v"

[tool.isort]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
profile = "black"
skip_gitignore = true
default_section = "THIRDPARTY"
known_first_party = "pyresample"
line_length = 120

[tool.coverage.run]
relative_files = true
omit = ["pyresample/version.py", "versioneer.py"]
6 changes: 1 addition & 5 deletions pyresample/bilinear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
)

try:
from .xarr import ( # noqa: F401
CACHE_INDICES,
XArrayBilinearResampler,
XArrayResamplerBilinear,
)
from .xarr import CACHE_INDICES, XArrayBilinearResampler, XArrayResamplerBilinear # noqa: F401
except ImportError:
warnings.warn("XArray, dask, and/or zarr not found, XArrayBilinearResampler won't be available.", stacklevel=2)
XArrayBilinearResampler = None # type: ignore
Expand Down
7 changes: 1 addition & 6 deletions pyresample/boundary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""The Boundary classes."""

from pyresample.boundary.legacy_boundary import ( # noqa
AreaBoundary,
AreaDefBoundary,
Boundary,
SimpleBoundary,
)
from pyresample.boundary.legacy_boundary import AreaBoundary, AreaDefBoundary, Boundary, SimpleBoundary # noqa
5 changes: 1 addition & 4 deletions pyresample/ewa/dask_ewa.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
from dask.highlevelgraph import HighLevelGraph

from pyresample.ewa import ll2cr
from pyresample.ewa._fornav import (
fornav_weights_and_sums_wrapper,
write_grid_image_single,
)
from pyresample.ewa._fornav import fornav_weights_and_sums_wrapper, write_grid_image_single
from pyresample.geometry import SwathDefinition
from pyresample.resampler import BaseResampler

Expand Down
7 changes: 1 addition & 6 deletions pyresample/future/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@
"""Future features that are backwards incompatible with current functionality."""

from .resamplers import Resampler # noqa
from .resamplers import ( # noqa
create_resampler,
list_resamplers,
register_resampler,
unregister_resampler,
)
from .resamplers import create_resampler, list_resamplers, register_resampler, unregister_resampler # noqa
7 changes: 1 addition & 6 deletions pyresample/future/resamplers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@
from __future__ import annotations

from .nearest import KDTreeNearestXarrayResampler # noqa
from .registry import ( # noqa
create_resampler,
list_resamplers,
register_resampler,
unregister_resampler,
)
from .registry import create_resampler, list_resamplers, register_resampler, unregister_resampler # noqa
from .resampler import Resampler # noqa
11 changes: 2 additions & 9 deletions pyresample/gradient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,8 @@
from shapely.geometry import Polygon

from pyresample import CHUNK_SIZE
from pyresample.geometry import (
AreaDefinition,
SwathDefinition,
get_geostationary_bounding_box_in_lonlats,
)
from pyresample.gradient._gradient_search import (
one_step_gradient_indices,
one_step_gradient_search,
)
from pyresample.geometry import AreaDefinition, SwathDefinition, get_geostationary_bounding_box_in_lonlats
from pyresample.gradient._gradient_search import one_step_gradient_indices, one_step_gradient_search
from pyresample.resampler import BaseResampler, resample_blocks

logger = logging.getLogger(__name__)
Expand Down
7 changes: 1 addition & 6 deletions pyresample/resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@
except ImportError:
xr = None

from pyresample.geometry import (
AreaDefinition,
CoordinateDefinition,
IncompatibleAreas,
SwathDefinition,
)
from pyresample.geometry import AreaDefinition, CoordinateDefinition, IncompatibleAreas, SwathDefinition

from .future.resamplers.resampler import hash_dict

Expand Down
6 changes: 1 addition & 5 deletions pyresample/slicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
from pyproj.enums import TransformDirection

from pyresample import AreaDefinition, SwathDefinition
from pyresample.geometry import (
IncompatibleAreas,
InvalidArea,
get_geostationary_bounding_box_in_proj_coords,
)
from pyresample.geometry import IncompatibleAreas, InvalidArea, get_geostationary_bounding_box_in_proj_coords

try:
import dask.array as da
Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@

import pyresample
from pyresample import LegacyAreaDefinition, LegacySwathDefinition
from pyresample.future.geometry import (
AreaDefinition,
CoordinateDefinition,
SwathDefinition,
)
from pyresample.future.geometry import AreaDefinition, CoordinateDefinition, SwathDefinition
from pyresample.test.utils import create_test_latitude, create_test_longitude

SRC_SWATH_2D_SHAPE = (50, 10)
Expand Down
14 changes: 3 additions & 11 deletions pyresample/test/test_bilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ def test_get_fractional_distances_irregular(self):

def test_get_fractional_distances_uprights_parallel(self):
"""Test calculation when uprights are parallel."""
from pyresample.bilinear._base import (
_get_fractional_distances_uprights_parallel,
)
from pyresample.bilinear._base import _get_fractional_distances_uprights_parallel

res = _get_fractional_distances_uprights_parallel(self.pts_vert_parallel, 0., 0.)
self.assertEqual(res[0], 0.5)
Expand Down Expand Up @@ -237,11 +235,7 @@ def test_get_input_xy(self):

def test_get_four_closest_corners(self):
"""Test calculation of bounding corners."""
from pyresample.bilinear._base import (
_get_four_closest_corners,
_get_input_xy,
_get_output_xy,
)
from pyresample.bilinear._base import _get_four_closest_corners, _get_input_xy, _get_output_xy

proj = Proj(self.target_def.proj_str)
out_x, out_y = _get_output_xy(self.target_def)
Expand Down Expand Up @@ -1040,9 +1034,7 @@ def test_get_fractional_distances_irregular(self):

def test_get_fractional_distances_uprights_parallel(self):
"""Test calculation when uprights are parallel."""
from pyresample.bilinear._base import (
_get_fractional_distances_uprights_parallel,
)
from pyresample.bilinear._base import _get_fractional_distances_uprights_parallel

res = _get_fractional_distances_uprights_parallel(self.pts_vert_parallel, 0., 0.)
self.assertEqual(res[0], 0.5)
Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import pytest

import pyresample
from pyresample._formatting_html import (
area_repr,
plot_area_def,
swath_area_attrs_section,
)
from pyresample._formatting_html import area_repr, plot_area_def, swath_area_attrs_section

from .test_geometry.test_swath import _gen_swath_def_numpy, _gen_swath_def_xarray_dask

Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/test_geometry_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@
import xarray as xr

from pyresample import geometry
from pyresample.geometry import (
IncompatibleAreas,
combine_area_extents_vertical,
concatenate_area_defs,
)
from pyresample.geometry import IncompatibleAreas, combine_area_extents_vertical, concatenate_area_defs
from pyresample.test.utils import catch_warnings


Expand Down
5 changes: 1 addition & 4 deletions pyresample/test/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ def test_add_gridlines(self, axes, fx_locator):

def test_translate_coast_res(self):
"""Test the translation of coast resolution arguments from old basemap notation to cartopy."""
from pyresample.plot import (
BASEMAP_NOT_CARTOPY,
_translate_coast_resolution_to_cartopy,
)
from pyresample.plot import BASEMAP_NOT_CARTOPY, _translate_coast_resolution_to_cartopy

with self.assertRaises(KeyError) as raises:
if sys.version_info > (3,):
Expand Down
5 changes: 1 addition & 4 deletions pyresample/test/test_resample_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ def fun(data, block_info=None, **kwargs):

def test_resample_blocks_can_generate_gradient_indices(self):
"""Test resample blocks can generate gradient indices."""
from pyresample.gradient import (
gradient_resampler_indices,
gradient_resampler_indices_block,
)
from pyresample.gradient import gradient_resampler_indices, gradient_resampler_indices_block
from pyresample.resampler import resample_blocks

chunks = 40
Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/test_resamplers/test_nearest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@

from pyresample.future.geometry import AreaDefinition, SwathDefinition
from pyresample.future.resamplers import KDTreeNearestXarrayResampler
from pyresample.test.utils import (
assert_maximum_dask_computes,
assert_warnings_contain,
catch_warnings,
)
from pyresample.test.utils import assert_maximum_dask_computes, assert_warnings_contain, catch_warnings
from pyresample.utils.errors import PerformanceWarning


Expand Down
7 changes: 1 addition & 6 deletions pyresample/test/test_resamplers/test_resampler_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@

import pytest

from pyresample.future import (
Resampler,
list_resamplers,
register_resampler,
unregister_resampler,
)
from pyresample.future import Resampler, list_resamplers, register_resampler, unregister_resampler
from pyresample.test.utils import assert_warnings_contain


Expand Down
12 changes: 2 additions & 10 deletions pyresample/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@
from pyproj import CRS

import pyresample
from pyresample.test.utils import (
TEST_FILES_PATH,
assert_future_geometry,
create_test_latitude,
create_test_longitude,
)
from pyresample.test.utils import TEST_FILES_PATH, assert_future_geometry, create_test_latitude, create_test_longitude
from pyresample.utils import load_cf_area
from pyresample.utils.row_appendable_array import RowAppendableArray

Expand Down Expand Up @@ -620,10 +615,7 @@ def test_cf_guess_axis_varname(self):
self.nc_handles['nh10km'], 'doesNotExist', 'x', 'polar_stereographic')

def test_cf_is_valid_coordinate_standardname(self):
from pyresample.utils.cf import (
_is_valid_coordinate_standardname,
_valid_cf_type_of_grid_mapping,
)
from pyresample.utils.cf import _is_valid_coordinate_standardname, _valid_cf_type_of_grid_mapping

# nominal
for proj_type in _valid_cf_type_of_grid_mapping:
Expand Down
32 changes: 0 additions & 32 deletions setup.cfg

This file was deleted.

0 comments on commit 5c05460

Please sign in to comment.