[Git][debian-gis-team/mercantile][master] 20 commits: Raise InvalidLatitudeError at 90.0 north (#107)

Joachim Langenbach gitlab at salsa.debian.org
Sun May 3 17:27:32 BST 2020



Joachim Langenbach pushed to branch master at Debian GIS Project / mercantile


Commits:
635f37e8 by Sean Gillies at 2020-04-28T17:05:23-06:00
Raise InvalidLatitudeError at 90.0 north (#107)

Resolves #106
- - - - -
4cd0c36d by Sean Gillies at 2020-04-28T17:13:27-06:00
Change a list comprehension to a generator expression

- - - - -
2a0c017e by Joachim Langenbach at 2020-05-03T17:42:55+02:00
Removed unneded changelog entry, to get only one for the first release

- - - - -
a5cf64ab by Joachim Langenbach at 2020-05-03T17:43:46+02:00
Bumped versin to new upstream version

- - - - -
7faf29dc by Joachim Langenbach at 2020-05-03T17:44:12+02:00
Fixed mail address and mantainer name

- - - - -
6995826b by Joachim Langenbach at 2020-05-03T17:45:22+02:00
Adapted watch file to be more robust as stated in the wiki

- - - - -
91bf11ec by Joachim Langenbach at 2020-05-03T17:46:14+02:00
Improved the metadaset:
 * Added Bug submit url
 * Removed documentation url, as it is the same documentation as in the ackage itself
 * Removed the changelog which is without usage for this package

- - - - -
1c56cbc1 by Joachim Langenbach at 2020-05-03T17:47:20+02:00
auto_clean target removes all artefacts now, so that they could be removed from the source/options

- - - - -
d5a45c27 by Joachim Langenbach at 2020-05-03T17:48:52+02:00
* Added years
 * Added docs folder, because of other years
 * Removed copyright symbol

- - - - -
3b40a038 by Joachim Langenbach at 2020-05-03T17:49:28+02:00
Added links to use jquery and underscore.js from distribution.

- - - - -
9dabf6ab by Joachim Langenbach at 2020-05-03T17:49:45+02:00
All lintian overrides are obsolete now

- - - - -
3ae29f2b by Joachim Langenbach at 2020-05-03T17:50:06+02:00
Moved manpasge to new mercantile binary package

- - - - -
ad99db32 by Joachim Langenbach at 2020-05-03T17:50:17+02:00
Fixed version number in mapage

- - - - -
02aff74d by Joachim Langenbach at 2020-05-03T17:50:39+02:00
* Removed changelog from patch
 * Added Forwarded: not-needed

- - - - -
58bd60d5 by Joachim Langenbach at 2020-05-03T17:51:10+02:00
Moved pytest into a variable

- - - - -
36eb702c by Joachim Langenbach at 2020-05-03T17:51:36+02:00
build-indep is not required, because all packages are arch all

- - - - -
29016d83 by Joachim Langenbach at 2020-05-03T17:51:56+02:00
Removed jdupes, because the dupes are ok for the small package

- - - - -
7b3580e0 by Joachim Langenbach at 2020-05-03T17:52:10+02:00
Copy the binary into its own mercantile package

- - - - -
338565b7 by Joachim Langenbach at 2020-05-03T15:53:44+00:00
Merge branch 'upstream' 1.1.4 into master

- - - - -
4fc75e4a by Joachim Langenbach at 2020-05-03T15:54:32+00:00
Added .pc as a ignored directory to the package section of .gitignore

- - - - -


15 changed files:

- .gitignore
- CHANGES.txt
- debian/changelog
- debian/copyright
- + debian/links
- debian/mercantile.1
- debian/python3-mercantile.manpages → debian/mercantile.manpages
- debian/patches/0001-removed-coveralls-from-test-requirements.patch
- − debian/python3-mercantile.lintian-overrides
- debian/rules
- − debian/source/options
- debian/upstream/metadata
- debian/watch
- mercantile/__init__.py
- tests/test_funcs.py


Changes:

=====================================
.gitignore
=====================================
@@ -7,6 +7,7 @@ __pycache__/
 *.so
 
 # Distribution / packaging
+.pc/
 .Python
 env/
 build/


=====================================
CHANGES.txt
=====================================
@@ -1,6 +1,14 @@
 Changes
 =======
 
+1.1.4 (2020-04-28)
+------------------
+
+- Change a list comprehension to a generator expression in simplify().
+- Change DeprecationWarning introduced in 1.1.3 to a UserWarning to increase
+  visibility.
+- Ensure symmetric InvalidLatitudeErrors at both poles (#106).
+
 1.1.3 (2020-04-13)
 ------------------
 


=====================================
debian/changelog
=====================================
@@ -1,11 +1,5 @@
-mercantile (1.1.3-2) unstable; urgency=medium
-
-  * Moved to salsa.debian.org
-
- -- Joachim Langenbach <joachim.langenbach at engsas.de>  Mon, 20 Apr 2020 18:15:00 +0200
-
-mercantile (1.1.3-1) unstable; urgency=medium
+mercantile (1.1.4-1) unstable; urgency=medium
 
   * Initial release (Closes: #956911)
 
- -- EngSaS - Maintainer <info at engsas.de>  Thu, 16 Apr 2020 20:15:00 +0200
+ -- Joachim Langenbach <joachim.langenbach at engsas.de>  Sun, 03 May 2020 10:00:00 +0200


=====================================
debian/copyright
=====================================
@@ -4,7 +4,7 @@ Upstream-Contact: Sean Gillies <sean at mapbox.com>
 Source: https://github.com/mapbox/mercantile
 
 Files: *
-Copyright: Sean Gillies <sean at mapbox.com>
+Copyright: 2014-2017, Sean Gillies <sean at mapbox.com>
 License: BSD-3-clause
 
 Files: docs/*
@@ -12,7 +12,7 @@ Copyright: 2017, Sean Gillies <sean at mapbox.com>
 License: BSD-3-clause
 
 Files: debian/*
-Copyright: 2020 © EngSaS - Maintainer <info at engsas.de>
+Copyright: 2020, Joachim Langenbach <joachim.langenbach at engsas.de>
 License: BSD-3-clause
 
 License: BSD-3-clause


=====================================
debian/links
=====================================
@@ -0,0 +1,4 @@
+usr/share/javascript/jquery/jquery.js         usr/share/doc/python3-mercantile/html/_static/jquery.js
+usr/share/javascript/underscore/underscore.js usr/share/doc/python3-mercantile/html/_static/underscore.js
+
+


=====================================
debian/mercantile.1
=====================================
@@ -1,5 +1,5 @@
 .\" Manpage for mercantile.
-.TH man 1 "13 Apr 2020" "1.2.0" "mercantile man page"
+.TH man 1 "13 Apr 2020" "1.1.4" "mercantile man page"
 .SH NAME
 mercantile \- Command line interface for the Mercantile Python package.
 .SH SYNPOSIS


=====================================
debian/python3-mercantile.manpages → debian/mercantile.manpages
=====================================


=====================================
debian/patches/0001-removed-coveralls-from-test-requirements.patch
=====================================
@@ -1,12 +1,8 @@
 Description: Removed coveralls from test requirements
  coveralls is used by the travis test setup. But not needed for
  pytests run during the packaging process.
- .
- mercantile (1.1.2-1) unstable; urgency=medium
- .
-   * Initial release (#ITP_BUG_NUMBER)
-Author: EngSaS - Maintainer <info at engsas.de>
-
+Author: Joachim Langenbach <joachim.langenbach at engsas.de>
+Forwarded: not-needed
 --- mercantile-1.1.3.orig/setup.py
 +++ mercantile-1.1.3/setup.py
 @@ -38,7 +38,7 @@ setup(


=====================================
debian/python3-mercantile.lintian-overrides deleted
=====================================
@@ -1,4 +0,0 @@
-python3-mercantile: library-package-name-for-application usr/bin/mercantile
-python3-mercantile: wrong-section-according-to-package-name python3-mercantile => python
-python3-mercantile: embedded-javascript-library usr/share/doc/python3-mercantile/html/_static/jquery.js please use libjs-jquery
-python3-mercantile: embedded-javascript-library usr/share/doc/python3-mercantile/html/_static/underscore.js please use libjs-underscore


=====================================
debian/rules
=====================================
@@ -1,13 +1,23 @@
 #! /usr/bin/make -f
 
 export PYBUILD_NAME=mercantile
+export PYBUILD_TEST_PYTEST=1
+
 %:
-	dh $@ --with python3 --buildsystem=pybuild --test-pytest
+	dh $@ --with python3 --buildsystem=pybuild
 
-override_dh_auto_build-indep:
-	PYTHONPATH=$(CURDIR):$(CURDIR)/docs make -C docs html
+override_dh_auto_clean:
+	dh_auto_clean
+	(cd docs && make clean)
+	rm -Rf .egg-info
+	rm -Rf .pytest_cache
+
+override_dh_auto_build:
 	dh_auto_build
+	PYTHONPATH=$(CURDIR):$(CURDIR)/docs make -C docs html
 
-override_dh_link:
-	jdupes -rl debian/python3-${PYBUILD_NAME}/usr
-	dh_link
+override_dh_auto_install:
+	dh_auto_install
+	# Move usr/bin/mercantile to mercantile package
+	mkdir -p debian/mercantile/usr
+	mv debian/python3-mercantile/usr/bin debian/mercantile/usr


=====================================
debian/source/options deleted
=====================================
@@ -1,3 +0,0 @@
-extend-diff-ignore="^[^/]+.egg-info/"
-extend-diff-ignore="^.pytest_cache"
-extend-diff-ignore="^docs/_build/"


=====================================
debian/upstream/metadata
=====================================
@@ -1,5 +1,4 @@
 Bug-Database: https://github.com/mapbox/mercantile/issues
-Changelog: https://github.com/mapbox/mercantile/releases
-Documentation: http://mercantile.readthedocs.io/en/latest/
+Bug-Submit: https://github.com/mapbox/mercantile/issues/new
 Repository: https://github.com/mapbox/mercantile.git
 Repository-Browse: https://github.com/mapbox/mercantile


=====================================
debian/watch
=====================================
@@ -1,3 +1,6 @@
 version=3
-opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/mercantile-$1\.tar\.gz/ \
-  https://github.com/mapbox/mercantile/tags .*/v?(\d\S*)\.tar\.gz
+opts=\
+dversionmangle=s/\+(debian|dfsg|ds|deb)(\.?\d+)?$//,\
+uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/,\
+filenamemangle=s/(?:.*?\/)?(?:rel|r|v|mercantile)?[\-\_]?(\d\S+)\.(tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))/mercantile-$1.$2/ \
+  https://github.com/mapbox/mercantile/tags .*/v?(\d\S*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))


=====================================
mercantile/__init__.py
=====================================
@@ -8,14 +8,14 @@ import warnings
 if sys.version_info < (3,):
     warnings.warn(
         "Python versions < 3 will not be supported by mercantile 2.0.",
-        DeprecationWarning,
+        UserWarning,
     )
     from collections import Sequence
 else:
     from collections.abc import Sequence
 
 
-__version__ = "1.1.3"
+__version__ = "1.1.4"
 
 __all__ = [
     "Bbox",
@@ -305,7 +305,7 @@ def _xy(lng, lat, truncate=False):
 
     try:
         y = 0.5 - 0.25 * math.log((1.0 + sinlat) / (1.0 - sinlat)) / math.pi
-    except ValueError:
+    except (ValueError, ZeroDivisionError):
         raise InvalidLatitudeError("Y can not be computed: lat={!r}".format(lat))
     else:
         return x, y
@@ -624,8 +624,7 @@ def simplify(tiles):
     root_set = set()
     for tile in tiles:
         x, y, z = tile
-        supers = [parent(tile, zoom=i) for i in range(z + 1)]
-        for supertile in supers:
+        for supertile in (parent(tile, zoom=i) for i in range(z + 1)):
             if supertile in root_set:
                 continue
         root_set |= {tile}


=====================================
tests/test_funcs.py
=====================================
@@ -438,3 +438,36 @@ def test_ul_xy_bounds(t):
 
 def test_lower_left_tile():
     assert mercantile.tile(180.0, -85, 1) == mercantile.Tile(1, 1, 1)
+
+
+ at pytest.mark.parametrize("lat", [-90.0, 90.0])
+def test_tile_poles(lat):
+    with pytest.raises(mercantile.InvalidLatitudeError):
+        mercantile.tile(0.0, lat, zoom=17)
+
+
+ at pytest.mark.parametrize("lat", [-90.0, 90.0])
+def test__xy_poles(lat):
+    with pytest.raises(mercantile.InvalidLatitudeError):
+        mercantile._xy(0.0, lat)
+
+
+ at pytest.mark.parametrize("lat,fy", [(85.0511287798066, 0.0), (-85.0511287798066, 1.0)])
+def test__xy_limits(lat, fy):
+    x, y = mercantile._xy(0.0, lat)
+    assert x == 0.5
+    assert y == pytest.approx(fy)
+
+
+ at pytest.mark.parametrize("lat", [86.0])
+def test__xy_north_of_limit(lat):
+    x, y = mercantile._xy(0.0, lat)
+    assert x == 0.5
+    assert y < 0
+
+
+ at pytest.mark.parametrize("lat", [-86.0])
+def test__xy_south_of_limit(lat):
+    x, y = mercantile._xy(0.0, lat)
+    assert x == 0.5
+    assert y > 1



View it on GitLab: https://salsa.debian.org/debian-gis-team/mercantile/-/compare/16ff1cab7a5efff06a9cf14a3d0d6723c7259995...4fc75e4aec26da76ff64dbf8dc2159b4f2939cbd

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/mercantile/-/compare/16ff1cab7a5efff06a9cf14a3d0d6723c7259995...4fc75e4aec26da76ff64dbf8dc2159b4f2939cbd
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/20200503/f229a9e5/attachment-0001.html>


More information about the Pkg-grass-devel mailing list