Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pydyf for openSUSE:Factory checked in at 2022-08-16 17:58:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pydyf (Old) and /work/SRC/openSUSE:Factory/.python-pydyf.new.1521 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pydyf" Tue Aug 16 17:58:11 2022 rev:3 rq:997412 version:0.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pydyf/python-pydyf.changes 2021-12-16 02:01:14.159643900 +0100 +++ /work/SRC/openSUSE:Factory/.python-pydyf.new.1521/python-pydyf.changes 2022-08-16 17:58:12.930924582 +0200 @@ -1,0 +2,7 @@ +Sat Aug 13 11:44:53 UTC 2022 - Axel Braun <axel.br...@gmx.de> + +- Update to version 0.2.0 + * Requires Python 3.7+ + * change buildsystem to .toml + +------------------------------------------------------------------- Old: ---- pydyf-0.1.2.tar.gz New: ---- pydyf-0.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pydyf.spec ++++++ --- /var/tmp/diff_new_pack.6sBI8c/_old 2022-08-16 17:58:13.642924271 +0200 +++ /var/tmp/diff_new_pack.6sBI8c/_new 2022-08-16 17:58:13.650924267 +0200 @@ -1,8 +1,8 @@ # # spec file for package python-pydyf # -# Copyright (c) 2021 SUSE LLC -# Copyright (c) 2021 Dr. Axel Braun <d...@opensuse.org> +# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2022 Dr. Axel Braun <d...@opensuse.org> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,20 +21,23 @@ %define skip_python2 1 Name: python-pydyf -Version: 0.1.2 +Version: 0.2.0 Release: 0 Summary: A low-level PDF generator License: BSD-3-Clause URL: https://www.courtbouillon.org/pydyf Source: https://files.pythonhosted.org/packages/source/p/pydyf/pydyf-%{version}.tar.gz +BuildRequires: %{python_module flit} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros + BuildArch: noarch ## Testing -BuildRequires: %{python_module pytest} BuildRequires: %{python_module Pillow} BuildRequires: %{python_module pytest-isort} +BuildRequires: %{python_module pytest} BuildRequires: gs %python_subpackages @@ -46,14 +49,14 @@ %setup -q -n pydyf-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -sed -i 's:--flake8 --cov --no-cov-on-fail::' pyproject.toml +sed -i 's:--flake8 --numprocesses=auto::' pyproject.toml %pytest tests/test_pydyf.py %files %{python_files} ++++++ pydyf-0.1.2.tar.gz -> pydyf-0.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/.github/FUNDING.yml new/pydyf-0.2.0/.github/FUNDING.yml --- old/pydyf-0.1.2/.github/FUNDING.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/pydyf-0.2.0/.github/FUNDING.yml 2022-05-23 15:10:18.000000000 +0200 @@ -0,0 +1 @@ +open_collective: courtbouillon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/.github/workflows/doconfly.yml new/pydyf-0.2.0/.github/workflows/doconfly.yml --- old/pydyf-0.1.2/.github/workflows/doconfly.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/pydyf-0.2.0/.github/workflows/doconfly.yml 2022-05-23 15:10:18.000000000 +0200 @@ -0,0 +1,29 @@ +name: doconfly +on: + push: + branches: + - master + tags: + - "*" + +jobs: + doconfly: + name: doconfly job + runs-on: ubuntu-latest + env: + PORT: ${{ secrets.PORT }} + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + TAKOYAKI: ${{ secrets.TAKOYAKI }} + USER: ${{ secrets.USER }} + DOCUMENTATION_PATH: ${{ secrets.DOCUMENTATION_PATH }} + DOCUMENTATION_URL: ${{ secrets.DOCUMENTATION_URL }} + steps: + - run: | + which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) + eval $(ssh-agent -s) + echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + mkdir -p ~/.ssh + chmod 700 ~/.ssh + ssh-keyscan -p $PORT $TAKOYAKI >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + ssh $USER@$TAKOYAKI -p $PORT "doconfly/doconfly.sh $GITHUB_REPOSITORY $GITHUB_REF $DOCUMENTATION_PATH $DOCUMENTATION_URL" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/.github/workflows/tests.yml new/pydyf-0.2.0/.github/workflows/tests.yml --- old/pydyf-0.1.2/.github/workflows/tests.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/pydyf-0.2.0/.github/workflows/tests.yml 2022-05-23 15:10:18.000000000 +0200 @@ -0,0 +1,35 @@ +name: pydyf's tests +on: [push, pull_request] + +jobs: + tests: + name: ${{ matrix.os }} - ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8'] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install Ghostscript (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update -y && sudo apt-get install ghostscript -y + - name: Install Ghostscript (macOS) + if: matrix.os == 'macos-latest' + run: brew install ghostscript + - name: Install Ghostscript (Windows) + if: matrix.os == 'windows-latest' + run: | + C:\msys64\usr\bin\bash -lc 'pacman -S mingw-w64-x86_64-ghostscript --noconfirm' + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH + rm C:\msys64\mingw64\bin\python.exe + - name: Upgrade pip and setuptools + run: python -m pip install --upgrade pip setuptools + - name: Install tests??? requirements + run: python -m pip install .[test] + - name: Launch tests + run: python -m pytest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/.gitignore new/pydyf-0.2.0/.gitignore --- old/pydyf-0.1.2/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/pydyf-0.2.0/.gitignore 2022-05-23 15:10:18.000000000 +0200 @@ -0,0 +1,4 @@ +/docs/_build +/tests/results +__pycache__ +.coverage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/PKG-INFO new/pydyf-0.2.0/PKG-INFO --- old/pydyf-0.1.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/pydyf-0.2.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,57 +0,0 @@ -Metadata-Version: 2.1 -Name: pydyf -Version: 0.1.2 -Summary: A low-level PDF generator. -Keywords: pdf,generator -Author-email: CourtBouillon <cont...@courtbouillon.org> -Maintainer-email: CourtBouillon <cont...@courtbouillon.org> -Requires-Python: >=3.6 -Description-Content-Type: text/x-rst -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: BSD License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3 :: Only -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Programming Language :: Python :: Implementation :: CPython -Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Dist: sphinx ; extra == "doc" -Requires-Dist: sphinx_rtd_theme ; extra == "doc" -Requires-Dist: pytest ; extra == "test" -Requires-Dist: pytest-cov ; extra == "test" -Requires-Dist: pytest-flake8 ; extra == "test" -Requires-Dist: pytest-isort ; extra == "test" -Requires-Dist: coverage[toml] ; extra == "test" -Requires-Dist: pillow ; extra == "test" -Project-URL: Changelog, https://github.com/CourtBouillon/pydyf/releases -Project-URL: Code, https://github.com/CourtBouillon/pydyf -Project-URL: Documentation, https://doc.courtbouillon.org/pydyf/ -Project-URL: Donation, https://opencollective.com/courtbouillon -Project-URL: Homepage, https://www.courtbouillon.org/pydyf -Project-URL: Issues, https://github.com/CourtBouillon/pydyf/issues -Provides-Extra: doc -Provides-Extra: test - -pydyf is a low-level PDF generator written in Python and based on PDF -specification 1.7. - -* Free software: BSD license -* For Python 3.6+, tested on CPython and PyPy -* Documentation: https://doc.courtbouillon.org/pydyf -* Changelog: https://github.com/CourtBouillon/pydyf/releases -* Code, issues, tests: https://github.com/CourtBouillon/pydyf -* Code of conduct: https://www.courtbouillon.org/code-of-conduct -* Professional support: https://www.courtbouillon.org -* Donation: https://opencollective.com/courtbouillon - -Copyrights are retained by their contributors, no copyright assignment is -required to contribute to pydyf. Unless explicitly stated otherwise, any -contribution intentionally submitted for inclusion is licensed under the BSD -3-clause license, without any additional terms or conditions. For full -authorship information, see the version control history. - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/README.rst new/pydyf-0.2.0/README.rst --- old/pydyf-0.1.2/README.rst 2020-11-29 22:40:31.821118600 +0100 +++ new/pydyf-0.2.0/README.rst 2022-05-23 15:10:18.000000000 +0200 @@ -2,7 +2,7 @@ specification 1.7. * Free software: BSD license -* For Python 3.6+, tested on CPython and PyPy +* For Python 3.7+, tested on CPython and PyPy * Documentation: https://doc.courtbouillon.org/pydyf * Changelog: https://github.com/CourtBouillon/pydyf/releases * Code, issues, tests: https://github.com/CourtBouillon/pydyf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/docs/changelog.rst new/pydyf-0.2.0/docs/changelog.rst --- old/pydyf-0.1.2/docs/changelog.rst 2021-10-30 15:53:40.194420600 +0200 +++ new/pydyf-0.2.0/docs/changelog.rst 2022-05-23 15:10:18.000000000 +0200 @@ -2,6 +2,49 @@ ========= +Version 0.2.0 +------------- + +Released on 2022-05-23. + +Dependencies: + +* Python 3.7+ is now needed, Python 3.6 is not supported anymore + + New features: + +* `d0be36b <https://github.com/CourtBouillon/pydyf/commit/d0be36b>`_: + Allow to set PDF version +* `879261c <https://github.com/CourtBouillon/pydyf/commit/879261c>`_: + Allow to set PDF identifier + +Contributors: + +* Guillaume Ayoub + +Backers and sponsors: + +* Grip Angebotssoftware +* Manuel Barkhau +* Crisp BV +* SimonSoft +* Menutech +* Spacinov +* KontextWork +* Ren?? Fritz +* Kobalt +* NCC Group +* Des images et des mots +* Nathalie Gutton +* Andreas Zettl +* Tom Pohl +* Moritz Mahringer +* Florian Demmer +* Yanal-Yvez Fargialla +* G??bor +* Piotr Horzycki + + Version 0.1.2 ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/docs/conf.py new/pydyf-0.2.0/docs/conf.py --- old/pydyf-0.1.2/docs/conf.py 2020-11-29 22:40:31.821118600 +0100 +++ new/pydyf-0.2.0/docs/conf.py 2022-05-23 15:10:18.000000000 +0200 @@ -1,13 +1,7 @@ # pydyf documentation build configuration file. -import sys -from pathlib import Path - import pydyf -# Add current path for css_diagram_role -sys.path.append(str(Path(__file__).parent)) - # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/docs/going_further.rst new/pydyf-0.2.0/docs/going_further.rst --- old/pydyf-0.1.2/docs/going_further.rst 2020-11-30 10:27:03.086948000 +0100 +++ new/pydyf-0.2.0/docs/going_further.rst 2022-05-23 15:10:18.000000000 +0200 @@ -5,12 +5,11 @@ Why pydyf? ------------- -pydyf has been created to replace Cairo PDF generation in WeasyPrint_. +pydyf has been created to replace Cairo_ PDF generation in WeasyPrint_. -Indeed, there are some bugs in WeasyPrint caused by Cairo_ and Cairo has some -difficulties to make releases. -Also there are features which will be easier to implement while having more -control on the PDF generation. +Indeed, there were some bugs in WeasyPrint caused by Cairo, and new versions of +Cairo can take a long time to be released. There are also many features that +are easier to implement with more control on the PDF generation. So we created pydyf. @@ -20,13 +19,13 @@ Why Python? ----------- -Python is a really good language to design a small, OS-agnostic parser. As it -is object-oriented, it gives the possibility to follow the specification with -high-level classes and a small amount of very simple code. +Python is a really good language to design a small, OS-agnostic library. As it +is object-oriented, it gives the possibility to follow the PDF specification +with high-level classes and a small amount of very simple code. And of course, WeasyPrint is written in Python too, giving an obvious reason for this choice. -Speed is not pydyf???s main goal. Code simplicity, maintainability and -flexibility are more important goals for this library, as they give the -ability to stay really close to the specification and to fix bugs easily. +Speed is not pydyf???s main goal. Code simplicity, maintainability and +flexibility are more important goals for this library, as they give the ability +to stay really close to the specification and to fix bugs easily. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/pydyf/__init__.py new/pydyf-0.2.0/pydyf/__init__.py --- old/pydyf-0.1.2/pydyf/__init__.py 2021-10-30 15:47:12.711435000 +0200 +++ new/pydyf-0.2.0/pydyf/__init__.py 2022-05-23 15:10:18.000000000 +0200 @@ -6,8 +6,9 @@ import re import zlib from codecs import BOM_UTF16_BE +from hashlib import md5 -VERSION = __version__ = '0.1.2' +VERSION = __version__ = '0.2.0' def _to_bytes(item): @@ -425,7 +426,7 @@ }) self.add_object(self.pages) - #: PDF???:class:`Dictionary` containing the PDF???s metadata. + #: PDF :class:`Dictionary` containing the PDF???s metadata. self.info = Dictionary({}) self.add_object(self.info) @@ -469,15 +470,17 @@ self.current_position += len(content) + 1 output.write(content + b'\n') - def write(self, output): + def write(self, output, version=b'1.7', identifier=None): """Write PDF to output. :param output: Output stream. :type output: binary :term:`file object` + :param bytes version: PDF version. + :param bytes identifier: PDF file identifier. """ # Write header - self.write_line(b'%PDF-1.7', output) + self.write_line(b'%PDF-' + version, output) self.write_line(b'%\xf0\x9f\x96\xa4', output) # Write all non-free PDF objects @@ -502,6 +505,13 @@ self.write_line(f'/Size {len(self.objects)}'.encode(), output) self.write_line(b'/Root ' + self.catalog.reference, output) self.write_line(b'/Info ' + self.info.reference, output) + if identifier is not None: + data = b''.join( + obj.data for obj in self.objects if obj.free != 'f') + data_hash = md5(data).hexdigest().encode() + self.write_line( + b'/ID [' + String(identifier).data + b' ' + + String(data_hash).data + b']', output) self.write_line(b'>>', output) self.write_line(b'startxref', output) self.write_line(f'{self.xref_position}'.encode(), output) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/pyproject.toml new/pydyf-0.2.0/pyproject.toml --- old/pydyf-0.1.2/pyproject.toml 2021-06-02 19:06:39.413193200 +0200 +++ new/pydyf-0.2.0/pyproject.toml 2022-05-23 15:10:18.000000000 +0200 @@ -8,7 +8,7 @@ keywords = ['pdf', 'generator'] authors = [{name = 'CourtBouillon', email = 'cont...@courtbouillon.org'}] maintainers = [{name = 'CourtBouillon', email = 'cont...@courtbouillon.org'}] -requires-python = '>=3.6' +requires-python = '>=3.7' readme = {file = 'README.rst', content-type = 'text/x-rst'} license = {file = 'LICENSE'} classifiers = [ @@ -19,10 +19,10 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ] @@ -38,13 +38,13 @@ [project.optional-dependencies] doc = ['sphinx', 'sphinx_rtd_theme'] -test = ['pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]', 'pillow'] +test = ['pytest', 'pytest-xdist', 'pytest-flake8', 'pytest-isort', 'pytest-cov', 'coverage[toml]', 'pillow'] [tool.flit.sdist] exclude = ['.*'] [tool.pytest.ini_options] -addopts = '--isort --flake8 --cov --no-cov-on-fail' +addopts = '--isort --flake8 --numprocesses=auto' [tool.coverage.run] branch = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/setup.py new/pydyf-0.2.0/setup.py --- old/pydyf-0.1.2/setup.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pydyf-0.2.0/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -#!/usr/bin/env python -# setup.py generated by flit for tools that don't yet use PEP 517 - -from distutils.core import setup - -packages = \ -['pydyf'] - -package_data = \ -{'': ['*']} - -extras_require = \ -{'doc': ['sphinx', 'sphinx_rtd_theme'], - 'test': ['pytest', - 'pytest-cov', - 'pytest-flake8', - 'pytest-isort', - 'coverage[toml]', - 'pillow']} - -setup(name='pydyf', - version='0.1.2', - description='A low-level PDF generator.', - author=None, - author_email='CourtBouillon <cont...@courtbouillon.org>', - url=None, - packages=packages, - package_data=package_data, - extras_require=extras_require, - python_requires='>=3.6', - ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydyf-0.1.2/tests/test_pydyf.py new/pydyf-0.2.0/tests/test_pydyf.py --- old/pydyf-0.1.2/tests/test_pydyf.py 2021-10-30 15:46:06.937611600 +0200 +++ new/pydyf-0.2.0/tests/test_pydyf.py 2022-05-23 15:10:18.000000000 +0200 @@ -1,3 +1,5 @@ +import io + import pydyf from . import assert_pixels @@ -283,10 +285,10 @@ document = pydyf.PDF() draw = pydyf.Stream() + draw.transform(1, 0, 0, 1, 1, 1) draw.move_to(2, 2) draw.set_line_width(2) draw.line_to(2, 5) - draw.transform(1, 0, 0, 1, 1, 1) draw.stroke() document.add_object(draw) @@ -694,7 +696,7 @@ KKKKKKKKKK KKKKKKKKKK KKKKKKKKKK - __________ + zzzzzzzzzz __________ __________ __________ @@ -702,6 +704,20 @@ ''') +def test_identifier(): + document = pydyf.PDF() + pdf = io.BytesIO() + document.write(pdf, identifier=b'abc') + assert b'abc' in pdf.getvalue() + + +def test_version(): + document = pydyf.PDF() + pdf = io.BytesIO() + document.write(pdf, version=b'2.0') + assert b'2.0' in pdf.getvalue() + + def test_string_encoding(): assert pydyf.String('abc').data == b'(abc)' assert pydyf.String('d??f').data == b'<feff006400e90066>'