Merging upstream version 0.5.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c8532840ce
commit
6fdc00b917
6 changed files with 83 additions and 8 deletions
5
.github/workflows/tests.yml
vendored
5
.github/workflows/tests.yml
vendored
|
@ -6,7 +6,6 @@ jobs:
|
||||||
name: ${{ matrix.os }} - ${{ matrix.python-version }}
|
name: ${{ matrix.os }} - ${{ matrix.python-version }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8']
|
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8']
|
||||||
|
@ -33,3 +32,7 @@ jobs:
|
||||||
run: python -m pip install .[test]
|
run: python -m pip install .[test]
|
||||||
- name: Launch tests
|
- name: Launch tests
|
||||||
run: python -m pytest
|
run: python -m pytest
|
||||||
|
- name: Check coding style
|
||||||
|
run: python -m flake8
|
||||||
|
- name: Check imports order
|
||||||
|
run: python -m isort . --check --diff
|
||||||
|
|
|
@ -2,6 +2,67 @@ Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
||||||
|
Version 0.5.0
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Released on 2022-10-11.
|
||||||
|
|
||||||
|
New features:
|
||||||
|
|
||||||
|
* Add the PDF.page_references property
|
||||||
|
* Revert the PDF.pages['Kids'] behavior to be retro-compatible with version 0.3.0
|
||||||
|
|
||||||
|
Backers and sponsors:
|
||||||
|
|
||||||
|
* Grip Angebotssoftware
|
||||||
|
* Manuel Barkhau
|
||||||
|
* Crisp BV
|
||||||
|
* SimonSoft
|
||||||
|
* Menutech
|
||||||
|
* Spacinov
|
||||||
|
* KontextWork
|
||||||
|
* René Fritz
|
||||||
|
* NCC Group
|
||||||
|
* Kobalt
|
||||||
|
* Tom Pohl
|
||||||
|
* John R Ellis
|
||||||
|
* Moritz Mahringer
|
||||||
|
* Yanal-Yvez Fargialla
|
||||||
|
* Gábor
|
||||||
|
* Piotr Horzycki
|
||||||
|
* Andrew Ittner
|
||||||
|
|
||||||
|
|
||||||
|
Version 0.4.0
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Released on 2022-10-11.
|
||||||
|
|
||||||
|
New features:
|
||||||
|
|
||||||
|
* Allow nth page’s reference to be retrieved using PDF.pages['Kids'][n]
|
||||||
|
|
||||||
|
Backers and sponsors:
|
||||||
|
|
||||||
|
* Grip Angebotssoftware
|
||||||
|
* Manuel Barkhau
|
||||||
|
* Crisp BV
|
||||||
|
* SimonSoft
|
||||||
|
* Menutech
|
||||||
|
* Spacinov
|
||||||
|
* KontextWork
|
||||||
|
* René Fritz
|
||||||
|
* NCC Group
|
||||||
|
* Kobalt
|
||||||
|
* Tom Pohl
|
||||||
|
* John R Ellis
|
||||||
|
* Moritz Mahringer
|
||||||
|
* Yanal-Yvez Fargialla
|
||||||
|
* Gábor
|
||||||
|
* Piotr Horzycki
|
||||||
|
* Andrew Ittner
|
||||||
|
|
||||||
|
|
||||||
Version 0.3.0
|
Version 0.3.0
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
|
@ -46,12 +46,20 @@ the pytest_ library.
|
||||||
Launching tests require to have Ghostscript_ installed and available in
|
Launching tests require to have Ghostscript_ installed and available in
|
||||||
``PATH``.
|
``PATH``.
|
||||||
|
|
||||||
You can launch tests (with code coverage and lint) using the following command::
|
You can launch tests using the following command::
|
||||||
|
|
||||||
venv/bin/pytest
|
venv/bin/pytest
|
||||||
|
|
||||||
|
WeasyPrint also uses isort_ to check imports and flake8_ to check the coding
|
||||||
|
style::
|
||||||
|
|
||||||
|
venv/bin/python -m isort . --check --diff
|
||||||
|
venv/bin/python -m flake8
|
||||||
|
|
||||||
.. _pytest: https://docs.pytest.org/
|
.. _pytest: https://docs.pytest.org/
|
||||||
.. _Ghostscript: https://www.ghostscript.com/
|
.. _Ghostscript: https://www.ghostscript.com/
|
||||||
|
.. _isort: https://pycqa.github.io/isort/
|
||||||
|
.. _flake8: https://flake8.pycqa.org/
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
|
|
|
@ -8,7 +8,7 @@ import zlib
|
||||||
from codecs import BOM_UTF16_BE
|
from codecs import BOM_UTF16_BE
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
|
|
||||||
VERSION = __version__ = '0.3.0'
|
VERSION = __version__ = '0.5.0'
|
||||||
|
|
||||||
|
|
||||||
def _to_bytes(item):
|
def _to_bytes(item):
|
||||||
|
@ -482,6 +482,12 @@ class PDF:
|
||||||
object_.number = len(self.objects)
|
object_.number = len(self.objects)
|
||||||
self.objects.append(object_)
|
self.objects.append(object_)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def page_references(self):
|
||||||
|
return tuple(
|
||||||
|
f'{object_number} 0 R'.encode('ascii')
|
||||||
|
for object_number in self.pages['Kids'][::3])
|
||||||
|
|
||||||
def write_line(self, content, output):
|
def write_line(self, content, output):
|
||||||
"""Write line to output.
|
"""Write line to output.
|
||||||
|
|
||||||
|
|
|
@ -38,14 +38,11 @@ Donation = 'https://opencollective.com/courtbouillon'
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
doc = ['sphinx', 'sphinx_rtd_theme']
|
doc = ['sphinx', 'sphinx_rtd_theme']
|
||||||
test = ['pytest', 'pytest-xdist', 'pytest-flake8', 'pytest-isort', 'pytest-cov', 'coverage[toml]', 'pillow']
|
test = ['pytest', 'isort', 'flake8', 'pillow']
|
||||||
|
|
||||||
[tool.flit.sdist]
|
[tool.flit.sdist]
|
||||||
exclude = ['.*']
|
exclude = ['.*']
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
|
||||||
addopts = '--isort --flake8 --numprocesses=auto'
|
|
||||||
|
|
||||||
[tool.coverage.run]
|
[tool.coverage.run]
|
||||||
branch = true
|
branch = true
|
||||||
include = ['tests/*', 'pydyf/*']
|
include = ['tests/*', 'pydyf/*']
|
||||||
|
|
Loading…
Add table
Reference in a new issue