Apologies for not following the bug report template closely but I think that this issue is trivial enough to be explained in a few sentences.
However, PRO 9.8.1 has been released with a revert of some EPSG database changes. That partly restores pre-9.8.0 PROJ behavior, and pyproj tests need to be adjusted for that.
The following crude patch serves well as an band-aid. Feel free to rework it to your standards. Thanks!
From b266041a437138c81ebfd565175143f2714e7911 Mon Sep 17 00:00:00 2001
From: Libor Pechacek <lpechacek@gmx.com>
Date: Sun, 12 Apr 2026 15:29:04 +0200
Subject: [PATCH] TST Fix tests after PROJ 9.8.1 EPSG database revert
PROJ reverted EPSG database from EPSG 12.054 to 12.029 with v9.8.1, so
we need to re-adjust the test for the previous behavior.
---
test/conftest.py | 1 +
test/crs/test_crs.py | 3 ++-
test/test_transformer.py | 13 +++++++------
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/test/conftest.py b/test/conftest.py
index 00a85375f014..17384b9b9798 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -16,6 +16,7 @@ PROJ_GTE_941 = PROJ_LOOSE_VERSION >= version.parse("9.4.1")
PROJ_GTE_95 = PROJ_LOOSE_VERSION >= version.parse("9.5.0")
PROJ_GTE_971 = PROJ_LOOSE_VERSION >= version.parse("9.7.1")
PROJ_GTE_980 = PROJ_LOOSE_VERSION >= version.parse("9.8.0")
+PROJ_GTE_981 = PROJ_LOOSE_VERSION >= version.parse("9.8.1")
def unset_data_dir():
diff --git a/test/crs/test_crs.py b/test/crs/test_crs.py
index 1eefb4cc6de6..4a077c15f2e4 100644
--- a/test/crs/test_crs.py
+++ b/test/crs/test_crs.py
@@ -24,6 +24,7 @@ from test.conftest import (
PROJ_GTE_941,
PROJ_GTE_971,
PROJ_GTE_980,
+ PROJ_GTE_981,
assert_can_pickle,
grids_available,
)
@@ -1223,7 +1224,7 @@ def test_coordinate_operation__from_string():
co = CoordinateOperation.from_string("urn:ogc:def:coordinateOperation:EPSG::1671")
# PROJ 9.7.1+ renamed this operation from "RGF93 v1 to WGS 84 (1)"
# to "ETRS89-FRA [RGF93 v1] to WGS 84 (1)"
- if PROJ_GTE_980:
+ if PROJ_GTE_980 and not PROJ_GTE_981:
assert co.name == "ETRS89-FRA [RGF93 v1] to WGS 84 (1)"
else:
assert co.name == "RGF93 v1 to WGS 84 (1)"
diff --git a/test/test_transformer.py b/test/test_transformer.py
index a88752184c9b..6f2adde7f34f 100644
--- a/test/test_transformer.py
+++ b/test/test_transformer.py
@@ -20,6 +20,7 @@ from pyproj.exceptions import ProjError
from pyproj.transformer import AreaOfInterest, TransformerGroup
from test.conftest import (
PROJ_GTE_980,
+ PROJ_GTE_981,
grids_available,
proj_env,
proj_network_env,
@@ -982,7 +983,7 @@ def test_transformer_group__get_transform_crs():
assert len(tg.transformers) == 3
else:
assert len(tg.transformers) == 2
- elif PROJ_GTE_980:
+ elif PROJ_GTE_980 and not PROJ_GTE_981:
# Newer proj includes additional transformations
assert len(tg.transformers) == 3
else:
@@ -1376,7 +1377,7 @@ def test_transformer_accuracy_filter():
def test_transformer_allow_ballpark_filter():
- if PROJ_GTE_980:
+ if PROJ_GTE_980 and not PROJ_GTE_981:
transformer = Transformer.from_crs(
"EPSG:4326", "EPSG:4258", authority="PROJ", allow_ballpark=False
)
@@ -1412,7 +1413,7 @@ def test_transformer_authority_filter():
def test_transformer_from_pipeline__input_types(input_string):
# PROJ 9.7.1+ renamed this operation from "RGF93 v1 to WGS 84 (1)"
# to "ETRS89-FRA [RGF93 v1] to WGS 84 (1)"
- if PROJ_GTE_980:
+ if PROJ_GTE_980 and not PROJ_GTE_981:
assert (
Transformer.from_pipeline(input_string).description
== "ETRS89-FRA [RGF93 v1] to WGS 84 (1)"
@@ -1440,7 +1441,7 @@ def test_transformer_from_pipeline__wkt_json(method_name):
method_name,
)()
).description
- if PROJ_GTE_980:
+ if PROJ_GTE_980 and not PROJ_GTE_981:
assert description == "ETRS89-FRA [RGF93 v1] to WGS 84 (1)"
else:
assert description == "RGF93 v1 to WGS 84 (1)"
@@ -1857,7 +1858,7 @@ def test_transformer_group_allow_ballpark_filter():
group = TransformerGroup(
"EPSG:4326", "EPSG:4258", authority="PROJ", allow_ballpark=False
)
- if PROJ_GTE_980:
+ if PROJ_GTE_980 and not PROJ_GTE_981:
assert len(group.transformers) == 1
assert all(
"Ballpark" not in transformer.description
@@ -1973,7 +1974,7 @@ def test_transformer_group_pivot_crs_integer_code():
def test_transformer_group_authority_filter():
group = TransformerGroup("EPSG:4326", "EPSG:4258", authority="PROJ")
- if PROJ_GTE_980:
+ if PROJ_GTE_980 and not PROJ_GTE_981:
assert len(group.transformers) == 2
else:
assert len(group.transformers) == 1
--
2.53.0
Apologies for not following the bug report template closely but I think that this issue is trivial enough to be explained in a few sentences.
Problem description
I'm packaging pyproj for openSUSE. The tests started failing after PROJ upgrade to 9.8.0. I've ported the necessary patches (in essence, anything that has "test" in subject) from this repo and pyproj tests pass again.
However, PRO 9.8.1 has been released with a revert of some EPSG database changes. That partly restores pre-9.8.0 PROJ behavior, and pyproj tests need to be adjusted for that.
Proposed fix
The following crude patch serves well as an band-aid. Feel free to rework it to your standards. Thanks!