[Git][debian-gis-team/python-mapnik][master] Add patch to use pytest instead of nose.

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Sun Aug 11 08:55:15 BST 2024



Bas Couwenberg pushed to branch master at Debian GIS Project / python-mapnik


Commits:
33585308 by Bas Couwenberg at 2024-08-11T09:54:44+02:00
Add patch to use pytest instead of nose.

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/nose2pytest.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -3,6 +3,7 @@ python-mapnik (1:0.0~20240222-5ab32f020-2) UNRELEASED; urgency=medium
   * Bump Standards-Version to 4.7.0, no changes.
   * Drop python3-nose from build dependencies.
     (closes: #1018529)
+  * Add patch to use pytest instead of nose.
 
  -- Bas Couwenberg <sebastic at debian.org>  Sun, 28 Jul 2024 19:59:11 +0200
 


=====================================
debian/patches/nose2pytest.patch
=====================================
@@ -0,0 +1,478 @@
+Description: Use pytest instead of nose.
+Author: Bas Couwenberg <sebastic at debian.org>
+Bug: https://github.com/mapnik/python-mapnik/issues/282
+
+--- a/setup.py
++++ b/setup.py
+@@ -251,12 +251,11 @@ setup(
+     keywords="mapnik mapbox mapping cartography",
+     url="http://mapnik.org/",
+     tests_require=[
+-        'nose',
++        'pytest',
+     ],
+     package_data={
+         'mapnik': ['lib/*.*', 'lib/*/*/*', 'share/*/*'],
+     },
+-    test_suite='nose.collector',
+     cmdclass={
+         'whichboost': WhichBoostCommand,
+     },
+--- a/test/python_tests/pgraster_test.py
++++ b/test/python_tests/pgraster_test.py
+@@ -168,7 +168,7 @@ if 'pgraster' in mapnik.DatasourceCache.
+                              prescale_rasters=rescale, clip_rasters=clip)
+         fs = ds.featureset()
+         feature = fs.next()
+-        eq_(feature['rid'], 1)
++        assert feature['rid'] == 1
+         lyr = mapnik.Layer('dataraster_16bsi')
+         lyr.datasource = ds
+         expenv = mapnik.Box2d(-14637, 3903178, 1126863, 4859678)
+@@ -183,10 +183,10 @@ if 'pgraster' in mapnik.DatasourceCache.
+         pixsize = 500  # see gdalinfo dataraster.tif
+         pixsize = 2497  # see gdalinfo dataraster-small.tif
+         tol = pixsize * max(overview.split(',')) if overview else 0
+-        assert_almost_equal(env.minx, expenv.minx)
+-        assert_almost_equal(env.miny, expenv.miny, delta=tol)
+-        assert_almost_equal(env.maxx, expenv.maxx, delta=tol)
+-        assert_almost_equal(env.maxy, expenv.maxy)
++        assert env.minx == pytest.approx(expenv.minx, abs=1e-7)
++        assert env.miny == pytest.approx(expenv.miny, abs=tol)
++        assert env.maxx == pytest.approx(expenv.maxx, abs=tol)
++        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-7)
+         mm = mapnik.Map(256, 256)
+         style = mapnik.Style()
+         col = mapnik.RasterColorizer()
+@@ -209,18 +209,18 @@ if 'pgraster' in mapnik.DatasourceCache.
+         lap = time.time() - t0
+         log('T ' + str(lap) + ' -- ' + lbl + ' E:full')
+         # no data
+-        eq_(im.view(1, 1, 1, 1).tostring(), b'\x00\x00\x00\x00')
+-        eq_(im.view(255, 255, 1, 1).tostring(), b'\x00\x00\x00\x00')
+-        eq_(im.view(195, 116, 1, 1).tostring(), b'\x00\x00\x00\x00')
++        assert im.view(1, 1, 1, 1).tostring() == b'\x00\x00\x00\x00'
++        assert im.view(255, 255, 1, 1).tostring() == b'\x00\x00\x00\x00'
++        assert im.view(195, 116, 1, 1).tostring() == b'\x00\x00\x00\x00'
+         # A0A0A0
+-        eq_(im.view(100, 120, 1, 1).tostring(), b'\xa0\xa0\xa0\xff')
+-        eq_(im.view(75, 80, 1, 1).tostring(), b'\xa0\xa0\xa0\xff')
++        assert im.view(100, 120, 1, 1).tostring() == b'\xa0\xa0\xa0\xff'
++        assert im.view(75, 80, 1, 1).tostring() == b'\xa0\xa0\xa0\xff'
+         # 808080
+-        eq_(im.view(74, 170, 1, 1).tostring(), b'\x80\x80\x80\xff')
+-        eq_(im.view(30, 50, 1, 1).tostring(), b'\x80\x80\x80\xff')
++        assert im.view(74, 170, 1, 1).tostring() == b'\x80\x80\x80\xff'
++        assert im.view(30, 50, 1, 1).tostring() == b'\x80\x80\x80\xff'
+         # 404040
+-        eq_(im.view(190, 70, 1, 1).tostring(), b'\x40\x40\x40\xff')
+-        eq_(im.view(140, 170, 1, 1).tostring(), b'\x40\x40\x40\xff')
++        assert im.view(190, 70, 1, 1).tostring() == b'\x40\x40\x40\xff'
++        assert im.view(140, 170, 1, 1).tostring() == b'\x40\x40\x40\xff'
+ 
+         # Now zoom over a portion of the env (1/10)
+         newenv = mapnik.Box2d(273663, 4024478, 330738, 4072303)
+@@ -230,16 +230,16 @@ if 'pgraster' in mapnik.DatasourceCache.
+         lap = time.time() - t0
+         log('T ' + str(lap) + ' -- ' + lbl + ' E:1/10')
+         # nodata
+-        eq_(hexlify(im.view(255, 255, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(200, 254, 1, 1).tostring()), b'00000000')
++        assert hexlify(im.view(255, 255, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(200, 254, 1, 1).tostring()) == b'00000000'
+         # A0A0A0
+-        eq_(hexlify(im.view(90, 232, 1, 1).tostring()), b'a0a0a0ff')
+-        eq_(hexlify(im.view(96, 245, 1, 1).tostring()), b'a0a0a0ff')
++        assert hexlify(im.view(90, 232, 1, 1).tostring()) == b'a0a0a0ff'
++        assert hexlify(im.view(96, 245, 1, 1).tostring()) == b'a0a0a0ff'
+         # 808080
+-        eq_(hexlify(im.view(1, 1, 1, 1).tostring()), b'808080ff')
+-        eq_(hexlify(im.view(128, 128, 1, 1).tostring()), b'808080ff')
++        assert hexlify(im.view(1, 1, 1, 1).tostring()) == b'808080ff'
++        assert hexlify(im.view(128, 128, 1, 1).tostring()) == b'808080ff'
+         # 404040
+-        eq_(hexlify(im.view(255, 0, 1, 1).tostring()), b'404040ff')
++        assert hexlify(im.view(255, 0, 1, 1).tostring()) == b'404040ff'
+ 
+     def _test_dataraster_16bsi(lbl, tilesize, constraint, overview):
+         import_raster(
+@@ -279,7 +279,7 @@ if 'pgraster' in mapnik.DatasourceCache.
+                              prescale_rasters=rescale, clip_rasters=clip)
+         fs = ds.featureset()
+         feature = fs.next()
+-        eq_(feature['rid'], 1)
++        assert feature['rid'] == 1
+         lyr = mapnik.Layer('rgba_8bui')
+         lyr.datasource = ds
+         expenv = mapnik.Box2d(0, -210, 256, 0)
+@@ -293,10 +293,10 @@ if 'pgraster' in mapnik.DatasourceCache.
+         # NOTE: the overview table extent only grows north and east
+         pixsize = 1  # see gdalinfo river.tif
+         tol = pixsize * max(overview.split(',')) if overview else 0
+-        assert_almost_equal(env.minx, expenv.minx)
+-        assert_almost_equal(env.miny, expenv.miny, delta=tol)
+-        assert_almost_equal(env.maxx, expenv.maxx, delta=tol)
+-        assert_almost_equal(env.maxy, expenv.maxy)
++        assert env.minx == pytest.approx(expenv.minx, abs=1e-7)
++        assert env.miny == pytest.approx(expenv.miny, abs=tol)
++        assert env.maxx == pytest.approx(expenv.maxx, abs=tol)
++        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-7)
+         mm = mapnik.Map(256, 256)
+         style = mapnik.Style()
+         sym = mapnik.RasterSymbolizer()
+@@ -316,10 +316,10 @@ if 'pgraster' in mapnik.DatasourceCache.
+             lyr.name, lbl, overview, clip)
+         compare_images(expected, im)
+         # no data
+-        eq_(hexlify(im.view(3, 3, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(250, 250, 1, 1).tostring()), b'00000000')
++        assert hexlify(im.view(3, 3, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(250, 250, 1, 1).tostring()) == b'00000000'
+         # full opaque river color
+-        eq_(hexlify(im.view(175, 118, 1, 1).tostring()), b'b9d8f8ff')
++        assert hexlify(im.view(175, 118, 1, 1).tostring()) == b'b9d8f8ff'
+         # half-transparent pixel
+         pxstr = hexlify(im.view(122, 138, 1, 1).tostring()).decode()
+         apat = ".*(..)$"
+@@ -341,10 +341,10 @@ if 'pgraster' in mapnik.DatasourceCache.
+             lyr.name, lbl, overview, clip)
+         compare_images(expected, im)
+         # no data
+-        eq_(hexlify(im.view(255, 255, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(200, 40, 1, 1).tostring()), b'00000000')
++        assert hexlify(im.view(255, 255, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(200, 40, 1, 1).tostring()) == b'00000000'
+         # full opaque river color
+-        eq_(hexlify(im.view(100, 168, 1, 1).tostring()), b'b9d8f8ff')
++        assert hexlify(im.view(100, 168, 1, 1).tostring()) == b'b9d8f8ff'
+         # half-transparent pixel
+         pxstr = hexlify(im.view(122, 138, 1, 1).tostring()).decode()
+         apat = ".*(..)$"
+@@ -390,7 +390,7 @@ if 'pgraster' in mapnik.DatasourceCache.
+                              prescale_rasters=rescale, clip_rasters=clip)
+         fs = ds.featureset()
+         feature = fs.next()
+-        eq_(feature['rid'], 1)
++        assert feature['rid'] == 1
+         lyr = mapnik.Layer('rgba_8bui')
+         lyr.datasource = ds
+         expenv = mapnik.Box2d(-12329035.7652168, 4508650.39854396,
+@@ -405,10 +405,10 @@ if 'pgraster' in mapnik.DatasourceCache.
+         # NOTE: the overview table extent only grows north and east
+         pixsize = 2  # see gdalinfo nodata-edge.tif
+         tol = pixsize * max(overview.split(',')) if overview else 0
+-        assert_almost_equal(env.minx, expenv.minx, places=0)
+-        assert_almost_equal(env.miny, expenv.miny, delta=tol)
+-        assert_almost_equal(env.maxx, expenv.maxx, delta=tol)
+-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
++        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
++        assert env.miny == pytest.approx(expenv.miny, abs=tol)
++        assert env.maxx == pytest.approx(expenv.maxx, abs=tol)
++        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
+         mm = mapnik.Map(256, 256)
+         style = mapnik.Style()
+         sym = mapnik.RasterSymbolizer()
+@@ -428,16 +428,16 @@ if 'pgraster' in mapnik.DatasourceCache.
+             lyr.name, tnam, lbl, overview, clip)
+         compare_images(expected, im)
+         # no data
+-        eq_(hexlify(im.view(3, 16, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(128, 16, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(250, 16, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(3, 240, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(128, 240, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(250, 240, 1, 1).tostring()), b'00000000')
++        assert hexlify(im.view(3, 16, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(128, 16, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(250, 16, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(3, 240, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(128, 240, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(250, 240, 1, 1).tostring()) == b'00000000'
+         # dark brown
+-        eq_(hexlify(im.view(174, 39, 1, 1).tostring()), b'c3a698ff')
++        assert hexlify(im.view(174, 39, 1, 1).tostring()) == b'c3a698ff'
+         # dark gray
+-        eq_(hexlify(im.view(195, 132, 1, 1).tostring()), b'575f62ff')
++        assert hexlify(im.view(195, 132, 1, 1).tostring()) == b'575f62ff'
+         # Now zoom over a portion of the env (1/10)
+         newenv = mapnik.Box2d(-12329035.7652168, 4508926.651484220,
+                               -12328997.49148983, 4508957.34625536)
+@@ -451,17 +451,17 @@ if 'pgraster' in mapnik.DatasourceCache.
+             lyr.name, tnam, lbl, overview, clip)
+         compare_images(expected, im)
+         # no data
+-        eq_(hexlify(im.view(3, 16, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(128, 16, 1, 1).tostring()), b'00000000')
+-        eq_(hexlify(im.view(250, 16, 1, 1).tostring()), b'00000000')
++        assert hexlify(im.view(3, 16, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(128, 16, 1, 1).tostring()) == b'00000000'
++        assert hexlify(im.view(250, 16, 1, 1).tostring()) == b'00000000'
+         # black
+-        eq_(hexlify(im.view(3, 42, 1, 1).tostring()), b'000000ff')
+-        eq_(hexlify(im.view(3, 134, 1, 1).tostring()), b'000000ff')
+-        eq_(hexlify(im.view(3, 244, 1, 1).tostring()), b'000000ff')
++        assert hexlify(im.view(3, 42, 1, 1).tostring()) == b'000000ff'
++        assert hexlify(im.view(3, 134, 1, 1).tostring()) == b'000000ff'
++        assert hexlify(im.view(3, 244, 1, 1).tostring()) == b'000000ff'
+         # gray
+-        eq_(hexlify(im.view(135, 157, 1, 1).tostring()), b'4e555bff')
++        assert hexlify(im.view(135, 157, 1, 1).tostring()) == b'4e555bff'
+         # brown
+-        eq_(hexlify(im.view(195, 223, 1, 1).tostring()), b'f2cdbaff')
++        assert hexlify(im.view(195, 223, 1, 1).tostring()) == b'f2cdbaff'
+ 
+     def _test_rgb_8bui(lbl, tilesize, constraint, overview):
+         tnam = 'nodataedge'
+@@ -524,15 +524,15 @@ if 'pgraster' in mapnik.DatasourceCache.
+                              prescale_rasters=rescale, clip_rasters=clip)
+         fs = ds.featureset()
+         feature = fs.next()
+-        eq_(feature['i'], 3)
++        assert feature['i'] == 3
+         lyr = mapnik.Layer('grayscale_subquery')
+         lyr.datasource = ds
+         expenv = mapnik.Box2d(0, 0, 14, 14)
+         env = lyr.envelope()
+-        assert_almost_equal(env.minx, expenv.minx, places=0)
+-        assert_almost_equal(env.miny, expenv.miny, places=0)
+-        assert_almost_equal(env.maxx, expenv.maxx, places=0)
+-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
++        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
++        assert env.miny == pytest.approx(expenv.miny, abs=1e-0)
++        assert env.maxx == pytest.approx(expenv.maxx, abs=1e-0)
++        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
+         mm = mapnik.Map(15, 15)
+         style = mapnik.Style()
+         sym = mapnik.RasterSymbolizer()
+@@ -560,15 +560,15 @@ if 'pgraster' in mapnik.DatasourceCache.
+         h = format(val_b, '02x')
+         hex_b = h + h + h + 'ff'
+         hex_b = hex_b.encode()
+-        eq_(hexlify(im.view(3, 3, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(8, 3, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(13, 3, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(3, 8, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(8, 8, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(13, 8, 1, 1).tostring()), hex_a)
+-        eq_(hexlify(im.view(3, 13, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(8, 13, 1, 1).tostring()), hex_b)
+-        eq_(hexlify(im.view(13, 13, 1, 1).tostring()), hex_v)
++        assert hexlify(im.view(3, 3, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(8, 3, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(13, 3, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(3, 8, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(8, 8, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(13, 8, 1, 1).tostring()) == hex_a
++        assert hexlify(im.view(3, 13, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(8, 13, 1, 1).tostring()) == hex_b
++        assert hexlify(im.view(13, 13, 1, 1).tostring()) == hex_v
+ 
+     def test_grayscale_2bui_subquery():
+         _test_grayscale_subquery('grayscale_2bui_subquery', '2BUI', 3)
+@@ -637,15 +637,15 @@ if 'pgraster' in mapnik.DatasourceCache.
+                              band=1, prescale_rasters=rescale, clip_rasters=clip)
+         fs = ds.featureset()
+         feature = fs.next()
+-        eq_(feature['i'], 3)
++        assert feature['i'] == 3
+         lyr = mapnik.Layer('data_subquery')
+         lyr.datasource = ds
+         expenv = mapnik.Box2d(0, 0, 14, 14)
+         env = lyr.envelope()
+-        assert_almost_equal(env.minx, expenv.minx, places=0)
+-        assert_almost_equal(env.miny, expenv.miny, places=0)
+-        assert_almost_equal(env.maxx, expenv.maxx, places=0)
+-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
++        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
++        assert env.miny == pytest.approx(expenv.miny, abs=1e-0)
++        assert env.maxx == pytest.approx(expenv.maxx, abs=1e-0)
++        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
+         mm = mapnik.Map(15, 15)
+         style = mapnik.Style()
+         col = mapnik.RasterColorizer()
+@@ -761,15 +761,15 @@ if 'pgraster' in mapnik.DatasourceCache.
+                              prescale_rasters=rescale, clip_rasters=clip)
+         fs = ds.featureset()
+         feature = fs.next()
+-        eq_(feature['i'], 3)
++        assert feature['i'] == 3
+         lyr = mapnik.Layer('rgba_subquery')
+         lyr.datasource = ds
+         expenv = mapnik.Box2d(0, 0, 14, 14)
+         env = lyr.envelope()
+-        assert_almost_equal(env.minx, expenv.minx, places=0)
+-        assert_almost_equal(env.miny, expenv.miny, places=0)
+-        assert_almost_equal(env.maxx, expenv.maxx, places=0)
+-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
++        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
++        assert env.miny == pytest.approx(expenv.miny, abs=1e-0)
++        assert env.maxx == pytest.approx(expenv.maxx, abs=1e-0)
++        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
+         mm = mapnik.Map(15, 15)
+         style = mapnik.Style()
+         sym = mapnik.RasterSymbolizer()
+@@ -791,15 +791,15 @@ if 'pgraster' in mapnik.DatasourceCache.
+         hex_v = format(r << 24 | g << 16 | b << 8 | a, '08x').encode()
+         hex_a = format(r << 24 | g1 << 16 | b << 8 | a, '08x').encode()
+         hex_b = format(r << 24 | g << 16 | b1 << 8 | a, '08x').encode()
+-        eq_(hexlify(im.view(3, 3, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(8, 3, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(13, 3, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(3, 8, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(8, 8, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(13, 8, 1, 1).tostring()), hex_a)
+-        eq_(hexlify(im.view(3, 13, 1, 1).tostring()), hex_v)
+-        eq_(hexlify(im.view(8, 13, 1, 1).tostring()), hex_b)
+-        eq_(hexlify(im.view(13, 13, 1, 1).tostring()), hex_v)
++        assert hexlify(im.view(3, 3, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(8, 3, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(13, 3, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(3, 8, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(8, 8, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(13, 8, 1, 1).tostring()) == hex_a
++        assert hexlify(im.view(3, 13, 1, 1).tostring()) == hex_v
++        assert hexlify(im.view(8, 13, 1, 1).tostring()) == hex_b
++        assert hexlify(im.view(13, 13, 1, 1).tostring()) == hex_v
+ 
+     def test_rgba_8bui_subquery():
+         _test_rgba_subquery(
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -55,7 +55,7 @@ before_install:
+      sudo easy_install pip;
+      export LDSHARED=$(python -c "import os;from distutils import sysconfig;print sysconfig.get_config_var('LDSHARED').replace('cc ','clang++ ')");
+    fi
+- - pip install --upgrade --user nose
++ - pip install --upgrade --user pytest
+  - pip install --upgrade --user wheel
+  - pip install --upgrade --user twine
+  - pip install --upgrade --user setuptools
+@@ -72,7 +72,7 @@ before_script:
+  - ./mason_packages/.link/bin/postgres -k ${PGHOST} > postgres.log &
+ 
+ script:
+- - python test/run_tests.py
++ - python -m pytest -v test/
+  - python test/visual.py -q
+  # stop postgres
+  - ./mason_packages/.link/bin/pg_ctl -w stop
+--- a/test/run_tests.py
++++ /dev/null
+@@ -1,112 +0,0 @@
+-#!/usr/bin/env python
+-
+-import getopt
+-import os
+-import sys
+-
+-
+-from python_tests.utilities import TodoPlugin
+-
+-try:
+-    import nose
+-except ImportError as e:
+-    sys.stderr.write(
+-        "Unable to run python tests: the third party 'nose' module is required"
+-        "\nTo install 'nose' do:"
+-        "\n\tsudo pip install nose (or on debian systems: "
+-        "apt-get install python-nose): %s\n" % e)
+-    sys.exit(1)
+-else:
+-    from nose.plugins.doctests import Doctest
+-
+-
+-def usage():
+-    print("test.py -h | --help")
+-    print("test.py [-q | -v] [-p | --prefix <path>]")
+-
+-
+-def main():
+-    try:
+-        opts, args = getopt.getopt(sys.argv[1:], "hvqp:", ["help", "prefix="])
+-    except getopt.GetoptError as err:
+-        print(str(err))
+-        usage()
+-        sys.exit(2)
+-
+-    prefix = None
+-    verbose = False
+-    quiet = False
+-
+-    for o, a in opts:
+-        if o == "-q":
+-            quiet = True
+-        elif o == "-v":
+-            verbose = True
+-        elif o in ("-h", "--help"):
+-            usage()
+-            sys.exit()
+-        elif o in ("-p", "--prefix"):
+-            prefix = a
+-        else:
+-            assert False, "Unhandled option"
+-
+-    if quiet and verbose:
+-        usage()
+-        sys.exit(2)
+-
+-    if prefix:
+-        # Allow python to find libraries for testing on the buildbot
+-        sys.path.insert(
+-            0,
+-            os.path.join(
+-                prefix,
+-                "lib/python%s/site-packages" %
+-                sys.version[
+-                    :3]))
+-
+-    import mapnik
+-
+-    if not quiet:
+-        print("- mapnik path: %s" % mapnik.__file__)
+-        if hasattr(mapnik, '_mapnik'):
+-            print("- _mapnik.so path: %s" % mapnik._mapnik.__file__)
+-        if hasattr(mapnik, 'inputpluginspath'):
+-            print("- Input plugins path: %s" % mapnik.inputpluginspath)
+-        if 'MAPNIK_INPUT_PLUGINS_DIRECTORY' in os.environ:
+-            print("- MAPNIK_INPUT_PLUGINS_DIRECTORY env: %s" %
+-                  os.environ.get('MAPNIK_INPUT_PLUGINS_DIRECTORY'))
+-        if hasattr(mapnik, 'fontscollectionpath'):
+-            print("- Font path: %s" % mapnik.fontscollectionpath)
+-        if 'MAPNIK_FONT_DIRECTORY' in os.environ:
+-            print(
+-                "- MAPNIK_FONT_DIRECTORY env: %s" %
+-                os.environ.get('MAPNIK_FONT_DIRECTORY'))
+-        print('')
+-        print("- Running nosetests:")
+-        print('')
+-
+-    argv = [
+-        __file__,
+-        '--exe',
+-        '--with-todo',
+-        '--with-doctest',
+-        '--doctest-tests']
+-
+-    if not quiet:
+-        argv.append('-v')
+-
+-    if verbose:
+-        # 3 * '-v' gets us debugging information from nose
+-        argv.append('-v')
+-        argv.append('-v')
+-
+-    dirname = os.path.dirname(sys.argv[0])
+-    argv.extend(['-w', os.path.join(dirname, 'python_tests')])
+-
+-    if not nose.run(argv=argv, plugins=[TodoPlugin(), Doctest()]):
+-        sys.exit(1)
+-    else:
+-        sys.exit(0)
+-
+-if __name__ == "__main__":
+-    main()
+--- a/setup.cfg
++++ /dev/null
+@@ -1,2 +0,0 @@
+-[nosetests]
+-verbosity=1


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ clean.patch
 pycairo.patch
 test-failures.patch
 optional.patch
+nose2pytest.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-mapnik/-/commit/335853088f3bfe4ef2e74242251f7ad7f14966a0

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-mapnik/-/commit/335853088f3bfe4ef2e74242251f7ad7f14966a0
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/20240811/ca0a5d0a/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list