Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
if: matrix.experimental == true
shell: bash -l {0}
run: |
python -m pip install versioneer extension-helpers setuptools-scm configobj pkgconfig;
python -m pip install hatchling hatch-vcs hatch-cython Cython setuptools versioneer editables configobj pkgconfig;
python -m pip install \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ \
--no-deps --pre --upgrade \
Expand Down
114 changes: 103 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,105 @@
[build-system]
requires = ["setuptools", "wheel", "numpy>=2.0.0,<3", "Cython>=3.1", "versioneer[toml]"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs", "hatch-cython", "Cython>=3.1", "setuptools", "numpy>=2.0"]
build-backend = "hatchling.build"

[project]
name = "pyresample"
dynamic = ["version"]
description = "Geospatial image resampling in Python"
readme = "README.md"
license = "LGPL-3.0-or-later"
license-files = ["LICENSE.txt"]
authors = [
{ name = "Thomas Lavergne", email = "t.lavergne@met.no" },
]
requires-python = ">=3.11"
dependencies = [
"pyproj>=3.0",
"configobj",
"pykdtree>=1.3.1",
"pyyaml",
"numpy>=1.25.0",
"shapely",
"donfig",
"platformdirs",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Cython",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: Free Threading :: 1 - Unstable",
]

[project.urls]
Homepage = "https://github.com/pytroll/pyresample"

[project.optional-dependencies]
numexpr = ["numexpr"]
quicklook = ["matplotlib", "cartopy>=0.20.0", "pillow"]
rasterio = ["rasterio"]
dask = ["dask>=0.16.1"]
cf = ["xarray"]
gradient_search = ["shapely"]
xarray_bilinear = ["xarray", "dask", "zarr"]
odc-geo = ["odc-geo"]
tests = [
"rasterio",
"dask",
"xarray",
"cartopy>=0.20.0",
"pillow",
"matplotlib",
"scipy",
"zarr",
"pytest-lazy-fixtures",
"shapely",
"odc-geo",
]
all = [
"pyresample[numexpr,quicklook,rasterio,dask,cf,gradient_search,xarray_bilinear,odc-geo,tests]",
]

[project.entry-points."pyresample.resamplers"]
nearest = "pyresample.future.resamplers.nearest:KDTreeNearestXarrayResampler"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.targets.sdist]
include = [
"pyresample/",
"docs/",
"LICENSE.txt",
"README.md",
"CHANGELOG.md",
]


[tool.hatch.build.targets.wheel]
packages = ["pyresample"]

# Required by hatch-cython's internal use of setuptools build_ext
[tool.setuptools]
packages = ["pyresample"]

[tool.hatch.build.targets.wheel.hooks.cython]
dependencies = ["hatch-cython"]

[tool.hatch.build.targets.wheel.hooks.cython.options]
include_numpy = true
compile_py = false
directives = { language_level = 3, freethreading_compatible = true }
define_macros = [["NPY_NO_DEPRECATED_API", "NPY_1_25_API_VERSION"]]
compile_args = [
{ platforms = ["linux", "darwin", "freebsd"], arg = "-O3" },
{ platforms = ["linux", "darwin", "freebsd"], arg = "-Wno-unused-function" },
Comment on lines +97 to +98
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 lines can't be combined?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that hatch-cython wants them separate

]

[tool.ruff]
line-length = 120
exclude = ["versioneer.py", "pyresample/version.py"]

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
Expand Down Expand Up @@ -37,13 +132,6 @@ 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"
Expand All @@ -54,4 +142,8 @@ line_length = 120

[tool.coverage.run]
relative_files = true
omit = ["pyresample/version.py", "versioneer.py"]

[tool.uv.workspace]
members = [
".",
]
7 changes: 3 additions & 4 deletions pyresample/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""Pyresample package for geographic data resampling and related utilities."""

import os
from importlib.metadata import version as _metadata_version

# isort: off
# avoid circular imports as config is likely imported by below modules
Expand Down Expand Up @@ -54,10 +55,8 @@
LegacyAreaDefinition = AreaDefinition
LegacySwathDefinition = SwathDefinition

from .version import get_versions # noqa

__all__ = ['grid', 'image', 'kd_tree', 'utils', 'plot', 'geo_filter', 'geometry', 'CHUNK_SIZE',
'load_area', 'create_area_def', 'get_area_def', 'parse_area_file', 'convert_def_to_yaml']

__version__ = get_versions()['version']
del get_versions
__version__ = _metadata_version("pyresample")
del _metadata_version
3 changes: 3 additions & 0 deletions pyresample/ewa/_fornav.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# distutils: language = c++
# distutils: sources = pyresample/ewa/_fornav_templates.cpp
# distutils: depends = pyresample/ewa/_fornav_templates.h

# Copyright (c) 2016

Expand Down
Loading
Loading