From 69da1fc85e978025450287d6b59d204281733731 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Thu, 28 May 2026 17:06:10 +0200 Subject: [PATCH] Update to 8.0 - Resolves: RHEL-155709 Upgrade python-qrcode in RHEL 9 with the version from RHEL 10 Signed-off-by: Florence Blanc-Renaud --- .gitignore | 1 + flit-pyproject.toml.in | 42 ++++++++ python-qrcode.spec | 235 +++++++---------------------------------- sources | 2 +- 4 files changed, 83 insertions(+), 197 deletions(-) create mode 100644 flit-pyproject.toml.in diff --git a/.gitignore b/.gitignore index 2e02df4..64c81e9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /qrcode-5.0.1.tar.gz /qrcode-5.1.tar.gz /qrcode-6.1.tar.gz +/qrcode-8.0.tar.gz diff --git a/flit-pyproject.toml.in b/flit-pyproject.toml.in new file mode 100644 index 0000000..c49d59a --- /dev/null +++ b/flit-pyproject.toml.in @@ -0,0 +1,42 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "qrcode" +version = "@VERSION@" +description = "QR Code image generator" +authors = [ + { name = "Lincoln Loop", email = "info@lincolnloop.com" }, +] +license = { file = "LICENSE" } +readme = "README.rst" +keywords = ["qr", "denso-wave", "IEC18004"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Multimedia :: Graphics", + "Topic :: Software Development :: Libraries :: Python Modules", +] +requires-python = "~=3.9" +dependencies = [ + "colorama; sys_platform == 'win32'", +] + +[project.scripts] +qr = "qrcode.console_scripts:main" + +[project.optional-dependencies] +pil = ["pillow >=9.1.0"] +png = ["pypng"] +all = ["pypng", "pillow >=9.1.0"] diff --git a/python-qrcode.spec b/python-qrcode.spec index e532055..887bd0a 100644 --- a/python-qrcode.spec +++ b/python-qrcode.spec @@ -1,237 +1,80 @@ +# RHEL does not include pillow or pypng +%bcond extras %[%{undefined rhel} || %{defined epel}] + %global pkgname qrcode -%if 0%{?rhel} -# RHEL only ships qrcode-core and does not have pillow -%bcond_without coreonly -%else -%bcond_with coreonly -%endif - Name: python-%{pkgname} -Version: 6.1 -Release: 12%{?dist} +Version: 8.0 +Release: %autorelease Summary: Python QR Code image generator -License: BSD +License: BSD-3-Clause URL: https://github.com/lincolnloop/python-qrcode -Source0: https://pypi.python.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz +Source0: %{pypi_source qrcode} +Source1: flit-pyproject.toml.in BuildArch: noarch BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-six -%if %{without coreonly} -BuildRequires: python3-imaging -%endif +BuildRequires: pyproject-rpm-macros +BuildRequires: python3-pytest -%global _description\ + +%description This module uses the Python Imaging Library (PIL) to allow for the\ generation of QR Codes. -%description %_description -%if %{without coreonly} %package -n python3-%{pkgname} Summary: Python QR Code image generator -Requires: python3-imaging -# For entry point: -Requires: python3-setuptools -Requires: python3-%{pkgname}-core = %{version}-%{release} +Obsoletes: python3-qrcode-core < 7.4.2-2 +Provides: python3-qrcode-core = %{version}-%{release} +%if %{with extras} +Recommends: (python3-%{pkgname}+pil or python3-%{pkgname}+png or python3-%{pkgname}+all) +%endif %description -n python3-%{pkgname} This module uses the Python Imaging Library (PIL) to allow for the generation of QR Codes. Python 3 version. + + +%if %{with extras} +%pyproject_extras_subpkg -n python3-%{pkgname} pil,png,all %endif -%package -n python3-%{pkgname}-core -Requires: python3-six -Summary: Python 3 QR Code image generator (core library) -%description -n python3-%{pkgname}-core -Core Python 3 module for QR code generation. Does not contain image rendering. +%generate_buildrequires +# RHEL does not include the extra test dependencies (coverage, pillow) +%pyproject_buildrequires %{?with_extras:-x pil -x png} + %prep -%autosetup -n qrcode-%{version} - -# The pure plugin requires pymaging which is not packaged in Fedora. -rm qrcode/image/pure.py* - +%autosetup -n qrcode-%{version} -p1 # Remove shebang sed -i '1d' qrcode/console_scripts.py +%if %{defined rhel} && %{undefined epel} +# use flit-core instead of poetry-core +sed -e 's|@VERSION@|%{version}|' %{SOURCE1} > pyproject.toml +%endif + %build -%py3_build +%pyproject_wheel + %install -%py3_install +%pyproject_install +%pyproject_save_files qrcode -# Do not install tests -rm -r %{buildroot}%{python3_sitelib}/%{pkgname}/tests - -# -# In previous iterations of the package, the qr script had been -# renamed to qrcode. This was an unnecessary change from upstream. -# -# We cary this symlink to maintain compat with old packages. -# -ln -s qr %{buildroot}%{_bindir}/qrcode - -%if %{with coreonly} -# remove files that were part of python3-qrcode package and not shipped in -# python3-qrcode-core -rm %{buildroot}%{_bindir}/qr -rm %{buildroot}%{_bindir}/qrcode -rm %{buildroot}%{_mandir}/man1/qr.1* -%pycached rm %{buildroot}%{python3_sitelib}/%{pkgname}/image/svg.py -%pycached rm %{buildroot}%{python3_sitelib}/%{pkgname}/image/pil.py -%endif %check -%if %{with coreonly} -# test method requires PIL -sed -i s/test_render_pil/disabled_render_pil/g qrcode/tests/test_qrcode.py -%endif -PYTHONPATH=%{buildroot}%{python3_sitelib} \ - %{__python3} -m unittest -v qrcode.tests.test_qrcode.QRCodeTests +%pytest -v -%if %{without coreonly} -%files -n python3-%{pkgname} -%{_bindir}/qr -%{_bindir}/qrcode -%{_mandir}/man1/qr.1* -%pycached %{python3_sitelib}/%{pkgname}/image/svg.py -%pycached %{python3_sitelib}/%{pkgname}/image/pil.py -%endif -%files -n python3-%{pkgname}-core +%files -n python3-%{pkgname} -f %{pyproject_files} %doc README.rst CHANGES.rst %license LICENSE -%{python3_sitelib}/%{pkgname} -%{python3_sitelib}/%{pkgname}*.egg-info - -%if %{without coreonly} -%pycached %exclude %{python3_sitelib}/%{pkgname}/image/svg.py -%pycached %exclude %{python3_sitelib}/%{pkgname}/image/pil.py -%endif +%{_bindir}/qr %changelog -* Tue Aug 10 2021 Mohan Boddu - 6.1-12 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 - -* Thu Apr 22 2021 Christian Heimes - 6.1-11 -- Build only python3-qrcode-core on RHEL -- Related: #1935839 - -* Thu Apr 22 2021 Christian Heimes - 6.1-10 -- Resolves: #1935839 Remove python-imaging build requirements for RHEL -- Run unit tests during build - -* Fri Apr 16 2021 Mohan Boddu - 6.1-9 -- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - -* Wed Jan 27 2021 Fedora Release Engineering - 6.1-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 6.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue May 26 2020 Miro Hrončok - 6.1-6 -- Rebuilt for Python 3.9 - -* Thu Jan 30 2020 Fedora Release Engineering - 6.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Oct 03 2019 Miro Hrončok - 6.1-4 -- Rebuilt for Python 3.8.0rc1 (#1748018) - -* Mon Aug 19 2019 Miro Hrončok - 6.1-3 -- Rebuilt for Python 3.8 - -* Fri Jul 26 2019 Fedora Release Engineering - 6.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sun May 26 2019 Fabian Affolter - 6.1-1 -- Update to latest upstream release 6.1 - -* Sat Feb 02 2019 Fedora Release Engineering - 5.1-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Thu Oct 11 2018 Zbigniew Jędrzejewski-Szmek - 5.1-14 -- Python2 binary package has been removed - See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal - -* Sat Jul 14 2018 Fedora Release Engineering - 5.1-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 19 2018 Miro Hrončok - 5.1-12 -- Rebuilt for Python 3.7 - -* Fri Mar 23 2018 Iryna Shcherbina - 5.1-11 -- Update Python 2 dependency declarations to new packaging standards - (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) - -* Tue Mar 20 2018 Zbigniew Jędrzejewski-Szmek - 5.1-10 -- Also rename python-qrcode-core to python2-qrcode-core - -* Fri Feb 09 2018 Fedora Release Engineering - 5.1-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 5.1-8 -- Python 2 binary package renamed to python2-qrcode - See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 - -* Thu Jul 27 2017 Fedora Release Engineering - 5.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 5.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Dec 19 2016 Miro Hrončok - 5.1-5 -- Rebuild for Python 3.6 - -* Tue Jul 19 2016 Fedora Release Engineering - 5.1-4 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Thu Feb 04 2016 Fedora Release Engineering - 5.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Tue Nov 10 2015 Fedora Release Engineering - 5.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 - -* Fri Jul 10 2015 Miro Hrončok - 5.1-1 -- Update to 5.1 -- Introduce python3 subpackages (#1237118) -- Moved LICENSE from %%doc to %%license - -* Thu Jun 18 2015 Fedora Release Engineering - 5.0.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Tue Sep 16 2014 Nathaniel McCallum - 5.0.1-2 -- Make python-qrcode-core conflicts with python-qrcode < 5.0 - -* Wed Sep 10 2014 Nathaniel McCallum - 5.0.1-1 -- Update to 5.0.1 - -* Tue Sep 09 2014 Nathaniel McCallum - 2.4.1-7 -- Create -core subpackage for minimal dependencies - -* Sat Jun 07 2014 Fedora Release Engineering - 2.4.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Sun Aug 04 2013 Fedora Release Engineering - 2.4.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Thu Feb 14 2013 Fedora Release Engineering - 2.4.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - -* Sat Jul 21 2012 Fedora Release Engineering - 2.4.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Wed Jun 6 2012 Michel Salim - 2.4.1-2 -- Clean up spec, removing unnecessary declarations -- Rename tool in %%{_bindir} to the less ambiguous qrcode - -* Sat Jun 2 2012 Michel Salim - 2.4.1-1 -- Initial package +%autochangelog diff --git a/sources b/sources index 3c4ac8e..83888fe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (qrcode-6.1.tar.gz) = 4831553932442f5535cba15d5958a656b399112f0f379c28ad9b610c33d88ec6d0613dc7047a2315606e49f027bfd13a15a332ce86b80040d56e1114a0f62251 +SHA512 (qrcode-8.0.tar.gz) = 14d37ef4fe0fca3253c92f39db7948f9d804f600ee3bf9ba053baf4e01488f340cb4977b94a338f448dd4f9007f9f0cb7c5cf1db5405d98a9b38a809c8ed8650