From 6ebdac027e0735777ed4adbc665c90292e86af4c Mon Sep 17 00:00:00 2001 From: JamesParrott <80779630+JamesParrott@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:40:58 +0100 Subject: [PATCH] Add draft user warning --- shapefile.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/shapefile.py b/shapefile.py index 12af74d..b924b24 100644 --- a/shapefile.py +++ b/shapefile.py @@ -14,7 +14,9 @@ import os import sys import tempfile +import textwrap import time +import warnings import zipfile from datetime import date from struct import Struct, calcsize, error, pack, unpack @@ -93,6 +95,27 @@ from urllib2 import HTTPError, Request, urlopen from urlparse import urlparse, urlunparse +if sys.version_info < (3, 9): + warnings.showwarning( + textwrap.dedent("""\ + Warning! + + The PyShp developers propose to drop support for Pythons 3.8 and earlier, including Python 2. + Thereafter, Python version support will follow the official Python release + cycle: https://devguide.python.org/versions/. This will make Python 3.9 the earliest + supported version until October 2025. + + The reasoning behind this is available in the following discussion: + https://github.com/GeospatialPython/pyshp/discussions/290 + Please post any feedback there. + + Many thanks, + """), + category=UserWarning, + filename=__name__, + lineno=99, + ) + # Helpers