From 5c4b8c5612bffd962d3856f011f5afecd24f67bb Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 21 Dec 2023 18:09:14 +0800 Subject: [PATCH] Pass python_requires argument to setuptools Signed-off-by: zhang-liang-pengkun --- ...thon_requires-argument-to-setuptools.patch | 40 +++++++++++++++++++ python-imagesize.spec | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 0003-Pass-python_requires-argument-to-setuptools.patch diff --git a/0003-Pass-python_requires-argument-to-setuptools.patch b/0003-Pass-python_requires-argument-to-setuptools.patch new file mode 100644 index 0000000..f891ffe --- /dev/null +++ b/0003-Pass-python_requires-argument-to-setuptools.patch @@ -0,0 +1,40 @@ +From a1dab8487f8fdfdab4429dbe8ff1683907f08c48 Mon Sep 17 00:00:00 2001 +From: Jon Dufresne +Date: Thu, 12 Apr 2018 04:15:49 -0700 +Subject: [PATCH] Pass python_requires argument to setuptools + +Helps pip decide what version of the library to install. + +https://packaging.python.org/tutorials/distributing-packages/#python-requires + +> If your project only runs on certain Python versions, setting the +> python_requires argument to the appropriate PEP 440 version specifier +> string will prevent pip from installing the project on other Python +> versions. + +https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords + +> python_requires +> +> A string corresponding to a version specifier (as defined in PEP 440) +> for the Python version, used to specify the Requires-Python defined in +> PEP 345. +--- + setup.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.py b/setup.py +index bf3f7c3..06f2946 100644 +--- a/setup.py ++++ b/setup.py +@@ -21,6 +21,7 @@ This is a pure Python library. + license="MIT", + py_modules=['imagesize'], + test_suite='test', ++ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', +-- +2.39.0.windows.2 + diff --git a/python-imagesize.spec b/python-imagesize.spec index 6f30720..d38e7d2 100644 --- a/python-imagesize.spec +++ b/python-imagesize.spec @@ -1,12 +1,13 @@ Name: python-imagesize Version: 1.1.0 -Release: 3 +Release: 4 Summary: This module analyzes image headers and returns image size. License: MIT URL: https://github.com/shibukawa/imagesize_py Source0: https://files.pythonhosted.org/packages/source/i/imagesize/imagesize-%{version}.tar.gz Patch01: 0001-Added-return-types-to-docstrings-and-fixed-descripti.patch Patch02: 0002-Support-SVG-Image.patch +Patch03: 0003-Pass-python_requires-argument-to-setuptools.patch BuildArch: noarch BuildRequires: python2-setuptools python2-devel python2-pytest python3-setuptools BuildRequires: python3-devel python3-pytest @@ -50,6 +51,9 @@ py.test-3 %{python3_sitelib}/* %changelog +* Thu Oct 23 2023 zhangliangpengkun - 1.1.0-4 +- Pass python_requires argument to setuptools + * Thu Nov 09 2023 zhangliangpengkun - 1.1.0-3 - Support SVG Image