#2 Drop unnecessary BuildRequires on uvloop; fix Pillow 10 incompatibility
Merged 11 months ago by music. Opened 11 months ago by music.
rpms/ music/python-geotiler no-uvloop  into  rawhide

@@ -0,0 +1,16 @@ 

+ diff -Naur geotiler-0.14.7-original/setup.cfg geotiler-0.14.7/setup.cfg

+ --- geotiler-0.14.7-original/setup.cfg	2023-07-31 18:51:55.975315601 -0400

+ +++ geotiler-0.14.7/setup.cfg	2023-07-31 18:52:49.325050815 -0400

+ @@ -33,10 +33,10 @@

+  	setuptools

+  

+  [options.extras_require]

+ -tests = mypy; pytest-cov; pytest-timeout; pytest-asyncio; numpy

+ +tests = pytest-timeout; pytest-asyncio; numpy

+  

+  [tool:pytest]

+ -addopts = --cov geotiler --cov-report=term-missing

+ +addopts =

+  

+  [tool:coverage:report]

+  show_missing = 1

@@ -0,0 +1,44 @@ 

+ From 5e0cfbafcda83ca14cfe6c63b2a791d4ad6c338b Mon Sep 17 00:00:00 2001

+ From: wrobell <wrobell@riseup.net>

+ Date: Mon, 31 Jul 2023 21:54:13 +0100

+ Subject: [PATCH] Update GeoTiler to use Pillow newer API

+ 

+ Some Pillow API got deprecated, so let's use the latest version of the

+ library.

+ ---

+  geotiler/tile/img.py | 8 ++++++--

+  setup.cfg            | 2 +-

+  2 files changed, 7 insertions(+), 3 deletions(-)

+ 

+ diff --git a/geotiler/tile/img.py b/geotiler/tile/img.py

+ index d5349a0..aa775b4 100644

+ --- a/geotiler/tile/img.py

+ +++ b/geotiler/tile/img.py

+ @@ -84,8 +84,12 @@ def _error_image(width, height):

+      img = PIL.Image.new('RGBA', (width, height))

+      draw = PIL.ImageDraw.Draw(img)

+      msg = 'Error downloading map tile.'

+ -    tw, th = draw.textsize(msg)

+ -    draw.text(((width - tw) // 2, (height - th) // 2), msg, 'red')

+ +    x0 = width / 2

+ +    y0 = height / 2

+ +    bb_l, bb_t, bb_r, bb_b = draw.textbbox((int(x0), int(y0)), msg)

+ +    x = x0 + (bb_r - bb_l) / 2

+ +    y = y0 + (bb_b - bb_t) / 2

+ +    draw.text((int(x), int(y)), msg, 'red')

+      return img

+  

+  def _tile_image(data):

+ diff --git a/setup.cfg b/setup.cfg

+ index bc9b04e..170303a 100644

+ --- a/setup.cfg

+ +++ b/setup.cfg

+ @@ -28,7 +28,7 @@ scripts =

+  	bin/geotiler-route

+  	bin/geotiler-fetch

+  install_requires = 

+ -	Pillow

+ +	Pillow >= 10.0.0

+  	cytoolz >= 0.8.2

+  	aiohttp >= 2.3.5

+  	setuptools

@@ -0,0 +1,12 @@ 

+ diff -Naur geotiler-0.14.7-original/setup.cfg geotiler-0.14.7/setup.cfg

+ --- geotiler-0.14.7-original/setup.cfg	2022-12-29 11:07:21.959903200 -0500

+ +++ geotiler-0.14.7/setup.cfg	2023-07-30 13:32:37.167893223 -0400

+ @@ -33,7 +33,7 @@

+  	setuptools

+  

+  [options.extras_require]

+ -tests = mypy; pytest-cov; pytest-timeout; pytest-asyncio; uvloop

+ +tests = mypy; pytest-cov; pytest-timeout; pytest-asyncio; numpy

+  

+  [tool:pytest]

+  addopts = --cov geotiler --cov-report=term-missing

file modified
+21 -2
@@ -11,7 +11,7 @@ 

  

  Name:           python-%{pypi_name}

  Version:        0.14.7

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        GeoTiler is a library to create map using tiles from a map provider

  

  License:        GPLv3+
@@ -32,6 +32,20 @@ 

  Source3:        geotiler-lint.1

  Source4:        geotiler-route.1

  

+ # Adjust dependencies for tests extra

+ # Drop uvloop, which seems to be unused.

+ # Add numpy, which is imported directly in the test suite.

+ # https://github.com/wrobell/geotiler/pull/37

+ # Rebased on the PyPI sdist, which has different whitespace in setup.cfg.

+ Patch:          geotiler-0.14.7-tests.patch

+ # Update GeoTiler to use Pillow newer API

+ # https://github.com/wrobell/geotiler/commit/5e0cfbafcda83ca14cfe6c63b2a791d4ad6c338b

+ # Rebased on the 0.14.7 PyPI sdist (whitespace differs in setup.cfg)

+ Patch:          geotiler-0.14.7-pillow10.patch

+ # Downstream-only: patch out linting and coverage dependencies

+ # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters

+ Patch:          geotiler-0.14.7-linters.patch

+ 

  BuildRequires:  python3-devel

  BuildRequires:  make

  
@@ -71,7 +85,7 @@ 

  Documentation for %{name}.

  

  %prep

- %autosetup -n %{pypi_name}-%{version}

+ %autosetup -n %{pypi_name}-%{version} -p1

  cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .

  

  rm -fv poetry.lock
@@ -124,6 +138,11 @@ 

  %doc _latex/geotiler.pdf

  

  %changelog

+ * Mon Jul 31 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.14.7-4

+ - Patch out unused uvloop test dependency

+ - Patch for Pillow 10 (fix RHBZ#2220253, fix RHBZ#2226199)

+ - Patch out unwanted linting and coverage test dependencies

+ 

  * Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.7-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

  

https://github.com/wrobell/geotiler/pull/37

Also patches out the pytest-cov dependency.

This still FTBFS on F39/Rawhide due to also fixes a Pillow 10 incompatibility, https://github.com/wrobell/geotiler/issues/36.

Thanks, Ben. Now neuro-sig has also "commit" rights. So please merge when completed.

rebased onto cdd1ece

11 months ago

Pull-Request has been merged by music

11 months ago