[Git][debian-gis-team/python-pyproj][upstream] New upstream version 3.0~rc1

Bas Couwenberg gitlab at salsa.debian.org
Tue Nov 3 09:36:49 GMT 2020



Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-pyproj


Commits:
9bca2517 by Bas Couwenberg at 2020-11-03T05:21:41+01:00
New upstream version 3.0~rc1
- - - - -


16 changed files:

- .travis.yml
- Makefile
- docs/advanced_examples.rst
- docs/build_crs.rst
- docs/conf.py
- docs/history.rst
- docs/installation.rst
- pyproj/__init__.py
- pyproj/_crs.pyx
- pyproj/sync.py
- pytest.ini
- requirements-dev.txt
- test/test_cli.py
- test/test_doctest_wrapper.py
- test/test_sync.py
- test/test_transformer.py


Changes:

=====================================
.travis.yml
=====================================
@@ -122,6 +122,7 @@ script:
   - |
     if [ "$DOC" ]; then
       make install-docs
+      make docs-man
       make docs
       pip install doctr
       if [[ -z "$TRAVIS_TAG" ]]; then


=====================================
Makefile
=====================================
@@ -96,6 +96,10 @@ docs: ## generate Sphinx HTML documentation, including API docs
 docs-browser: docs ## generate Sphinx HTML documentation, including API docs and open in a browser
 	$(BROWSER) docs/_build/html/index.html
 
+docs-man: ## generate Sphinx man pages for CLI
+	$(MAKE) -C docs clean
+	$(MAKE) -C docs man
+
 install: clean ## install the package to the active Python's site-packages
 	python setup.py install
 


=====================================
docs/advanced_examples.rst
=====================================
@@ -44,10 +44,10 @@ Example with :class:`pyproj.transformer.Transformer`:
 Results: 6.32 µs ± 49.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
 
 
-Tranforming with the same projections
+Transforming with the same projections
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-pyproj will skip transformations if they are exacly the same by default. However, if you
+pyproj will skip transformations if they are exactly the same by default. However, if you
 sometimes throw in the projections that are about the same and the results being close enough
 is what you want, the `skip_equivalent` option can help.
 


=====================================
docs/build_crs.rst
=====================================
@@ -44,7 +44,7 @@ PROJ string::
     geog_wkt = geog_crs.to_wkt()
 
 
-This example is meant to show off different intialization methods.
+This example is meant to show off different initialization methods.
 It can be simplified to not use the Ellipsoid or PrimeMeridian objects.
 
 PROJ string::


=====================================
docs/conf.py
=====================================
@@ -140,7 +140,7 @@ latex_documents = [
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
-man_pages = [(master_doc, "pyproj", "pyproj Documentation", [author], 1)]
+man_pages = [("cli", "pyproj", "pyproj CLI", [author], 1)]
 
 
 # -- Options for Texinfo output ----------------------------------------


=====================================
docs/history.rst
=====================================
@@ -48,7 +48,7 @@ Change Log
 * ENH: Updated :attr:`pyproj.crs.CRS.axis_info` to pull all relevant axis information from CRS (issue #557)
 * ENH: Added :meth:`pyproj.transformer.Transform.__eq__` (issue #559)
 * ENH: Added :attr:`pyproj.crs.CRS.utm_zone` (issue #561)
-* BUG: Modify CRS dict test to accomodate numpy bool types. (issue #564)
+* BUG: Modify CRS dict test to accommodate numpy bool types. (issue #564)
 * BUG: Fix pipeline transformations to match cct (issue #565)
 * BUG: Don't silently ignore kwargs when projparams are specified (Proj & CRS) (issue #565)
 
@@ -70,7 +70,7 @@ Change Log
 ~~~~~
 * Elevate +init= warning to FutureWarning (pull #486)
 * Add UserWarning to :meth:`pyproj.crs.CRS.to_proj4` (pull #486)
-* BUG: Fix for 32-bit i686 plaforms (issue #481)
+* BUG: Fix for 32-bit i686 platforms (issue #481)
 * Return 'inf' in Proj instead of 1.e30 (pull #491)
 
 2.4.1
@@ -191,7 +191,7 @@ Change Log
 2.1.2
 ~~~~~
 * Updated to use the CRS definition for Proj instances in transforms (issue #207)
-* Add option to skip tranformation operation if input and output projections are equivalent
+* Add option to skip transformation operation if input and output projections are equivalent
   and always skip if the input and output projections are exact (issue #128)
 * Update setup.py method for checking PROJ version (pull #211)
 * Add internal proj error log messages to exceptions (pull #215)


=====================================
docs/installation.rst
=====================================
@@ -95,7 +95,7 @@ pyproj Build Environment Variables
 
 .. envvar:: PROJ_LIBDIR
 
-    This is the path to the directory contaning the PROJ libraries.
+    This is the path to the directory containing the PROJ libraries.
     If not set, it searches the `lib` and `lib64` directories inside
     the PROJ directory.
 
@@ -106,7 +106,7 @@ pyproj Build Environment Variables
 
 .. envvar:: PROJ_WHEEL
 
-    This is a boolean value used when bulding a wheel. When true
+    This is a boolean value used when building a wheel. When true
     it includes the contents of the `pyproj/proj_dir/proj/share`
     directory if present.
 


=====================================
pyproj/__init__.py
=====================================
@@ -28,7 +28,7 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIO
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 """
-__version__ = "3.0.rc0"
+__version__ = "3.0.rc1"
 __all__ = [
     "Proj",
     "Geod",


=====================================
pyproj/_crs.pyx
=====================================
@@ -811,7 +811,7 @@ cdef class Ellipsoid(_CRSParts):
         Parameters
         ----------
         auth_name: str
-            Name ot the authority.
+            Name of the authority.
         code: str or int
             The code used by the authority.
 
@@ -1089,7 +1089,7 @@ cdef class PrimeMeridian(_CRSParts):
         Parameters
         ----------
         auth_name: str
-            Name ot the authority.
+            Name of the authority.
         code: str or int
             The code used by the authority.
 
@@ -1336,7 +1336,7 @@ cdef class Datum(_CRSParts):
         Parameters
         ----------
         auth_name: str
-            Name ot the authority.
+            Name of the authority.
         code: str or int
             The code used by the authority.
 
@@ -1369,7 +1369,7 @@ cdef class Datum(_CRSParts):
         Parameters
         ----------
         auth_name: str
-            Name ot the authority.
+            Name of the authority.
         code: str or int
             The code used by the authority.
 
@@ -1916,7 +1916,7 @@ cdef class CoordinateOperation(_CRSParts):
         Parameters
         ----------
         auth_name: str
-            Name ot the authority.
+            Name of the authority.
         code: str or int
             The code used by the authority.
         use_proj_alternative_grid_names: bool, optional


=====================================
pyproj/sync.py
=====================================
@@ -232,7 +232,7 @@ def get_transform_grid_list(
     include_world_coverage: bool, optional
         Defaults to True.
     include_already_downloaded: bool, optional
-        If True, it will list grids reguardless of if they are downloaded.
+        If True, it will list grids regardless of if they are downloaded..
         Defaults to False.
     target_directory: Union[str, Path], optional
         The directory to download the geojson file to.


=====================================
pytest.ini
=====================================
@@ -1,3 +1,4 @@
 [pytest]
 markers =
     slow: marks tests as slow (deselect with '-m "not slow"')
+    network: marks tests that need a network connection (deselect with '-m "not network"')


=====================================
requirements-dev.txt
=====================================
@@ -3,6 +3,7 @@ black
 flake8
 mypy
 numpy
+pandas
 pylint
 pytest>3.6
 pytest-cov


=====================================
test/test_cli.py
=====================================
@@ -74,6 +74,7 @@ def _check_list_files_header(lines):
     assert lines[1].rstrip("\r") == "----------------------------------"
 
 
+ at pytest.mark.network
 @PYPROJ_CLI_ENDPONTS
 def test_sync__source_id__list(input_command, tmpdir):
     with tmp_chdir(str(tmpdir)):
@@ -95,6 +96,7 @@ def test_sync__source_id__list(input_command, tmpdir):
         assert "fr_ign" == line.split("|")[1].strip()
 
 
+ at pytest.mark.network
 @PYPROJ_CLI_ENDPONTS
 def test_sync__area_of_use__list(input_command, tmpdir):
     with tmp_chdir(str(tmpdir)):
@@ -116,6 +118,7 @@ def test_sync__area_of_use__list(input_command, tmpdir):
         assert "France" in line.split("|")[-1]
 
 
+ at pytest.mark.network
 @PYPROJ_CLI_ENDPONTS
 def test_sync__file__list(input_command, tmpdir):
     with tmp_chdir(str(tmpdir)):
@@ -137,6 +140,7 @@ def test_sync__file__list(input_command, tmpdir):
         assert "ntf_r93" in line.split("|")[0]
 
 
+ at pytest.mark.network
 @PYPROJ_CLI_ENDPONTS
 def test_sync__bbox__list(input_command, tmpdir):
     with tmp_chdir(str(tmpdir)):
@@ -159,6 +163,7 @@ def test_sync__bbox__list(input_command, tmpdir):
     assert " | fr_ign | " in output
 
 
+ at pytest.mark.network
 @PYPROJ_CLI_ENDPONTS
 def test_sync__bbox__list__exclude_world_coverage(input_command, tmpdir):
     with tmp_chdir(str(tmpdir)):
@@ -201,6 +206,7 @@ def test_sync__all__exclusive_error(input_command, extra_arg, tmpdir):
         )
 
 
+ at pytest.mark.network
 @patch(
     "pyproj.__main__.parser.parse_args",
     return_value=argparse.Namespace(
@@ -230,6 +236,7 @@ def test_sync_download(download_mock, parse_args_mock):
     )
 
 
+ at pytest.mark.network
 @patch(
     "pyproj.__main__.parser.parse_args",
     return_value=argparse.Namespace(
@@ -264,6 +271,7 @@ def test_sync_download__directory(
     load_grid_geojson_mock.assert_called_with(target_directory="test_directory")
 
 
+ at pytest.mark.network
 @patch(
     "pyproj.__main__.parser.parse_args",
     return_value=argparse.Namespace(
@@ -299,6 +307,7 @@ def test_sync_download__system_directory(
     load_grid_geojson_mock.assert_called_with(target_directory=datadir)
 
 
+ at pytest.mark.network
 @patch("pyproj.__main__.parser.parse_args")
 def test_sync__download_grids(parse_args_mock, tmp_path, capsys):
     parse_args_mock.return_value = argparse.Namespace(


=====================================
test/test_doctest_wrapper.py
=====================================
@@ -12,9 +12,7 @@ from test.conftest import proj_network_env
 
 def test_doctests():
     """run the examples in the docstrings using the doctest module"""
-
-    with warnings.catch_warnings(), proj_network_env():
-        pyproj.network.set_network_enabled(active=True)
+    with warnings.catch_warnings():
         warnings.filterwarnings(
             "ignore",
             "You will likely lose important projection information when",
@@ -24,17 +22,8 @@ def test_doctests():
         failure_count_proj, test_count = doctest.testmod(pyproj.proj, verbose=True)
         failure_count_crs, test_count_crs = doctest.testmod(pyproj.crs, verbose=True)
         failure_count_geod, test_count_geod = doctest.testmod(pyproj.geod, verbose=True)
-        with pytest.warns(DeprecationWarning):
-            failure_count_transform, test_count_transform = doctest.testmod(
-                pyproj.transformer, verbose=True
-            )
-
-    failure_count = (
-        failure_count_proj
-        + failure_count_crs
-        + failure_count_geod
-        + failure_count_transform
-    )
+
+    failure_count = failure_count_proj + failure_count_crs + failure_count_geod
     expected_failure_count = 0
     try:
         import shapely  # noqa
@@ -46,3 +35,16 @@ def test_doctests():
     assert (
         failure_count == expected_failure_count
     ), f"{failure_count} of the doctests failed"
+
+
+ at pytest.mark.network
+def test_doctests__network():
+    """run the examples in the docstrings using the doctest module
+    that require the network
+    """
+    with proj_network_env():
+        pyproj.network.set_network_enabled(active=True)
+        with pytest.warns(DeprecationWarning):
+            failure_count, _ = doctest.testmod(pyproj.transformer, verbose=True)
+
+    assert failure_count == 0, f"{failure_count} of the doctests failed"


=====================================
test/test_sync.py
=====================================
@@ -13,11 +13,13 @@ from pyproj.sync import (
 )
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list():
     grids = get_transform_grid_list(include_already_downloaded=True)
     assert len(grids) > 200
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list__bbox__antimeridian():
     grids = get_transform_grid_list(
         bbox=BBox(170, -90, -170, 90), include_already_downloaded=True
@@ -29,6 +31,7 @@ def test_get_transform_grid_list__bbox__antimeridian():
     assert sorted(source_ids) == ["au_ga", "nc_dittt", "nz_linz", "us_nga", "us_noaa"]
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list__bbox__out_of_bounds():
     grids = get_transform_grid_list(
         bbox=BBox(170, -90, 190, 90), include_already_downloaded=True
@@ -40,6 +43,7 @@ def test_get_transform_grid_list__bbox__out_of_bounds():
     assert sorted(source_ids) == ["au_ga", "nc_dittt", "nz_linz", "us_nga", "us_noaa"]
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list__source_id():
     grids = get_transform_grid_list(
         bbox=BBox(170, -90, -170, 90),
@@ -53,6 +57,7 @@ def test_get_transform_grid_list__source_id():
     assert sorted(source_ids) == ["us_noaa"]
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list__contains():
     grids = get_transform_grid_list(
         bbox=BBox(170, -90, -170, 90),
@@ -66,6 +71,7 @@ def test_get_transform_grid_list__contains():
     assert sorted(source_ids) == ["nz_linz"]
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list__file():
     grids = get_transform_grid_list(
         filename="us_noaa_alaska", include_already_downloaded=True
@@ -74,6 +80,7 @@ def test_get_transform_grid_list__file():
     assert grids[0]["properties"]["name"] == "us_noaa_alaska.tif"
 
 
+ at pytest.mark.network
 def test_get_transform_grid_list__area_of_use():
     grids = get_transform_grid_list(area_of_use="USA", include_already_downloaded=True)
     assert len(grids) > 10
@@ -172,6 +179,7 @@ def test_download_resource_file__bad_sha256sum(urlretrieve_mock, tmp_path):
     assert not tmp_path.joinpath("test_file.txt").exists()
 
 
+ at pytest.mark.network
 @patch("pyproj.sync.Path.stat")
 def test__load_grid_geojson_old_file(stat_mock, tmp_path):
     return_timestamp = MagicMock()


=====================================
test/test_transformer.py
=====================================
@@ -970,6 +970,7 @@ def test_transform_honours_input_types(x, y, z):
     assert transformer.transform(xx=x, yy=y, zz=z) == (x, y, z)
 
 
+ at pytest.mark.network
 @patch("pyproj.transformer.get_user_data_dir")
 def test_transformer_group__download_grids(get_user_data_dir_mock, tmp_path, capsys):
     get_user_data_dir_mock.return_value = str(tmp_path)



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-pyproj/-/commit/9bca2517ed1e95a2e1ade8c1141deddb8ff8c73b

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-pyproj/-/commit/9bca2517ed1e95a2e1ade8c1141deddb8ff8c73b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20201103/cfa6b1bb/attachment-0001.html>


More information about the Pkg-grass-devel mailing list