Bug#1059098: python-ulmo: please remove dependency on python3-future, this module is incompatible with Py3.12

Alexandre Detiste alexandre.detiste at gmail.com
Wed Dec 20 09:32:07 GMT 2023


Source: python-ulmo
Version: 0.8.8+dfsg1-1.1
Severity: important

Dear Maintainer,

python3-future was a Python2 -> Python3 translation layer.

It is not maintained and not anymore compatible with Python3.12

Please use attached patch to remove it's usage.

Greetings


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (501, 'testing'), (450, 'unstable'), (400, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-5-amd64 (SMP w/2 CPU threads; PREEMPT)
Kernel taint flags: TAINT_USER
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8), LANGUAGE=fr_BE:fr
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
>From ee30a679fec81221352445e1e09f0a7e4947c955 Mon Sep 17 00:00:00 2001
From: Alexandre Detiste <tchet at debian.org>
Date: Wed, 20 Dec 2023 10:27:52 +0100
Subject: [PATCH] remove usage of python3-future, this module is not compatible
 with Py3.12

---
 debian/control               |  1 -
 requirements.txt             |  1 -
 test/cirs_test.py            |  2 +-
 test/test_util.py            |  3 +--
 tox.ini                      |  1 -
 ulmo/cpc/drought/core.py     |  7 +------
 ulmo/cuahsi/wof/core.py      |  3 ---
 ulmo/nasa/daymet/core.py     |  7 ++-----
 ulmo/ncdc/cirs/core.py       |  4 +---
 ulmo/ncdc/ghcn_daily/core.py |  4 +---
 ulmo/ncdc/gsod/core.py       |  4 +---
 ulmo/ncdc/gsod/pytables.py   |  3 +--
 ulmo/usace/swtwc/core.py     |  5 -----
 ulmo/usgs/ned/core.py        | 21 ++++++++++-----------
 ulmo/usgs/nwis/core.py       |  5 +----
 ulmo/usgs/nwis/hdf5.py       |  4 +---
 ulmo/util/misc.py            |  7 +------
 ulmo/util/raster.py          |  5 ++---
 ulmo/waterml/common.py       |  2 +-
 19 files changed, 25 insertions(+), 64 deletions(-)

diff --git a/debian/control b/debian/control
index 1601440..1de86c9 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,6 @@ Build-Depends: debhelper (>= 12),
                python3-bs4,
                python3-doc,
                python3-freezegun,
-               python3-future,
                python3-geojson,
                python3-html5lib,
                python3-httpretty,
diff --git a/requirements.txt b/requirements.txt
index 3af2ccf..1d07949 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,5 @@
 appdirs
 beautifulsoup4
-future
 geojson
 isodate
 lxml
diff --git a/test/cirs_test.py b/test/cirs_test.py
index 905fe58..2438e80 100644
--- a/test/cirs_test.py
+++ b/test/cirs_test.py
@@ -1,4 +1,4 @@
-from past.builtins import basestring
+basestring = str
 import copy
 
 import numpy as np
diff --git a/test/test_util.py b/test/test_util.py
index bef9a41..a9dd6c4 100644
--- a/test/test_util.py
+++ b/test/test_util.py
@@ -1,5 +1,4 @@
-from builtins import zip
-from past.builtins import basestring
+basestring = str
 import contextlib
 import os
 import os.path
diff --git a/tox.ini b/tox.ini
index ecc1a1c..b9cce07 100644
--- a/tox.ini
+++ b/tox.ini
@@ -13,5 +13,4 @@ commands=
     pip install numexpr
     pip install pandas
     pip install tables
-    pip install future
     py.test {posargs}
diff --git a/ulmo/cpc/drought/core.py b/ulmo/cpc/drought/core.py
index 28cf15a..95c88ec 100644
--- a/ulmo/cpc/drought/core.py
+++ b/ulmo/cpc/drought/core.py
@@ -8,11 +8,6 @@
     .. _Climate Prediction Center: http://www.cpc.ncep.noaa.gov/
     .. _Weekly Drought Index: http://www.cpc.ncep.noaa.gov/products/analysis_monitoring/cdus/palmer_drought/
 """
-from __future__ import division
-from builtins import str
-from builtins import range
-from past.utils import old_div
-
 import datetime
 import os
 import requests
@@ -338,4 +333,4 @@ def _week_number(date):
     if date_ts < first_sunday_ts:
         first_sunday_ts = pandas.Timestamp(_first_sunday(date.year - 1))
     days_since_first_sunday = (date_ts - first_sunday_ts).days
-    return (first_sunday_ts.year, (old_div(days_since_first_sunday, 7)) + 1)
+    return (first_sunday_ts.year, (days_since_first_sunday // 7) + 1)
diff --git a/ulmo/cuahsi/wof/core.py b/ulmo/cuahsi/wof/core.py
index 06a07e0..fc1cb31 100644
--- a/ulmo/cuahsi/wof/core.py
+++ b/ulmo/cuahsi/wof/core.py
@@ -5,10 +5,7 @@
 
     .. _CUAHSI WaterOneFlow: https://his.cuahsi.org/wofws.html
 """
-from future import standard_library
-standard_library.install_aliases()
 import os
-from builtins import str
 import io
 
 import suds.client
diff --git a/ulmo/nasa/daymet/core.py b/ulmo/nasa/daymet/core.py
index 89e6878..ef5bd86 100644
--- a/ulmo/nasa/daymet/core.py
+++ b/ulmo/nasa/daymet/core.py
@@ -8,10 +8,7 @@
     .. _NASA EARTHDATA ORNL DAAC Daymet: https://daymet.ornl.gov/dataaccess.html
 
 """
-from future import standard_library
-standard_library.install_aliases()
-from builtins import str
-from past.builtins import basestring
+basestring = str
 import contextlib
 import io
 import datetime
@@ -172,4 +169,4 @@ def _get_service_url(url_params):
 
     if 'years' in url_params:
         url += "&year={}".format(url_params['years'])
-    return url
\ No newline at end of file
+    return url
diff --git a/ulmo/ncdc/cirs/core.py b/ulmo/ncdc/cirs/core.py
index 2ec24cc..1000145 100644
--- a/ulmo/ncdc/cirs/core.py
+++ b/ulmo/ncdc/cirs/core.py
@@ -8,9 +8,7 @@
     .. _National Climatic Data Center: http://www.ncdc.noaa.gov
     .. _Climate Index Reference Sequential (CIRS): http://www1.ncdc.noaa.gov/pub/data/cirs/
 """
-from builtins import str
-from builtins import range
-from past.builtins import basestring
+basestring = str
 import distutils.version
 import os.path
 
diff --git a/ulmo/ncdc/ghcn_daily/core.py b/ulmo/ncdc/ghcn_daily/core.py
index 09582c8..47e6107 100644
--- a/ulmo/ncdc/ghcn_daily/core.py
+++ b/ulmo/ncdc/ghcn_daily/core.py
@@ -10,9 +10,7 @@
     .. _Global Historical Climate Network - Daily: http://www.ncdc.noaa.gov/oa/climate/ghcn-daily/
 
 """
-from builtins import str
-from builtins import range
-from past.builtins import basestring
+basestring = str
 import itertools
 import os
 
diff --git a/ulmo/ncdc/gsod/core.py b/ulmo/ncdc/gsod/core.py
index 2bb6816..7a777c2 100644
--- a/ulmo/ncdc/gsod/core.py
+++ b/ulmo/ncdc/gsod/core.py
@@ -8,9 +8,7 @@
     .. _National Climatic Data Center: http://www.ncdc.noaa.gov
     .. _Global Summary of the Day: http://www.ncdc.noaa.gov/oa/gsod.html
 """
-from builtins import str
-from builtins import range
-from past.builtins import basestring
+basestring = str
 from contextlib import contextmanager
 import csv
 import datetime
diff --git a/ulmo/ncdc/gsod/pytables.py b/ulmo/ncdc/gsod/pytables.py
index e4657b9..86f3816 100644
--- a/ulmo/ncdc/gsod/pytables.py
+++ b/ulmo/ncdc/gsod/pytables.py
@@ -1,5 +1,4 @@
-from builtins import range
-from past.builtins import basestring
+basestring = str
 import datetime
 
 import tables
diff --git a/ulmo/usace/swtwc/core.py b/ulmo/usace/swtwc/core.py
index c3ce8b5..711d4af 100644
--- a/ulmo/usace/swtwc/core.py
+++ b/ulmo/usace/swtwc/core.py
@@ -9,11 +9,6 @@
     .. _Tulsa District Water Control: http://www.swt-wc.usace.army.mil/
 
 """
-from future import standard_library
-standard_library.install_aliases()
-from builtins import str
-from builtins import zip
-from builtins import range
 import datetime
 import os.path
 
diff --git a/ulmo/usgs/ned/core.py b/ulmo/usgs/ned/core.py
index 58ee8c9..b403742 100644
--- a/ulmo/usgs/ned/core.py
+++ b/ulmo/usgs/ned/core.py
@@ -10,8 +10,7 @@
     .. _National Map: http://nationalmap.gov
 
 """
-from __future__ import print_function
-from past.builtins import basestring
+basestring = str
 
 from geojson import Feature, FeatureCollection, Polygon
 import logging
@@ -158,15 +157,15 @@ def get_raster(layer, bbox, path=None, update_cache=False,
 
     return raster_tiles
 
-def _check_layer(layer):
-    """
-    make sure the passed layer name is one of the handled options
-    """
-
-    if not layer in get_available_layers():
-        err_msg = "The specified layer parameter ({})".format(layer)
-        err_msg += "\nis not in the available options:"
-        err_msg += "\n\t".join(get_available_layers())
+def _check_layer(layer):
+    """
+    make sure the passed layer name is one of the handled options
+    """
+
+    if not layer in get_available_layers():
+        err_msg = "The specified layer parameter ({})".format(layer)
+        err_msg += "\nis not in the available options:"
+        err_msg += "\n\t".join(get_available_layers())
         raise ValueError(err_msg)
 
 
diff --git a/ulmo/usgs/nwis/core.py b/ulmo/usgs/nwis/core.py
index f603294..acc133d 100644
--- a/ulmo/usgs/nwis/core.py
+++ b/ulmo/usgs/nwis/core.py
@@ -8,10 +8,7 @@
     .. _USGS National Water Information System: http://waterdata.usgs.gov/nwis
 
 """
-from future import standard_library
-standard_library.install_aliases()
-from builtins import str
-from past.builtins import basestring
+basestring = str
 import contextlib
 import io
 import datetime
diff --git a/ulmo/usgs/nwis/hdf5.py b/ulmo/usgs/nwis/hdf5.py
index 9ac904f..74e4e04 100644
--- a/ulmo/usgs/nwis/hdf5.py
+++ b/ulmo/usgs/nwis/hdf5.py
@@ -1,6 +1,4 @@
-from builtins import map
-from builtins import zip
-from past.builtins import basestring
+basestring = str
 import contextlib
 import copy
 from datetime import datetime
diff --git a/ulmo/util/misc.py b/ulmo/util/misc.py
index 6054836..baff82c 100644
--- a/ulmo/util/misc.py
+++ b/ulmo/util/misc.py
@@ -1,9 +1,4 @@
-from future import standard_library
-standard_library.install_aliases()
-from builtins import zip
-from builtins import str
-from past.builtins import basestring
-from builtins import object
+basestring = str
 from contextlib import contextmanager
 import datetime
 import email.utils
diff --git a/ulmo/util/raster.py b/ulmo/util/raster.py
index fe2d154..74fd39e 100644
--- a/ulmo/util/raster.py
+++ b/ulmo/util/raster.py
@@ -4,8 +4,7 @@
 
    Collection of useful functions for raster manipulation
 """
-from __future__ import print_function
-from past.builtins import basestring
+basestring = str
 
 import contextlib
 import hashlib
@@ -70,4 +69,4 @@ def extract_from_zip(zip_path, tile_path, tile_fmt):
 
 
 def generate_raster_uid(layer, xmin, ymin, xmax, ymax):
-    return hashlib.md5(','.join([layer, repr(xmin), repr(ymin), repr(xmax), repr(ymax)])).hexdigest()
\ No newline at end of file
+    return hashlib.md5(','.join([layer, repr(xmin), repr(ymin), repr(xmax), repr(ymax)])).hexdigest()
diff --git a/ulmo/waterml/common.py b/ulmo/waterml/common.py
index 483a0af..d9a9815 100644
--- a/ulmo/waterml/common.py
+++ b/ulmo/waterml/common.py
@@ -1,7 +1,7 @@
 import isodate
 
 from lxml import etree
-from past.builtins import basestring
+basestring = str
 
 from ulmo import util
 
-- 
2.43.0



More information about the debian-science-maintainers mailing list