New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proj: 6.3.1 -> 7.2.1 and related updates #119168
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d95eb2a
proj: 6.3.1 -> 7.2.1
lsix 140e414
python3Packages.pyproj: 2.6.0 -> 3.0.1
lsix 75eb8e5
python3Pakcages.basemap: mark broken for python >= 3.9
lsix fcacfa0
python3Packages.cartopy: Use updated proj, fix tests and mark unbroken
lsix 6f9b4f5
proj_5: drop
lsix File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,56 @@ | ||
diff -Nur a/pyproj/datadir.py b/pyproj/datadir.py | ||
--- a/pyproj/datadir.py 2020-03-24 12:53:39.417440608 +0100 | ||
+++ b/pyproj/datadir.py 2020-03-24 12:56:19.870089479 +0100 | ||
@@ -66,9 +66,7 @@ | ||
--- a/pyproj/datadir.py 2021-04-10 18:26:52.829018483 +0100 | ||
+++ b/pyproj/datadir.py 2021-04-10 18:44:59.155190614 +0100 | ||
@@ -70,7 +70,7 @@ | ||
if _VALIDATED_PROJ_DATA is not None: | ||
return _VALIDATED_PROJ_DATA | ||
global _USER_PROJ_DATA | ||
- internal_datadir = os.path.join( | ||
- os.path.dirname(os.path.abspath(__file__)), "proj_dir", "share", "proj" | ||
- ) | ||
+ internal_datadir = "@proj@/share/proj" | ||
- internal_datadir = Path(__file__).absolute().parent / "proj_dir" / "share" / "proj" | ||
+ internal_datadir = Path("@proj@/share/proj") | ||
proj_lib_dirs = os.environ.get("PROJ_LIB", "") | ||
prefix_datadir = os.path.join(sys.prefix, "share", "proj") | ||
prefix_datadir = Path(sys.prefix, "share", "proj") | ||
|
||
diff -Nur a/setup.py b/setup.py | ||
--- a/setup.py 2020-03-24 12:53:39.415440624 +0100 | ||
+++ b/setup.py 2020-03-24 12:52:05.311232522 +0100 | ||
--- a/setup.py 2021-04-10 18:26:52.817018512 +0100 | ||
+++ b/setup.py 2021-04-10 18:46:01.652324424 +0100 | ||
@@ -11,7 +11,7 @@ | ||
PROJ_MIN_VERSION = parse_version("6.2.0") | ||
CURRENT_FILE_PATH = os.path.dirname(os.path.abspath(__file__)) | ||
BASE_INTERNAL_PROJ_DIR = "proj_dir" | ||
-INTERNAL_PROJ_DIR = os.path.join(CURRENT_FILE_PATH, "pyproj", BASE_INTERNAL_PROJ_DIR) | ||
+INTERNAL_PROJ_DIR = "@proj@" | ||
PROJ_MIN_VERSION = parse_version("7.2.0") | ||
CURRENT_FILE_PATH = Path(__file__).absolute().parent | ||
BASE_INTERNAL_PROJ_DIR = Path("proj_dir") | ||
-INTERNAL_PROJ_DIR = CURRENT_FILE_PATH / "pyproj" / BASE_INTERNAL_PROJ_DIR | ||
+INTERNAL_PROJ_DIR = Path("@proj@") | ||
|
||
|
||
def check_proj_version(proj_dir): | ||
@@ -146,7 +146,7 @@ | ||
def get_proj_version(proj_dir: Path) -> str: | ||
@@ -150,7 +150,7 @@ | ||
# By default we'll try to get options PROJ_DIR or the local version of proj | ||
proj_dir = get_proj_dir() | ||
library_dirs = get_proj_libdirs(proj_dir) | ||
- include_dirs = get_proj_incdirs(proj_dir) | ||
+ include_dirs = get_proj_incdirs("@projdev@") | ||
+ include_dirs = get_proj_incdirs(Path("@projdev@")) | ||
|
||
# setup extension options | ||
ext_options = { | ||
proj_version = get_proj_version(proj_dir) | ||
check_proj_version(proj_version) | ||
diff -Nur a/test/conftest.py b/test/conftest.py | ||
--- a/test/conftest.py 2020-03-24 12:53:39.417440608 +0100 | ||
+++ b/test/conftest.py 2020-03-24 23:16:47.373972786 +0100 | ||
@@ -1,6 +1,7 @@ | ||
import os | ||
import shutil | ||
import tempfile | ||
--- a/test/conftest.py 2021-04-10 18:26:52.831018478 +0100 | ||
+++ b/test/conftest.py 2021-04-10 18:37:01.605682432 +0100 | ||
@@ -2,6 +2,7 @@ | ||
from contextlib import contextmanager | ||
from distutils.version import LooseVersion | ||
from pathlib import Path | ||
+import stat | ||
|
||
import pytest | ||
|
||
@@ -17,6 +18,15 @@ | ||
with tempfile.TemporaryDirectory() as tmpdir: | ||
tmp_data_dir = os.path.join(tmpdir, "proj") | ||
shutil.copytree(data_dir, tmp_data_dir) | ||
+ | ||
+ # Data copied from the nix store is readonly (causes cleanup problem). | ||
+ # Make it writable. | ||
+ for r, d, files in os.walk(tmp_data_dir): | ||
+ os.chmod(r, os.stat(r).st_mode | stat.S_IWUSR) | ||
+ for f in files: | ||
+ fpath = os.path.join(r, f) | ||
+ os.chmod(fpath, os.stat(fpath).st_mode | stat.S_IWUSR) | ||
+ | ||
try: | ||
os.remove(os.path.join(str(tmp_data_dir), "ntv2_0.gsb")) | ||
except OSError: | ||
import pyproj | ||
from pyproj.datadir import get_data_dir, get_user_data_dir, set_data_dir | ||
diff -Nur a/test/test_cli.py b/test/test_cli.py | ||
--- a/test/test_cli.py 2021-04-10 18:26:52.831018478 +0100 | ||
+++ b/test/test_cli.py 2021-04-10 22:17:04.665088162 +0100 | ||
@@ -14,7 +14,7 @@ | ||
from test.conftest import grids_available, proj_env, tmp_chdir | ||
|
||
PYPROJ_CLI_ENDPONTS = pytest.mark.parametrize( | ||
- "input_command", [["pyproj"], [sys.executable, "-m", "pyproj"]] | ||
+ "input_command", [[sys.executable, "-m", "pyproj"]] | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,94 @@ | ||
{ lib, buildPythonPackage, fetchFromGitHub, python, pkgs, pythonOlder, isPy27, substituteAll | ||
, aenum | ||
{ lib | ||
, buildPythonPackage | ||
, fetchFromGitHub | ||
, python | ||
, proj | ||
, pythonOlder | ||
, substituteAll | ||
, cython | ||
, pytestCheckHook | ||
, mock | ||
, certifi | ||
, numpy | ||
, shapely | ||
, pandas | ||
, xarray | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "pyproj"; | ||
version = "2.6.0"; | ||
disabled = isPy27; | ||
version = "3.0.1"; | ||
disabled = pythonOlder "3.7"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "pyproj4"; | ||
repo = "pyproj"; | ||
rev = "v${version}rel"; | ||
sha256 = "0fyggkbr3kp8mlq4c0r8sl5ah58bdg2mj4kzql9p3qyrkcdlgixh"; | ||
rev = version; | ||
sha256 = "1q1i1235cp3k32dpb11r7krx5rpqwszb89mrx85rflc1z5acaj58"; | ||
}; | ||
|
||
# force pyproj to use ${pkgs.proj} | ||
# force pyproj to use ${proj} | ||
patches = [ | ||
(substituteAll { | ||
src = ./001.proj.patch; | ||
proj = pkgs.proj; | ||
projdev = pkgs.proj.dev; | ||
proj = proj; | ||
projdev = proj.dev; | ||
}) | ||
]; | ||
|
||
buildInputs = [ cython pkgs.proj ]; | ||
nativeBuildInputs = [ cython ]; | ||
buildInputs = [ proj ]; | ||
|
||
propagatedBuildInputs = [ | ||
numpy shapely | ||
] ++ lib.optional (pythonOlder "3.6") aenum; | ||
certifi | ||
]; | ||
|
||
checkInputs = [ | ||
pytestCheckHook | ||
mock | ||
numpy | ||
shapely | ||
pandas | ||
xarray | ||
]; | ||
|
||
checkInputs = [ pytestCheckHook mock ]; | ||
preCheck = '' | ||
# We need to build extensions locally to run tests | ||
${python.interpreter} setup.py build_ext --inplace | ||
cd test | ||
''; | ||
|
||
# prevent importing local directory | ||
preCheck = "cd test"; | ||
pytestFlagsArray = [ | ||
"--ignore=test_doctest_wrapper.py" | ||
"--ignore=test_datadir.py" | ||
disabledTestPaths = [ | ||
"test_doctest_wrapper.py" | ||
"test_datadir.py" | ||
]; | ||
|
||
disabledTests = [ | ||
"alternative_grid_name" | ||
"transform_wgs84_to_alaska" | ||
"transformer_group__unavailable" | ||
"transform_group__missing_best" | ||
"datum" | ||
"repr" | ||
# The following tests try to access network and end up with a URLError | ||
"test__load_grid_geojson_old_file" | ||
"test_get_transform_grid_list" | ||
"test_get_transform_grid_list__area_of_use" | ||
"test_get_transform_grid_list__bbox__antimeridian" | ||
"test_get_transform_grid_list__bbox__out_of_bounds" | ||
"test_get_transform_grid_list__contains" | ||
"test_get_transform_grid_list__file" | ||
"test_get_transform_grid_list__source_id" | ||
"test_sync__area_of_use__list" | ||
"test_sync__bbox__list" | ||
"test_sync__bbox__list__exclude_world_coverage" | ||
"test_sync__download_grids" | ||
"test_sync__file__list" | ||
"test_sync__source_id__list" | ||
"test_sync_download" | ||
"test_sync_download__directory" | ||
"test_sync_download__system_directory" | ||
"test_transformer_group__download_grids" | ||
]; | ||
|
||
meta = { | ||
description = "Python interface to PROJ.4 library"; | ||
homepage = "https://github.com/jswhit/pyproj"; | ||
homepage = "https://github.com/pyproj4/pyproj"; | ||
license = with lib.licenses; [ isc ]; | ||
maintainers = with lib.maintainers; [ lsix ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add an alias for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!