[Git][debian-gis-team/python-cartopy][master] 3 commits: Simplify the version file generation

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Dec 4 18:30:18 GMT 2021



Antonio Valentino pushed to branch master at Debian GIS Project / python-cartopy


Commits:
ff830aab by Antonio Valentino at 2021-12-04T18:06:03+00:00
Simplify the version file generation

- - - - -
3a23e8fd by Antonio Valentino at 2021-12-04T18:09:59+00:00
Refresh and renumber all patches

- - - - -
2620ae37 by Antonio Valentino at 2021-12-04T18:26:05+00:00
New 0004-Set-version-in-setup.cfg.patch

- - - - -


8 changed files:

- debian/changelog
- debian/patches/0001-Skip-tests-failing-on-i386-architectures.patch
- debian/patches/test_robinson.patch → debian/patches/0002-test_robinson.patch
- debian/patches/test_gridliner.patch → debian/patches/0003-test_gridliner.patch
- + debian/patches/0004-Set-version-in-setup.cfg.patch
- debian/patches/series
- debian/rules
- − debian/version.py


Changes:

=====================================
debian/changelog
=====================================
@@ -16,6 +16,11 @@ python-cartopy (0.20.1+dfsg-2) UNRELEASED; urgency=medium
     - add item for no-manual-page usr/bin/cartopy_feature_download.py.
   * debian/rules:
     - rename scripts in usr/bin to remove the language extension.
+  * debian/rules:
+    - simplify the version file generation.
+  * debian/patches:
+    - refresh and renumber all patches
+    - new 0004-Set-version-in-setup.cfg.patch.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 22 Oct 2021 08:58:49 +0200
 


=====================================
debian/patches/0001-Skip-tests-failing-on-i386-architectures.patch
=====================================
@@ -1,14 +1,16 @@
 From: Ghislain Antony Vaillant <ghisvail at gmail.com>
 Date: Sat, 14 Jan 2017 10:26:34 +0000
 Subject: Skip tests failing on i386 architectures
-Forwarded: not-needed
 
+Forwarded: not-needed
 ---
  lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py | 3 +++
  lib/cartopy/tests/mpl/test_features.py                     | 3 +++
- lib/cartopy/tests/mpl/test_images.py                       | 3 +++
- 3 files changed, 9 insertions(+)
+ lib/cartopy/tests/mpl/test_images.py                       | 1 +
+ 3 files changed, 7 insertions(+)
 
+diff --git a/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py b/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
+index a06c890..6ae2d75 100644
 --- a/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
 +++ b/lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py
 @@ -7,12 +7,15 @@
@@ -27,6 +29,8 @@ Forwarded: not-needed
      def test_default(self):
          crs = ccrs.LambertAzimuthalEqualArea()
          other_args = {'ellps=WGS84', 'lon_0=0.0', 'lat_0=0.0', 'x_0=0.0',
+diff --git a/lib/cartopy/tests/mpl/test_features.py b/lib/cartopy/tests/mpl/test_features.py
+index 0247758..aade392 100644
 --- a/lib/cartopy/tests/mpl/test_features.py
 +++ b/lib/cartopy/tests/mpl/test_features.py
 @@ -6,6 +6,7 @@
@@ -46,6 +50,8 @@ Forwarded: not-needed
  @ImageTesting(['gshhs_coastlines'], tolerance=0.95)
  def test_gshhs():
      ax = plt.axes(projection=ccrs.Mollweide())
+diff --git a/lib/cartopy/tests/mpl/test_images.py b/lib/cartopy/tests/mpl/test_images.py
+index 8fc41a1..30fb457 100644
 --- a/lib/cartopy/tests/mpl/test_images.py
 +++ b/lib/cartopy/tests/mpl/test_images.py
 @@ -5,6 +5,7 @@


=====================================
debian/patches/test_robinson.patch → debian/patches/0002-test_robinson.patch
=====================================
@@ -1,8 +1,15 @@
-Description: Mark tests with xfail.
-Author: Bas Couwenberg <sebastic at debian.org>
+From: Bas Couwenberg <sebastic at debian.org>
+Date: Sat, 4 Dec 2021 18:08:31 +0000
+Subject: Mark tests with xfail.
+
 Bug: https://github.com/SciTools/cartopy/issues/1458#issuecomment-584542263
 Bug-Debian: https://bugs.debian.org/951767
+---
+ lib/cartopy/tests/crs/test_robinson.py | 2 ++
+ 1 file changed, 2 insertions(+)
 
+diff --git a/lib/cartopy/tests/crs/test_robinson.py b/lib/cartopy/tests/crs/test_robinson.py
+index 77f8562..f76523d 100644
 --- a/lib/cartopy/tests/crs/test_robinson.py
 +++ b/lib/cartopy/tests/crs/test_robinson.py
 @@ -90,6 +90,7 @@ def test_central_longitude(lon):


=====================================
debian/patches/test_gridliner.patch → debian/patches/0003-test_gridliner.patch
=====================================
@@ -1,10 +1,17 @@
-Description: Also skip tests with GEOS 3.9.1+.
-Author: Bas Couwenberg <sebastic at debian.org>
+From: Bas Couwenberg <sebastic at debian.org>
+Date: Sat, 4 Dec 2021 18:08:31 +0000
+Subject: Also skip tests with GEOS 3.9.1+.
+
 Forwarded: not-needed
+---
+ lib/cartopy/tests/mpl/test_gridliner.py | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
 
+diff --git a/lib/cartopy/tests/mpl/test_gridliner.py b/lib/cartopy/tests/mpl/test_gridliner.py
+index c9699ee..c7e8ea6 100644
 --- a/lib/cartopy/tests/mpl/test_gridliner.py
 +++ b/lib/cartopy/tests/mpl/test_gridliner.py
-@@ -134,7 +134,7 @@ grid_label_inline_image = 'gridliner_lab
+@@ -134,7 +134,7 @@ grid_label_inline_image = 'gridliner_labels_inline'
  grid_label_inline_usa_image = 'gridliner_labels_inline_usa'
  
  


=====================================
debian/patches/0004-Set-version-in-setup.cfg.patch
=====================================
@@ -0,0 +1,20 @@
+From: Antonio Valentino <antonio.valentino at tiscali.it>
+Date: Sat, 4 Dec 2021 18:24:02 +0000
+Subject: Set version in setup.cfg
+
+Forwarded: not-needed
+---
+ setup.cfg | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/setup.cfg b/setup.cfg
+index 3e9cec0..31183c2 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -7,3 +7,6 @@ exclude = \
+     build, \
+     setup.py, \
+     docs/source/conf.py
++
++[metadata]
++version = attr: cartopy._version.version


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 0001-Skip-tests-failing-on-i386-architectures.patch
-test_robinson.patch
-test_gridliner.patch
+0002-test_robinson.patch
+0003-test_gridliner.patch
+0004-Set-version-in-setup.cfg.patch


=====================================
debian/rules
=====================================
@@ -3,6 +3,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE = 1
 
+include /usr/share/dpkg/pkg-info.mk
+
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 # Workaround for proj_api.h deprecation in PROJ 6.0.0
@@ -29,8 +31,7 @@ override_dh_auto_clean:
 	$(RM) -r __pycache__
 
 override_dh_auto_configure:
-	python3 $(CURDIR)/debian/version.py
-
+	echo "version = '$(DEB_VERSION_UPSTREAM)'" > $(CURDIR)/lib/cartopy/_version.py
 	dh_auto_configure
 
 override_dh_auto_test:


=====================================
debian/version.py deleted
=====================================
@@ -1,92 +0,0 @@
-#!/usr/bin/python3
-
-import os
-import re
-import subprocess
-import sys
-
-
-version = None
-
-var = 'DEB_VERSION_UPSTREAM'
-
-if var in os.environ:
-    version = os.environ[var]
-else:
-    changelog_file = os.path.join(
-        os.path.dirname(__file__),
-        'changelog',
-    )
-
-    cmd = [
-        'dpkg-parsechangelog',
-        '-S', 'Version',
-        '-l', changelog_file,
-    ]
-
-    p = subprocess.Popen(
-        cmd,
-        stdout=subprocess.PIPE,
-        stderr=subprocess.PIPE,
-    )
-
-    (stdout, stderr) = p.communicate()
-
-    if p.returncode != 0:
-        print("Error: Command failed: %s (%s)" % (
-            " ".join(cmd),
-            p.returncode
-        ))
-        if stdout:
-            print(stdout.decode())
-        if stderr:
-            print(stderr.decode())
-        sys.exit(p.returncode)
-
-    version = stdout.decode()
-
-    # Strip package revision
-    version = re.sub(
-        r'-[^-]*$',
-        '',
-        version,
-    )
-
-    # Strip epoch
-    version = re.sub(
-        r'^[0-9]*:',
-        '',
-        version,
-    )
-
-# Strip repacksuffix
-version = re.sub(
-    r'\+.*$',
-    '',
-    version,
-)
-
-# Strip pre-release identifier
-version = re.sub(
-    r'~',
-    '',
-    version,
-)
-
-version_file = os.path.join(
-    os.path.dirname(
-        os.path.dirname(__file__),
-    ),
-    'lib',
-    'cartopy',
-    '_version.py',
-)
-
-with open(version_file, 'w') as f:
-    f.write("# Generated by %s/%s\n" % (
-        os.path.basename(
-            os.path.dirname(__file__),
-        ),
-        os.path.basename(__file__)
-    ))
-    f.write("version = '%s'\n" % version)



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-cartopy/-/compare/bbe87fa56235abd8d03c593e106b2c96d7f1f997...2620ae37e211d330da9c4123a88a751d261658b4

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-cartopy/-/compare/bbe87fa56235abd8d03c593e106b2c96d7f1f997...2620ae37e211d330da9c4123a88a751d261658b4
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/20211204/ff9600d1/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list