diff --git a/.gitignore b/.gitignore index 1dd6c917524..bf11eba0879 100644 --- a/.gitignore +++ b/.gitignore @@ -90,5 +90,4 @@ Tests/images/msp Tests/images/picins Tests/images/sunraster -# pyinstaller -*.spec +.pybuild diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000000..df927ae49cd --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,6 @@ +*.substvars +*debhelper* +.debhelper +files +python3-pil +tmp diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000000..b9d11e0e8dd --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +python-pillow (100:9.5.0-1) UNRELEASED; urgency=medium + + * https://github.com/python-pillow/Pillow/releases/tag/9.5.0 + + -- Wong Hoi Sing Edison Sat, 01 Apr 2023 19:16:14 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000000..8bfe09dc0aa --- /dev/null +++ b/debian/control @@ -0,0 +1,45 @@ +Source: python-pillow +Section: python +Priority: optional +Standards-Version: 4.5.0 +Maintainer: Wong Hoi Sing Edison +Homepage: https://github.com/python-pillow/Pillow/tags +Vcs-Browser: https://github.com/alvistack/python-pillow-Pillow +Vcs-Git: https://github.com/alvistack/python-pillow-Pillow.git +Build-Depends: + debhelper, + debhelper-compat (= 10), + dh-python, + fdupes, + cython3, + libfreetype6-dev, + libfribidi-dev, + libharfbuzz-dev, + libjpeg-dev, + liblcms2-dev, + libopenjp2-7-dev, + libraqm-dev, + libtiff-dev, + libwebp-dev, + libxcb1-dev, + python3-cffi, + python3-dev, + python3-numpy, + python3-olefile, + python3-setuptools, + python3-tk, + tcl8.6-dev, + tk8.6-dev, + zlib1g-dev, + +Package: python3-pil +Architecture: amd64 +Description: Python Imaging Library (Fork) + The Python Imaging Library adds image processing capabilities to your + Python interpreter. +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + ${python3:Depends}, + python3, + python3-olefile, diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000000..dcb9a244859 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: debian/* +Copyright: 2023 Wong Hoi Sing Edison +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + The complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/debian/python3-pil.install b/debian/python3-pil.install new file mode 100644 index 00000000000..e3da3e75536 --- /dev/null +++ b/debian/python3-pil.install @@ -0,0 +1 @@ +usr/lib/python*/*-packages/* diff --git a/debian/python3-pil.lintian-overrides b/debian/python3-pil.lintian-overrides new file mode 100644 index 00000000000..cb3a8384c2c --- /dev/null +++ b/debian/python3-pil.lintian-overrides @@ -0,0 +1,4 @@ +python3-pil: copyright-without-copyright-notice +python3-pil: initial-upload-closes-no-bugs +python3-pil: no-manual-page +python3-pil: zero-byte-file-in-doc-directory diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000000..fcaa45efe1f --- /dev/null +++ b/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +SHELL := /bin/bash + +override_dh_auto_install: + dh_auto_install --destdir=debian/tmp + find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \; + fdupes -qnrps debian/tmp/usr/lib/python*/*-packages + +override_dh_auto_test: + +override_dh_auto_clean: + +%: + dh $@ --buildsystem=pybuild --with python3 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000000..163aaf8d82b --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 00000000000..c4d974539b5 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,6 @@ +python-pillow source: file-without-copyright-information +python-pillow source: license-problem-md5sum-non-free-file +python-pillow source: no-debian-changes +python-pillow source: source-contains-prebuilt-windows-binary +python-pillow source: source-is-missing +python-pillow source: source-package-encodes-python-version diff --git a/docs/releasenotes/9.5.0.rst b/docs/releasenotes/9.5.0.rst index bda3cd05a2b..b1e982fccff 100644 --- a/docs/releasenotes/9.5.0.rst +++ b/docs/releasenotes/9.5.0.rst @@ -1,14 +1,6 @@ 9.5.0 ----- -Backwards Incompatible Changes -============================== - -TODO -^^^^ - -TODO - Deprecations ============ @@ -20,14 +12,6 @@ be removed in Pillow 11 (2024-10-15). This class was only made as a helper to be used internally, so there is no replacement. If you need this functionality though, it is a very short class that can easily be recreated in your own code. -API Changes -=========== - -TODO -^^^^ - -TODO - API Additions ============= diff --git a/python-pillow.spec b/python-pillow.spec new file mode 100644 index 00000000000..308a367f24b --- /dev/null +++ b/python-pillow.spec @@ -0,0 +1,110 @@ +# Copyright 2023 Wong Hoi Sing Edison +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +%global debug_package %{nil} + +Name: python-pillow +Epoch: 100 +Version: 9.5.0 +Release: 1%{?dist} +Summary: Python Imaging Library (Fork) +License: HPND +URL: https://github.com/python-pillow/Pillow/tags +Source0: %{name}_%{version}.orig.tar.gz +BuildRequires: fdupes +BuildRequires: freetype-devel +BuildRequires: fribidi-devel +BuildRequires: gcc +BuildRequires: harfbuzz-devel +BuildRequires: lcms2-devel +BuildRequires: libimagequant-devel +BuildRequires: libjpeg-devel +BuildRequires: libraqm-devel +BuildRequires: libtiff-devel +BuildRequires: libwebp-devel +BuildRequires: libxcb-devel +BuildRequires: make +BuildRequires: openjpeg2-devel +BuildRequires: python-rpm-macros +BuildRequires: python3-cffi +BuildRequires: python3-cython +BuildRequires: python3-devel +BuildRequires: python3-numpy +BuildRequires: python3-olefile +BuildRequires: python3-setuptools +BuildRequires: tcl-devel +BuildRequires: tk-devel +BuildRequires: zlib-devel + +%description +The Python Imaging Library adds image processing capabilities to your +Python interpreter. + +%prep +%autosetup -T -c -n %{name}_%{version}-%{release} +tar -zx -f %{S:0} --strip-components=1 -C . + +%build +%py3_build + +%install +%py3_install +find %{buildroot}%{python3_sitearch} -type f -name '*.pyc' -exec rm -rf {} \; +fdupes -qnrps %{buildroot}%{python3_sitearch} + +%check + +%if 0%{?suse_version} > 1500 +%package -n python%{python3_version_nodots}-pillow +Summary: Python Imaging Library (Fork) +Requires: python3 +Requires: python3-olefile +Provides: python3-pillow = %{epoch}:%{version}-%{release} +Provides: python3dist(pillow) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pillow = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pillow) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pillow = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pillow) = %{epoch}:%{version}-%{release} + +%description -n python%{python3_version_nodots}-pillow +The Python Imaging Library adds image processing capabilities to your +Python interpreter. + +%files -n python%{python3_version_nodots}-pillow +%license LICENSE +%{python3_sitearch}/* +%endif + +%if !(0%{?suse_version} > 1500) +%package -n python3-pillow +Summary: Python Imaging Library (Fork) +Requires: python3 +Requires: python3-olefile +Provides: python3-pillow = %{epoch}:%{version}-%{release} +Provides: python3dist(pillow) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pillow = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pillow) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pillow = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pillow) = %{epoch}:%{version}-%{release} + +%description -n python3-pillow +The Python Imaging Library adds image processing capabilities to your +Python interpreter. + +%files -n python3-pillow +%license LICENSE +%{python3_sitearch}/* +%endif + +%changelog diff --git a/setup.cfg b/setup.cfg index d6057f1599d..37aacd991b2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = Pillow +version = 9.5.0 description = Python Imaging Library (Fork) long_description = file: README.md long_description_content_type = text/markdown @@ -7,60 +8,60 @@ url = https://python-pillow.org author = Jeffrey A. Clark (Alex) author_email = aclark@aclark.net license = HPND -classifiers = - Development Status :: 6 - Mature - License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND) - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Multimedia :: Graphics - Topic :: Multimedia :: Graphics :: Capture :: Digital Camera - Topic :: Multimedia :: Graphics :: Capture :: Screen Capture - Topic :: Multimedia :: Graphics :: Graphics Conversion - Topic :: Multimedia :: Graphics :: Viewers +classifiers = + Development Status :: 6 - Mature + License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND) + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Topic :: Multimedia :: Graphics + Topic :: Multimedia :: Graphics :: Capture :: Digital Camera + Topic :: Multimedia :: Graphics :: Capture :: Screen Capture + Topic :: Multimedia :: Graphics :: Graphics Conversion + Topic :: Multimedia :: Graphics :: Viewers keywords = Imaging -project_urls = - Documentation=https://pillow.readthedocs.io - Source=https://github.com/python-pillow/Pillow - Funding=https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=pypi - Release notes=https://pillow.readthedocs.io/en/stable/releasenotes/index.html - Changelog=https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst - Twitter=https://twitter.com/PythonPillow - Mastodon=https://fosstodon.org/@pillow +project_urls = + Documentation=https://pillow.readthedocs.io + Source=https://github.com/python-pillow/Pillow + Funding=https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=pypi + Release notes=https://pillow.readthedocs.io/en/stable/releasenotes/index.html + Changelog=https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst + Twitter=https://twitter.com/PythonPillow + Mastodon=https://fosstodon.org/@pillow [options] packages = PIL python_requires = >=3.7 include_package_data = True -package_dir = - = src +package_dir = + = src [options.extras_require] -docs = - furo - olefile - sphinx>=2.4 - sphinx-copybutton - sphinx-inline-tabs - sphinx-removed-in - sphinxext-opengraph -tests = - check-manifest - coverage - defusedxml - markdown2 - olefile - packaging - pyroma - pytest - pytest-cov - pytest-timeout +docs = + furo + olefile + sphinx>=2.4 + sphinx-copybutton + sphinx-inline-tabs + sphinx-removed-in + sphinxext-opengraph +tests = + check-manifest + coverage + defusedxml + markdown2 + olefile + packaging + pyroma + pytest + pytest-cov + pytest-timeout [flake8] extend-ignore = E203 @@ -72,3 +73,8 @@ profile = black [tool:pytest] addopts = -ra --color=yes testpaths = Tests + +[egg_info] +tag_build = +tag_date = 0 + diff --git a/setup.py b/setup.py index 07d6c66d655..f9670d4c040 100755 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ import os import re +import shutil import struct import subprocess import sys @@ -150,6 +151,7 @@ def _dbg(s, tp=None): def _find_library_dirs_ldconfig(): # Based on ctypes.util from Python 2 + ldconfig = "ldconfig" if shutil.which("ldconfig") else "/sbin/ldconfig" if sys.platform.startswith("linux") or sys.platform.startswith("gnu"): if struct.calcsize("l") == 4: machine = os.uname()[4] + "-32" @@ -166,14 +168,14 @@ def _find_library_dirs_ldconfig(): # Assuming GLIBC's ldconfig (with option -p) # Alpine Linux uses musl that can't print cache - args = ["ldconfig", "-p"] + args = [ldconfig, "-p"] expr = rf".*\({abi_type}.*\) => (.*)" env = dict(os.environ) env["LC_ALL"] = "C" env["LANG"] = "C" elif sys.platform.startswith("freebsd"): - args = ["ldconfig", "-r"] + args = [ldconfig, "-r"] expr = r".* => (.*)" env = {}