14
0
forked from pool/python-pypng
Files
python-pypng/python-pypng.spec
Markéta Machová 9f54222607 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
2023-07-03 13:58:53 +00:00

84 lines
2.7 KiB
RPMSpec

#
# spec file for package python-pypng
#
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define binaries prichunkpng priforgepng prigreypng pripalpng pripamtopng pripnglsch pripngtopam priweavepng pricolpng priditherpng priplan9topng prirowpng
%{?sle15_python_module_pythons}
Name: python-pypng
Version: 0.20220715.0
Release: 0
Summary: Pure Python PNG image encoder/decoder
License: MIT
Group: Development/Languages/Python
URL: https://gitlab.com/drj11/pypng
Source: https://files.pythonhosted.org/packages/source/p/pypng/pypng-%{version}.tar.gz
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)}
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%python_subpackages
%description
PyPNG allows PNG image files to be read and written using pure Python.
%prep
%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
%pyproject_wheel
%install
%pyproject_install
for b in %{binaries}; do
%python_clone -a %{buildroot}%{_bindir}/$b
done
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%post
%{lua: for b in rpm.expand("%{binaries}"):gmatch("%S+") do
print(rpm.expand("%python_install_alternative " .. b .. "\n"))
end}
%postun
%{lua: for b in rpm.expand("%{binaries}"):gmatch("%S+") do
print(rpm.expand("%python_uninstall_alternative " .. b .. "\n"))
end}
%files %{python_files}
%license LICENCE
%{python_sitelib}/png.py*
%{python_sitelib}/pypng-%{version}*-info
%pycache_only %{python_sitelib}/__pycache__/png.*.pyc
%{lua: for b in rpm.expand("%{binaries}"):gmatch("%S+") do
print(rpm.expand("%python_alternative %{_bindir}/" .. b .. "\n"))
end}
%changelog