14
0
forked from pool/python-pypng

Accepting request 1096534 from home:Simmphonie:branches:devel:languages:python

- update to version  0.20220715.0
  * Development moved to gitlab: https://gitlab.com/drj11/pypng
  * If you pass an empty file to PyPNG
    it now raises the builtin Python exception EOFError.
    This should make it easier to diagnose empty file problems separately
    from genuine format errors
    (which use png.FormatError).
    This is a slightly breaking change to the API.
  * New prirowpng tool to join PNG images in a row left-to-right
    (old internal pipcat tool).
  * New pricolpng tool to join PNG images in a column top-to-bottom.
  * Support for plain PGM files (magic number P2) added to pripamtopng.
  * New priplan9topng tool to convert from Plan 9 image format to PNG.
    In reality this has been lurking in the codebase for years, but
    has recently been converted to Python 3.
    The author has only a limited collection of Plan 9 images,
    which limits the testing that can be done.
    The author welcomes bug reports for Plan 9 images.
  * The priplan9topng tool has an even more experimental option
    --font which converts Plan 9 subfont files to a sequence of PNG files.
- release 0.0.21
  * Support for Python 2 is dropped.
  * Python 3.5 and onwards are supported.
  * Some of the ancillary tools are modified to work on Python 3.
  * Installs via wheel files.
  * prichunkpng command line tool now has some new options to add
  * chunks:
    --iccprofile to add a iCCP chunk (ICC Profile);
    --physical to add a pHYs chunk, specifying the intended pixel size;
    --sigbit to add a sBIT chunk, specifying the encoded significant bits;
    --transparent to add a tRNS chunk, specifying the transparent colour.
  * priditherpng command line tool standardised and
    converted to Python 3.
  * pripngtopam tool now has a --plain option to output plain PGM
    and PPM formats. The topam part of the name is a bit of a
    misnomer: when possible (L and RGB PNG files) the tool will
    output either a PGM (grey) or a PPM (RGB) file. Essentially all
    tools that can process a PAM file can also process a PGM or a
    PPM file. PAM files cannot be plain so using the option
    will raise an error in the case where a true PAM file is
    written.
  * Better error messages when you write the wrong number of rows.
    (Slightly experimentally) running the png module as a command
    line tool, with python -m png, will report the version and
    file location of the png module.
- remove pr_106.patch
- remove pypng-pr104-py39.patch

OBS-URL: https://build.opensuse.org/request/show/1096534
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pypng?expand=0&rev=19
This commit is contained in:
2023-07-03 13:58:53 +00:00
committed by Git OBS Bridge
parent d31cd08c91
commit 9f54222607
6 changed files with 69 additions and 72 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pypng
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,22 +16,22 @@
#
%define binaries prichunkpng priforgepng prigreypng pripalpng pripamtopng pripnglsch pripngtopam priweavepng
%{?!python_module:%define python_module() python3-%{**}}
%define binaries prichunkpng priforgepng prigreypng pripalpng pripamtopng pripnglsch pripngtopam priweavepng pricolpng priditherpng priplan9topng prirowpng
%{?sle15_python_module_pythons}
Name: python-pypng
Version: 0.0.20
Version: 0.20220715.0
Release: 0
Summary: Pure Python PNG image encoder/decoder
License: MIT
Group: Development/Languages/Python
URL: https://github.com/drj11/pypng
URL: https://gitlab.com/drj11/pypng
Source: https://files.pythonhosted.org/packages/source/p/pypng/pypng-%{version}.tar.gz
# PATCH-FIX-UPSTREAM pr_106 -- gh#drj11/pypng#106 remove test modules
Patch0: pr_106.patch
# PATCH-FIX-UPSTREAM pypng-pr104-py39.patch -- gh#drj11/pypng#104 -- python 3.9 compat
Patch1: https://github.com/drj11/pypng/pull/104.patch#/pypng-pr104-py39.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module base >= 3.5}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module numpy if (%python-base without python36-base)}
@@ -44,26 +44,22 @@ BuildArch: noarch
PyPNG allows PNG image files to be read and written using pure Python.
%prep
%setup -q -n pypng-%{version}
%patch0 -p1
%if 0%{suse_version} >= 1550
# The patch for Python 3.9 compatibility breaks Python 2
%patch1 -p1
%endif
sed -i -e '/^#!\//, 1d' code/png.py
%setup 1 -q -n pypng-%{version}
sed -i -e '/^#!\//, 1d' code/{exnumpy,iccp,mkiccp,png,pngsuite,texttopng}.py
sed -i 's|license_file = |license_files = |' setup.cfg
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
for b in %{binaries}; do
%python_clone -a %{buildroot}%{_bindir}/$b
done
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib}:code $python code/test_png.py
%pytest
%post
%{lua: for b in rpm.expand("%{binaries}"):gmatch("%S+") do