diff --git a/.ci_support/linux_64_numpy1.22python3.10.____cpython.yaml b/.ci_support/linux_64_numpy1.22python3.10.____cpython.yaml index 77d001c..f82ad42 100644 --- a/.ci_support/linux_64_numpy1.22python3.10.____cpython.yaml +++ b/.ci_support/linux_64_numpy1.22python3.10.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.10.* *_cpython target_platform: diff --git a/.ci_support/linux_64_numpy1.22python3.9.____cpython.yaml b/.ci_support/linux_64_numpy1.22python3.9.____cpython.yaml index d1ad1f1..b93aa6a 100644 --- a/.ci_support/linux_64_numpy1.22python3.9.____cpython.yaml +++ b/.ci_support/linux_64_numpy1.22python3.9.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.9.* *_cpython target_platform: diff --git a/.ci_support/linux_64_numpy1.23python3.11.____cpython.yaml b/.ci_support/linux_64_numpy1.23python3.11.____cpython.yaml index 9521209..d227c9e 100644 --- a/.ci_support/linux_64_numpy1.23python3.11.____cpython.yaml +++ b/.ci_support/linux_64_numpy1.23python3.11.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.11.* *_cpython target_platform: diff --git a/.ci_support/linux_64_numpy1.26python3.12.____cpython.yaml b/.ci_support/linux_64_numpy1.26python3.12.____cpython.yaml index 2c9c117..125c276 100644 --- a/.ci_support/linux_64_numpy1.26python3.12.____cpython.yaml +++ b/.ci_support/linux_64_numpy1.26python3.12.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.12.* *_cpython target_platform: diff --git a/.ci_support/linux_64_numpy2python3.13.____cp313.yaml b/.ci_support/linux_64_numpy2python3.13.____cp313.yaml index 5e5eae9..edf5de4 100644 --- a/.ci_support/linux_64_numpy2python3.13.____cp313.yaml +++ b/.ci_support/linux_64_numpy2python3.13.____cp313.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.13.* *_cp313 target_platform: diff --git a/.ci_support/linux_aarch64_numpy1.22python3.10.____cpython.yaml b/.ci_support/linux_aarch64_numpy1.22python3.10.____cpython.yaml index 213cbbb..a5bfd56 100644 --- a/.ci_support/linux_aarch64_numpy1.22python3.10.____cpython.yaml +++ b/.ci_support/linux_aarch64_numpy1.22python3.10.____cpython.yaml @@ -25,7 +25,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.10.* *_cpython target_platform: diff --git a/.ci_support/linux_aarch64_numpy1.22python3.9.____cpython.yaml b/.ci_support/linux_aarch64_numpy1.22python3.9.____cpython.yaml index 24b1be7..d0b04a7 100644 --- a/.ci_support/linux_aarch64_numpy1.22python3.9.____cpython.yaml +++ b/.ci_support/linux_aarch64_numpy1.22python3.9.____cpython.yaml @@ -25,7 +25,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.9.* *_cpython target_platform: diff --git a/.ci_support/linux_aarch64_numpy1.23python3.11.____cpython.yaml b/.ci_support/linux_aarch64_numpy1.23python3.11.____cpython.yaml index 2614249..1d9aa51 100644 --- a/.ci_support/linux_aarch64_numpy1.23python3.11.____cpython.yaml +++ b/.ci_support/linux_aarch64_numpy1.23python3.11.____cpython.yaml @@ -25,7 +25,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.11.* *_cpython target_platform: diff --git a/.ci_support/linux_aarch64_numpy1.26python3.12.____cpython.yaml b/.ci_support/linux_aarch64_numpy1.26python3.12.____cpython.yaml index 82e778f..266a684 100644 --- a/.ci_support/linux_aarch64_numpy1.26python3.12.____cpython.yaml +++ b/.ci_support/linux_aarch64_numpy1.26python3.12.____cpython.yaml @@ -25,7 +25,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.12.* *_cpython target_platform: diff --git a/.ci_support/linux_aarch64_numpy2python3.13.____cp313.yaml b/.ci_support/linux_aarch64_numpy2python3.13.____cp313.yaml index fecd7ab..080beed 100644 --- a/.ci_support/linux_aarch64_numpy2python3.13.____cp313.yaml +++ b/.ci_support/linux_aarch64_numpy2python3.13.____cp313.yaml @@ -25,7 +25,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.13.* *_cp313 target_platform: diff --git a/.ci_support/linux_ppc64le_numpy1.22python3.10.____cpython.yaml b/.ci_support/linux_ppc64le_numpy1.22python3.10.____cpython.yaml index fd06204..ec9095c 100644 --- a/.ci_support/linux_ppc64le_numpy1.22python3.10.____cpython.yaml +++ b/.ci_support/linux_ppc64le_numpy1.22python3.10.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.10.* *_cpython target_platform: diff --git a/.ci_support/linux_ppc64le_numpy1.22python3.9.____cpython.yaml b/.ci_support/linux_ppc64le_numpy1.22python3.9.____cpython.yaml index 20e2563..e469264 100644 --- a/.ci_support/linux_ppc64le_numpy1.22python3.9.____cpython.yaml +++ b/.ci_support/linux_ppc64le_numpy1.22python3.9.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.9.* *_cpython target_platform: diff --git a/.ci_support/linux_ppc64le_numpy1.23python3.11.____cpython.yaml b/.ci_support/linux_ppc64le_numpy1.23python3.11.____cpython.yaml index 5a0d398..d870a78 100644 --- a/.ci_support/linux_ppc64le_numpy1.23python3.11.____cpython.yaml +++ b/.ci_support/linux_ppc64le_numpy1.23python3.11.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.11.* *_cpython target_platform: diff --git a/.ci_support/linux_ppc64le_numpy1.26python3.12.____cpython.yaml b/.ci_support/linux_ppc64le_numpy1.26python3.12.____cpython.yaml index a94fa37..926ae87 100644 --- a/.ci_support/linux_ppc64le_numpy1.26python3.12.____cpython.yaml +++ b/.ci_support/linux_ppc64le_numpy1.26python3.12.____cpython.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.12.* *_cpython target_platform: diff --git a/.ci_support/linux_ppc64le_numpy2python3.13.____cp313.yaml b/.ci_support/linux_ppc64le_numpy2python3.13.____cp313.yaml index 0089421..285c7ac 100644 --- a/.ci_support/linux_ppc64le_numpy2python3.13.____cp313.yaml +++ b/.ci_support/linux_ppc64le_numpy2python3.13.____cp313.yaml @@ -21,7 +21,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.13.* *_cp313 target_platform: diff --git a/.ci_support/migrations/proj95.yaml b/.ci_support/migrations/proj95.yaml new file mode 100644 index 0000000..1bc6042 --- /dev/null +++ b/.ci_support/migrations/proj95.yaml @@ -0,0 +1,8 @@ +__migrator: + build_number: 1 + commit_message: Rebuild for proj 9.5 + kind: version + migration_number: 1 +migrator_ts: 1726500049.2640333 +proj: +- '9.5' diff --git a/.ci_support/osx_64_numpy1.22python3.10.____cpython.yaml b/.ci_support/osx_64_numpy1.22python3.10.____cpython.yaml index 2edcbaa..4d4e4c0 100644 --- a/.ci_support/osx_64_numpy1.22python3.10.____cpython.yaml +++ b/.ci_support/osx_64_numpy1.22python3.10.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.10.* *_cpython target_platform: diff --git a/.ci_support/osx_64_numpy1.22python3.9.____cpython.yaml b/.ci_support/osx_64_numpy1.22python3.9.____cpython.yaml index 6cb7122..ddafe74 100644 --- a/.ci_support/osx_64_numpy1.22python3.9.____cpython.yaml +++ b/.ci_support/osx_64_numpy1.22python3.9.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.9.* *_cpython target_platform: diff --git a/.ci_support/osx_64_numpy1.23python3.11.____cpython.yaml b/.ci_support/osx_64_numpy1.23python3.11.____cpython.yaml index 39b8984..0fc7ca3 100644 --- a/.ci_support/osx_64_numpy1.23python3.11.____cpython.yaml +++ b/.ci_support/osx_64_numpy1.23python3.11.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.11.* *_cpython target_platform: diff --git a/.ci_support/osx_64_numpy1.26python3.12.____cpython.yaml b/.ci_support/osx_64_numpy1.26python3.12.____cpython.yaml index 1326586..7b5b712 100644 --- a/.ci_support/osx_64_numpy1.26python3.12.____cpython.yaml +++ b/.ci_support/osx_64_numpy1.26python3.12.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.12.* *_cpython target_platform: diff --git a/.ci_support/osx_64_numpy2python3.13.____cp313.yaml b/.ci_support/osx_64_numpy2python3.13.____cp313.yaml index 1c2cc56..750eafd 100644 --- a/.ci_support/osx_64_numpy2python3.13.____cp313.yaml +++ b/.ci_support/osx_64_numpy2python3.13.____cp313.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.13.* *_cp313 target_platform: diff --git a/.ci_support/osx_arm64_numpy1.22python3.10.____cpython.yaml b/.ci_support/osx_arm64_numpy1.22python3.10.____cpython.yaml index c8804ae..f32d2db 100644 --- a/.ci_support/osx_arm64_numpy1.22python3.10.____cpython.yaml +++ b/.ci_support/osx_arm64_numpy1.22python3.10.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.10.* *_cpython target_platform: diff --git a/.ci_support/osx_arm64_numpy1.22python3.9.____cpython.yaml b/.ci_support/osx_arm64_numpy1.22python3.9.____cpython.yaml index 00d9e3d..351d3f1 100644 --- a/.ci_support/osx_arm64_numpy1.22python3.9.____cpython.yaml +++ b/.ci_support/osx_arm64_numpy1.22python3.9.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.9.* *_cpython target_platform: diff --git a/.ci_support/osx_arm64_numpy1.23python3.11.____cpython.yaml b/.ci_support/osx_arm64_numpy1.23python3.11.____cpython.yaml index c064ee5..1584f38 100644 --- a/.ci_support/osx_arm64_numpy1.23python3.11.____cpython.yaml +++ b/.ci_support/osx_arm64_numpy1.23python3.11.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.11.* *_cpython target_platform: diff --git a/.ci_support/osx_arm64_numpy1.26python3.12.____cpython.yaml b/.ci_support/osx_arm64_numpy1.26python3.12.____cpython.yaml index 0e09d03..bc216f6 100644 --- a/.ci_support/osx_arm64_numpy1.26python3.12.____cpython.yaml +++ b/.ci_support/osx_arm64_numpy1.26python3.12.____cpython.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.12.* *_cpython target_platform: diff --git a/.ci_support/osx_arm64_numpy2python3.13.____cp313.yaml b/.ci_support/osx_arm64_numpy2python3.13.____cp313.yaml index 2640f93..ec11458 100644 --- a/.ci_support/osx_arm64_numpy2python3.13.____cp313.yaml +++ b/.ci_support/osx_arm64_numpy2python3.13.____cp313.yaml @@ -23,7 +23,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.13.* *_cp313 target_platform: diff --git a/.ci_support/win_64_numpy1.22python3.10.____cpython.yaml b/.ci_support/win_64_numpy1.22python3.10.____cpython.yaml index 67fdc8a..1226d54 100644 --- a/.ci_support/win_64_numpy1.22python3.10.____cpython.yaml +++ b/.ci_support/win_64_numpy1.22python3.10.____cpython.yaml @@ -13,7 +13,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.10.* *_cpython target_platform: diff --git a/.ci_support/win_64_numpy1.22python3.9.____cpython.yaml b/.ci_support/win_64_numpy1.22python3.9.____cpython.yaml index 7aaa3bf..3ba530d 100644 --- a/.ci_support/win_64_numpy1.22python3.9.____cpython.yaml +++ b/.ci_support/win_64_numpy1.22python3.9.____cpython.yaml @@ -13,7 +13,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.9.* *_cpython target_platform: diff --git a/.ci_support/win_64_numpy1.23python3.11.____cpython.yaml b/.ci_support/win_64_numpy1.23python3.11.____cpython.yaml index 9b99cc6..bd061ce 100644 --- a/.ci_support/win_64_numpy1.23python3.11.____cpython.yaml +++ b/.ci_support/win_64_numpy1.23python3.11.____cpython.yaml @@ -13,7 +13,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.11.* *_cpython target_platform: diff --git a/.ci_support/win_64_numpy1.26python3.12.____cpython.yaml b/.ci_support/win_64_numpy1.26python3.12.____cpython.yaml index 8199c55..1189aab 100644 --- a/.ci_support/win_64_numpy1.26python3.12.____cpython.yaml +++ b/.ci_support/win_64_numpy1.26python3.12.____cpython.yaml @@ -13,7 +13,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.12.* *_cpython target_platform: diff --git a/.ci_support/win_64_numpy2python3.13.____cp313.yaml b/.ci_support/win_64_numpy2python3.13.____cp313.yaml index fd9b0af..6060e31 100644 --- a/.ci_support/win_64_numpy2python3.13.____cp313.yaml +++ b/.ci_support/win_64_numpy2python3.13.____cp313.yaml @@ -13,7 +13,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x proj: -- '9.4' +- '9.5' python: - 3.13.* *_cp313 target_platform: diff --git a/recipe/0004-fix-transformer-area-of-interest-tests.patch b/recipe/0004-fix-transformer-area-of-interest-tests.patch new file mode 100644 index 0000000..bc3c051 --- /dev/null +++ b/recipe/0004-fix-transformer-area-of-interest-tests.patch @@ -0,0 +1,31 @@ +From cdde16538b85cca3887478a1ffc30269a083538e Mon Sep 17 00:00:00 2001 +From: snowman2 +Date: Fri, 30 Aug 2024 07:30:06 -0500 +Subject: [PATCH] TST: Fix transformer area of interest tests + +--- + test/test_transformer.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/test_transformer.py b/test/test_transformer.py +index ed1f231b..629a936a 100644 +--- a/test/test_transformer.py ++++ b/test/test_transformer.py +@@ -745,7 +745,7 @@ def test_transformer__area_of_interest(): + transformer = Transformer.from_crs( + "EPSG:7789", + "EPSG:4936", +- area_of_interest=AreaOfInterest(-177.25, -44.64, -43.3, -175.54), ++ area_of_interest=AreaOfInterest(-177.25, -44.64, -175.54, -43.3), + ) + assert ( + transformer.description +@@ -757,7 +757,7 @@ def test_transformer_proj__area_of_interest(): + transformer = Transformer.from_proj( + "EPSG:7789", + "EPSG:4936", +- area_of_interest=AreaOfInterest(-177.25, -44.64, -43.3, -175.54), ++ area_of_interest=AreaOfInterest(-177.25, -44.64, -175.54, -43.3), + ) + assert ( + transformer.description diff --git a/recipe/0005-add-runtime-compiled-proj-versions.patch b/recipe/0005-add-runtime-compiled-proj-versions.patch new file mode 100644 index 0000000..e55cce7 --- /dev/null +++ b/recipe/0005-add-runtime-compiled-proj-versions.patch @@ -0,0 +1,211 @@ +From 85a72424c2f15e976d98c5428dde2282cc356b76 Mon Sep 17 00:00:00 2001 +From: snowman2 +Date: Fri, 2 Aug 2024 23:39:33 -0500 +Subject: [PATCH] ENH: Add runtime & compiled PROJ versions + +--- + .pylintrc | 1 + + docs/history.rst | 1 + + pyproj/__init__.py | 12 +++++++++--- + pyproj/_show_versions.py | 3 ++- + pyproj/_transformer.pyi | 3 --- + pyproj/_transformer.pyx | 3 --- + pyproj/_version.pyi | 4 ++++ + pyproj/_version.pyx | 7 +++++++ + pyproj/proj.pxi | 14 ++++++++++++++ + pyproj/transformer.py | 1 - + setup.py | 1 + + test/test_cli.py | 3 ++- + test/test_show_versions.py | 6 ++++-- + 13 files changed, 45 insertions(+), 14 deletions(-) + create mode 100644 pyproj/_version.pyi + create mode 100644 pyproj/_version.pyx + +diff --git a/pyproj/__init__.py b/pyproj/__init__.py +index 95ac2f46b..d448b8423 100644 +--- a/pyproj/__init__.py ++++ b/pyproj/__init__.py +@@ -38,6 +38,12 @@ + from pyproj._show_versions import ( # noqa: F401 pylint: disable=unused-import + show_versions, + ) ++from pyproj._version import ( # noqa: F401 pylint: disable=unused-import ++ PROJ_COMPILED_VERSION, ++ PROJ_COMPILED_VERSION_STR, ++ PROJ_VERSION, ++ PROJ_VERSION_STR, ++) + from pyproj.crs import CRS # noqa: F401 pylint: disable=unused-import + from pyproj.database import ( # noqa: F401 pylint: disable=unused-import + get_authorities, +@@ -62,7 +68,6 @@ + from pyproj.transformer import ( # noqa: F401 pylint: disable=unused-import + Transformer, + itransform, +- proj_version_str, + transform, + ) + +@@ -82,8 +87,9 @@ + "get_units_map", + "show_versions", + ] +-__proj_version__ = proj_version_str +- ++__proj_version__ = PROJ_VERSION_STR ++proj_version_str = PROJ_VERSION_STR # pylint: disable=invalid-name ++__proj_compiled_version__ = PROJ_COMPILED_VERSION_STR + + try: + _pyproj_global_context_initialize() +diff --git a/pyproj/_show_versions.py b/pyproj/_show_versions.py +index 13cb9f589..1fe3a7f3c 100644 +--- a/pyproj/_show_versions.py ++++ b/pyproj/_show_versions.py +@@ -46,7 +46,8 @@ def _get_proj_info(): + + blob = [ + ("pyproj", pyproj.__version__), +- ("PROJ", pyproj.__proj_version__), ++ ("PROJ (runtime)", pyproj.__proj_version__), ++ ("PROJ (compiled)", pyproj.__proj_compiled_version__), + ("data dir", data_dir), + ("user_data_dir", pyproj.datadir.get_user_data_dir()), + ("PROJ DATA (recommended version)", get_database_metadata("PROJ_DATA.VERSION")), +diff --git a/pyproj/_transformer.pyi b/pyproj/_transformer.pyi +index 5a90b6e2b..21d5960e0 100644 +--- a/pyproj/_transformer.pyi ++++ b/pyproj/_transformer.pyi +@@ -5,9 +5,6 @@ from typing import Any, NamedTuple + from pyproj._crs import _CRS, AreaOfUse, Base, CoordinateOperation + from pyproj.enums import ProjVersion, TransformDirection + +-proj_version_str: str +-PROJ_VERSION: tuple[int, int, int] +- + class AreaOfInterest(NamedTuple): + west_lon_degree: float + south_lat_degree: float +diff --git a/pyproj/_transformer.pyx b/pyproj/_transformer.pyx +index 87d7b71c2..149e4d701 100644 +--- a/pyproj/_transformer.pyx ++++ b/pyproj/_transformer.pyx +@@ -25,9 +25,6 @@ from pyproj.aoi import AreaOfInterest + from pyproj.enums import ProjVersion, TransformDirection, WktVersion + from pyproj.exceptions import ProjError + +-# version number string for PROJ +-proj_version_str = f"{PROJ_VERSION_MAJOR}.{PROJ_VERSION_MINOR}.{PROJ_VERSION_PATCH}" +-PROJ_VERSION = (PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH) + _AUTH_CODE_RE = re.compile(r"(?P\w+)\:(?P\w+)") + + +diff --git a/pyproj/_version.pyi b/pyproj/_version.pyi +new file mode 100644 +index 000000000..e540549f5 +--- /dev/null ++++ b/pyproj/_version.pyi +@@ -0,0 +1,4 @@ ++PROJ_VERSION: tuple[int, int, int] ++PROJ_VERSION_STR: str ++PROJ_COMPILED_VERSION: tuple[int, int, int] ++PROJ_COMPILED_VERSION_STR: str +diff --git a/pyproj/_version.pyx b/pyproj/_version.pyx +new file mode 100644 +index 000000000..58523a524 +--- /dev/null ++++ b/pyproj/_version.pyx +@@ -0,0 +1,7 @@ ++include "proj.pxi" ++ ++cdef PJ_INFO _PROJ_INFO = proj_info() ++PROJ_VERSION = (_PROJ_INFO.major, _PROJ_INFO.minor, _PROJ_INFO.patch) ++PROJ_VERSION_STR = f"{_PROJ_INFO.major}.{_PROJ_INFO.minor}.{_PROJ_INFO.patch}" ++PROJ_COMPILED_VERSION = (PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH) ++PROJ_COMPILED_VERSION_STR = f"{PROJ_VERSION_MAJOR}.{PROJ_VERSION_MINOR}.{PROJ_VERSION_PATCH}" +diff --git a/pyproj/proj.pxi b/pyproj/proj.pxi +index cc42ad42b..d4db59d80 100644 +--- a/pyproj/proj.pxi ++++ b/pyproj/proj.pxi +@@ -35,6 +35,20 @@ cdef extern from "proj.h" nogil: + PJ *proj_create (PJ_CONTEXT *ctx, const char *definition) + PJ *proj_normalize_for_visualization(PJ_CONTEXT *ctx, const PJ* obj) + ++ ctypedef struct PJ_INFO: ++ int major # Major release number ++ int minor # Minor release number ++ int patch # Patch level ++ const char *release # Release info. Version + date ++ const char *version # Full version number ++ const char *searchpath # Paths where init and grid files are ++ # looked for. Paths are separated by ++ # semi-colons on Windows, and colons ++ # on non-Windows platforms. ++ const char *const *paths ++ size_t path_count ++ PJ_INFO proj_info() ++ + ctypedef struct PJ_PROJ_INFO: + const char *id + const char *description +diff --git a/pyproj/transformer.py b/pyproj/transformer.py +index ffa680c89..e3d0775e2 100644 +--- a/pyproj/transformer.py ++++ b/pyproj/transformer.py +@@ -27,7 +27,6 @@ + AreaOfInterest, + _Transformer, + _TransformerGroup, +- proj_version_str, + ) + from pyproj.datadir import get_user_data_dir + from pyproj.enums import ProjVersion, TransformDirection, WktVersion +diff --git a/setup.py b/setup.py +index d99717d96..9987cff5e 100644 +--- a/setup.py ++++ b/setup.py +@@ -212,6 +212,7 @@ def get_extension_modules(): + Extension("pyproj.list", ["pyproj/list.pyx"], **ext_options), + Extension("pyproj._network", ["pyproj/_network.pyx"], **ext_options), + Extension("pyproj._sync", ["pyproj/_sync.pyx"], **ext_options), ++ Extension("pyproj._version", ["pyproj/_version.pyx"], **ext_options), + ], + quiet=True, + compile_time_env={ +diff --git a/test/test_cli.py b/test/test_cli.py +index 7a696de75..4f249ba3d 100644 +--- a/test/test_cli.py ++++ b/test/test_cli.py +@@ -39,7 +39,8 @@ def test_main__verbose(input_command, option, tmpdir): + input_command + [option], stderr=subprocess.STDOUT + ).decode("utf-8") + assert "pyproj:" in output +- assert "PROJ:" in output ++ assert "PROJ (compiled):" in output ++ assert "PROJ (runtime):" in output + assert "data dir" in output + assert "user_data_dir" in output + assert "System" in output +diff --git a/test/test_show_versions.py b/test/test_show_versions.py +index 353fae175..841cf948f 100644 +--- a/test/test_show_versions.py ++++ b/test/test_show_versions.py +@@ -9,7 +9,8 @@ + def test_get_proj_info(): + pyproj_info = _get_proj_info() + assert "pyproj" in pyproj_info +- assert "PROJ" in pyproj_info ++ assert "PROJ (runtime)" in pyproj_info ++ assert "PROJ (compiled)" in pyproj_info + assert "data dir" in pyproj_info + assert "user_data_dir" in pyproj_info + assert "PROJ DATA (recommended version)" in pyproj_info +@@ -41,6 +42,7 @@ def test_show_versions_with_proj(capsys): + out, err = capsys.readouterr() + assert "System" in out + assert "python" in out +- assert "PROJ" in out ++ assert "PROJ (runtime)" in out ++ assert "PROJ (compiled)" in out + assert "data dir" in out + assert "Python deps" in out diff --git a/recipe/0006-handle-changes-to-HotineObliqueMercatorBConversion.patch b/recipe/0006-handle-changes-to-HotineObliqueMercatorBConversion.patch new file mode 100644 index 0000000..82c50b7 --- /dev/null +++ b/recipe/0006-handle-changes-to-HotineObliqueMercatorBConversion.patch @@ -0,0 +1,328 @@ +From 4a3c89f2ffbe83d3e6045d9f93090bfebf3488dd Mon Sep 17 00:00:00 2001 +From: snowman2 +Date: Mon, 26 Aug 2024 23:23:36 -0500 +Subject: [PATCH] BUG: Handle changes to HotineObliqueMercatorBConversion + +--- + docs/history.rst | 1 + + pyproj/crs/_cf1x8.py | 16 +++- + pyproj/crs/coordinate_operation.py | 68 ++++++++++++++--- + test/conftest.py | 1 + + test/crs/test_crs_coordinate_operation.py | 89 +++++++++++++++++++++-- + 5 files changed, 155 insertions(+), 20 deletions(-) + +diff --git a/pyproj/crs/_cf1x8.py b/pyproj/crs/_cf1x8.py +index 51929c601..46a2ce5b0 100644 +--- a/pyproj/crs/_cf1x8.py ++++ b/pyproj/crs/_cf1x8.py +@@ -233,9 +233,9 @@ def _oblique_mercator(cf_params): + return HotineObliqueMercatorBConversion( + latitude_projection_centre=cf_params["latitude_of_projection_origin"], + longitude_projection_centre=cf_params["longitude_of_projection_origin"], +- azimuth_initial_line=cf_params["azimuth_of_central_line"], ++ azimuth_projection_centre=cf_params["azimuth_of_central_line"], + angle_from_rectified_to_skew_grid=0.0, +- scale_factor_on_initial_line=cf_params.get( ++ scale_factor_projection_centre=cf_params.get( + "scale_factor_at_projection_origin", 1.0 + ), + easting_projection_centre=cf_params.get("false_easting", 0.0), +@@ -515,12 +515,20 @@ def _oblique_mercator__to_cf(conversion): + warnings.warn( + "angle from rectified to skew grid parameter lost in conversion to CF" + ) ++ try: ++ azimuth_of_central_line = params["azimuth_of_initial_line"] ++ except KeyError: ++ azimuth_of_central_line = params["azimuth_at_projection_centre"] ++ try: ++ scale_factor_at_projection_origin = params["scale_factor_on_initial_line"] ++ except KeyError: ++ scale_factor_at_projection_origin = params["scale_factor_at_projection_centre"] + return { + "grid_mapping_name": "oblique_mercator", + "latitude_of_projection_origin": params["latitude_of_projection_centre"], + "longitude_of_projection_origin": params["longitude_of_projection_centre"], +- "azimuth_of_central_line": params["azimuth_of_initial_line"], +- "scale_factor_at_projection_origin": params["scale_factor_on_initial_line"], ++ "azimuth_of_central_line": azimuth_of_central_line, ++ "scale_factor_at_projection_origin": scale_factor_at_projection_origin, + "false_easting": params["easting_at_projection_centre"], + "false_northing": params["northing_at_projection_centre"], + } +diff --git a/pyproj/crs/coordinate_operation.py b/pyproj/crs/coordinate_operation.py +index bc04b17b9..e3408c77c 100644 +--- a/pyproj/crs/coordinate_operation.py ++++ b/pyproj/crs/coordinate_operation.py +@@ -7,9 +7,10 @@ + + # pylint: disable=too-many-lines + import warnings +-from typing import Any ++from typing import Any, Optional + + from pyproj._crs import CoordinateOperation ++from pyproj._version import PROJ_VERSION + from pyproj.exceptions import CRSError + + +@@ -759,6 +760,7 @@ def __new__( + class HotineObliqueMercatorBConversion(CoordinateOperation): + """ + .. versionadded:: 2.5.0 ++ .. versionadded:: 3.7.0 azimuth_projection_centre, scale_factor_projection_centre + + Class for constructing the Hotine Oblique Mercator (variant B) conversion. + +@@ -769,11 +771,13 @@ def __new__( + cls, + latitude_projection_centre: float, + longitude_projection_centre: float, +- azimuth_initial_line: float, + angle_from_rectified_to_skew_grid: float, +- scale_factor_on_initial_line: float = 1.0, + easting_projection_centre: float = 0.0, + northing_projection_centre: float = 0.0, ++ azimuth_projection_centre: Optional[float] = None, ++ scale_factor_projection_centre: Optional[float] = None, ++ azimuth_initial_line: Optional[float] = None, ++ scale_factor_on_initial_line: Optional[float] = None, + ): + """ + Parameters +@@ -782,17 +786,55 @@ def __new__( + Latitude of projection centre (lat_0). + longitude_projection_centre: float + Longitude of projection centre (lonc). +- azimuth_initial_line: float ++ azimuth_projection_centre: float + Azimuth of initial line (alpha). + angle_from_rectified_to_skew_grid: float + Angle from Rectified to Skew Grid (gamma). +- scale_factor_on_initial_line: float, default=1.0 ++ scale_factor_projection_centre: float, default=1.0 + Scale factor on initial line (k or k_0). + easting_projection_centre: float, default=0.0 + Easting at projection centre (x_0). + northing_projection_centre: float, default=0.0 + Northing at projection centre (y_0). ++ azimuth_initial_line: float ++ Deprecated alias for azimuth_projection_centre, ++ scale_factor_on_initial_line: float ++ Deprecated alias for scale_factor_projection_centre. + """ ++ if scale_factor_on_initial_line is not None: ++ if scale_factor_projection_centre is not None: ++ raise ValueError( ++ "scale_factor_projection_centre and scale_factor_on_initial_line " ++ "cannot be provided together." ++ ) ++ warnings.warn( ++ "scale_factor_on_initial_line is deprecated. " ++ "Use scale_factor_projection_centre instead.", ++ FutureWarning, ++ stacklevel=2, ++ ) ++ scale_factor_projection_centre = scale_factor_on_initial_line ++ elif scale_factor_projection_centre is None: ++ scale_factor_projection_centre = 1.0 ++ ++ if azimuth_projection_centre is None and azimuth_initial_line is None: ++ raise ValueError( ++ "azimuth_projection_centre or azimuth_initial_line must be provided." ++ ) ++ if azimuth_initial_line is not None: ++ if azimuth_projection_centre is not None: ++ raise ValueError( ++ "azimuth_projection_centre and azimuth_initial_line cannot be " ++ "provided together." ++ ) ++ warnings.warn( ++ "azimuth_initial_line is deprecated. " ++ "Use azimuth_projection_centre instead.", ++ FutureWarning, ++ stacklevel=2, ++ ) ++ azimuth_projection_centre = azimuth_initial_line ++ + omerc_json = { + "$schema": "https://proj.org/schemas/v0.2/projjson.schema.json", + "type": "Conversion", +@@ -815,8 +857,12 @@ def __new__( + "id": {"authority": "EPSG", "code": 8812}, + }, + { +- "name": "Azimuth of initial line", +- "value": azimuth_initial_line, ++ "name": ( ++ "Azimuth at projection centre" ++ if PROJ_VERSION >= (9, 5, 0) ++ else "Azimuth of initial line" ++ ), ++ "value": azimuth_projection_centre, + "unit": "degree", + "id": {"authority": "EPSG", "code": 8813}, + }, +@@ -827,8 +873,12 @@ def __new__( + "id": {"authority": "EPSG", "code": 8814}, + }, + { +- "name": "Scale factor on initial line", +- "value": scale_factor_on_initial_line, ++ "name": ( ++ "Scale factor at projection centre" ++ if PROJ_VERSION >= (9, 5, 0) ++ else "Scale factor on initial line" ++ ), ++ "value": scale_factor_projection_centre, + "unit": "unity", + "id": {"authority": "EPSG", "code": 8815}, + }, +diff --git a/test/conftest.py b/test/conftest.py +index ac9ecebee..0abbc6c01 100644 +--- a/test/conftest.py ++++ b/test/conftest.py +@@ -15,6 +15,7 @@ + PROJ_GTE_921 = PROJ_LOOSE_VERSION >= version.parse("9.2.1") + PROJ_GTE_93 = PROJ_LOOSE_VERSION >= version.parse("9.3.0") + PROJ_GTE_941 = PROJ_LOOSE_VERSION >= version.parse("9.4.1") ++PROJ_GTE_95 = PROJ_LOOSE_VERSION >= version.parse("9.5.0") + + + def unset_data_dir(): +diff --git a/test/crs/test_crs_coordinate_operation.py b/test/crs/test_crs_coordinate_operation.py +index b28fa10fc..0b9692253 100644 +--- a/test/crs/test_crs_coordinate_operation.py ++++ b/test/crs/test_crs_coordinate_operation.py +@@ -29,6 +29,7 @@ + VerticalPerspectiveConversion, + ) + from pyproj.exceptions import CRSError ++from test.conftest import PROJ_GTE_95 + + + def _to_dict(operation): +@@ -340,7 +341,7 @@ def test_hotline_oblique_mercator_b_operation__defaults(): + hop = HotineObliqueMercatorBConversion( + latitude_projection_centre=0, + longitude_projection_centre=0, +- azimuth_initial_line=0, ++ azimuth_projection_centre=0, + angle_from_rectified_to_skew_grid=0, + ) + assert hop.name == "unknown" +@@ -348,9 +349,15 @@ def test_hotline_oblique_mercator_b_operation__defaults(): + assert _to_dict(hop) == { + "Latitude of projection centre": 0.0, + "Longitude of projection centre": 0.0, +- "Azimuth of initial line": 0.0, ++ ( ++ "Azimuth at projection centre" if PROJ_GTE_95 else "Azimuth of initial line" ++ ): 0.0, + "Angle from Rectified to Skew Grid": 0.0, +- "Scale factor on initial line": 1.0, ++ ( ++ "Scale factor at projection centre" ++ if PROJ_GTE_95 ++ else "Scale factor on initial line" ++ ): 1.0, + "Easting at projection centre": 0.0, + "Northing at projection centre": 0.0, + } +@@ -360,9 +367,9 @@ def test_hotline_oblique_mercator_b_operation(): + hop = HotineObliqueMercatorBConversion( + latitude_projection_centre=1, + longitude_projection_centre=2, +- azimuth_initial_line=3, ++ azimuth_projection_centre=3, + angle_from_rectified_to_skew_grid=4, +- scale_factor_on_initial_line=0.5, ++ scale_factor_projection_centre=0.5, + easting_projection_centre=6, + northing_projection_centre=7, + ) +@@ -371,14 +378,82 @@ def test_hotline_oblique_mercator_b_operation(): + assert _to_dict(hop) == { + "Latitude of projection centre": 1.0, + "Longitude of projection centre": 2.0, +- "Azimuth of initial line": 3.0, ++ ( ++ "Azimuth at projection centre" if PROJ_GTE_95 else "Azimuth of initial line" ++ ): 3.0, + "Angle from Rectified to Skew Grid": 4.0, +- "Scale factor on initial line": 0.5, ++ ( ++ "Scale factor at projection centre" ++ if PROJ_GTE_95 ++ else "Scale factor on initial line" ++ ): 0.5, + "Easting at projection centre": 6.0, + "Northing at projection centre": 7.0, + } + + ++def test_hotline_oblique_mercator_b_operation__deprecated_kwargs(): ++ with pytest.warns(FutureWarning): ++ hop = HotineObliqueMercatorBConversion( ++ latitude_projection_centre=1, ++ longitude_projection_centre=2, ++ azimuth_initial_line=3, ++ angle_from_rectified_to_skew_grid=4, ++ scale_factor_on_initial_line=0.5, ++ easting_projection_centre=6, ++ northing_projection_centre=7, ++ ) ++ assert hop.name == "unknown" ++ assert hop.method_name == "Hotine Oblique Mercator (variant B)" ++ assert _to_dict(hop) == { ++ "Latitude of projection centre": 1.0, ++ "Longitude of projection centre": 2.0, ++ ( ++ "Azimuth at projection centre" if PROJ_GTE_95 else "Azimuth of initial line" ++ ): 3.0, ++ "Angle from Rectified to Skew Grid": 4.0, ++ ( ++ "Scale factor at projection centre" ++ if PROJ_GTE_95 ++ else "Scale factor on initial line" ++ ): 0.5, ++ "Easting at projection centre": 6.0, ++ "Northing at projection centre": 7.0, ++ } ++ ++ ++def test_hotline_oblique_mercator_b_operation__missing_azimuth(): ++ with pytest.raises(ValueError): ++ HotineObliqueMercatorBConversion( ++ latitude_projection_centre=1, ++ longitude_projection_centre=2, ++ angle_from_rectified_to_skew_grid=4, ++ ) ++ ++ ++def test_hotline_oblique_mercator_b_operation__duplicate_azimuth(): ++ with pytest.raises(ValueError): ++ HotineObliqueMercatorBConversion( ++ latitude_projection_centre=1, ++ longitude_projection_centre=2, ++ angle_from_rectified_to_skew_grid=4, ++ azimuth_initial_line=3, ++ azimuth_projection_centre=3, ++ ) ++ ++ ++def test_hotline_oblique_mercator_b_operation__duplicate_scale_factor(): ++ with pytest.raises(ValueError): ++ HotineObliqueMercatorBConversion( ++ latitude_projection_centre=1, ++ longitude_projection_centre=2, ++ angle_from_rectified_to_skew_grid=4, ++ azimuth_projection_centre=3, ++ scale_factor_on_initial_line=0.5, ++ scale_factor_projection_centre=0.5, ++ ) ++ ++ + def test_orthographic_operation__defaults(): + aeop = OrthographicConversion() + assert aeop.name == "unknown" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8054205..2428ec5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,9 +11,12 @@ source: - 0001-azimuthal-equidistant.patch - 0002-test-coordinate-operation-grids-alternative-grid-name.patch - 0003-test-datum-ensemble-allowing-new-members.patch + - 0004-fix-transformer-area-of-interest-tests.patch + - 0005-add-runtime-compiled-proj-versions.patch + - 0006-handle-changes-to-HotineObliqueMercatorBConversion.patch build: - number: 9 + number: 10 skip: true # [py<39] entry_points: - pyproj=pyproj.__main__:main