From 4f82a4a34eab9442db6d3b1d5c87d974dafb09f5 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sun, 6 Dec 2020 20:19:59 +0100 Subject: [PATCH] Packaging! Related to #1247, #1232. --- .gitignore | 3 +- NEWS.rst | 1688 ----------------- pyproject.toml | 74 + setup.cfg | 116 -- setup.py | 13 - {weasyprint/tests => tests}/__init__.py | 0 {weasyprint/tests => tests}/conftest.py | 5 +- .../tests => tests}/resources/AHEM____.TTF | Bin .../resources/acid2-reference.html | 0 .../tests => tests}/resources/acid2-test.html | 0 .../tests => tests}/resources/blue.jpg | Bin .../tests => tests}/resources/doc1.html | 0 .../resources/doc1_UTF-16BE.html | Bin .../tests => tests}/resources/icon.png | Bin .../tests => tests}/resources/latin1-test.css | 0 .../tests => tests}/resources/logo_small.png | Bin .../tests => tests}/resources/mini_ua.css | 0 .../tests => tests}/resources/pattern.gif | Bin .../resources/pattern.palette.png | Bin .../tests => tests}/resources/pattern.png | Bin .../tests => tests}/resources/pattern.svg | 0 .../resources/really-a-png.svg | Bin .../resources/really-a-svg.png | 0 .../tests => tests}/resources/sheet2.css | 0 .../resources/sub_directory/sheet1.css | 0 .../tests => tests}/resources/user.css | 0 .../tests => tests}/resources/utf8-test.css | 0 .../tests => tests}/resources/weasyprint.otf | Bin {weasyprint/tests => tests}/test_acid2.py | 2 +- {weasyprint/tests => tests}/test_api.py | 6 +- {weasyprint/tests => tests}/test_boxes.py | 12 +- {weasyprint/tests => tests}/test_counters.py | 2 +- {weasyprint/tests => tests}/test_css.py | 11 +- .../tests => tests}/test_css_descriptors.py | 4 +- .../tests => tests}/test_css_validation.py | 8 +- .../tests => tests}/test_draw/__init__.py | 0 .../test_draw/test_background.py | 0 .../test_draw/test_before_after.py | 0 .../tests => tests}/test_draw/test_box.py | 3 +- .../tests => tests}/test_draw/test_column.py | 0 .../test_draw/test_current_color.py | 0 .../tests => tests}/test_draw/test_float.py | 0 .../test_draw/test_gradient.py | 0 .../tests => tests}/test_draw/test_image.py | 0 .../tests => tests}/test_draw/test_list.py | 0 .../tests => tests}/test_draw/test_opacity.py | 0 .../test_draw/test_overflow.py | 0 .../tests => tests}/test_draw/test_table.py | 2 +- .../tests => tests}/test_draw/test_text.py | 0 .../test_draw/test_transform.py | 0 .../test_draw/test_visibility.py | 0 {weasyprint/tests => tests}/test_float.py | 2 +- {weasyprint/tests => tests}/test_fonts.py | 0 .../tests => tests}/test_layout/__init__.py | 0 .../tests => tests}/test_layout/test_block.py | 2 +- .../test_layout/test_column.py | 0 .../tests => tests}/test_layout/test_flex.py | 0 .../tests => tests}/test_layout/test_image.py | 2 +- .../test_layout/test_inline.py | 2 +- .../test_layout/test_inline_block.py | 0 .../tests => tests}/test_layout/test_list.py | 0 .../tests => tests}/test_layout/test_page.py | 2 +- .../test_layout/test_position.py | 0 .../test_layout/test_shrink_to_fit.py | 0 .../tests => tests}/test_layout/test_table.py | 0 {weasyprint/tests => tests}/test_pdf.py | 4 +- .../test_presentational_hints.py | 3 +- {weasyprint/tests => tests}/test_stacking.py | 2 +- {weasyprint/tests => tests}/test_target.py | 0 {weasyprint/tests => tests}/test_text.py | 4 +- {weasyprint/tests => tests}/test_unicode.py | 3 +- {weasyprint/tests => tests}/test_variables.py | 2 +- {weasyprint/tests => tests}/testing_utils.py | 8 +- 73 files changed, 122 insertions(+), 1863 deletions(-) delete mode 100644 NEWS.rst create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100755 setup.py rename {weasyprint/tests => tests}/__init__.py (100%) rename {weasyprint/tests => tests}/conftest.py (97%) rename {weasyprint/tests => tests}/resources/AHEM____.TTF (100%) rename {weasyprint/tests => tests}/resources/acid2-reference.html (100%) rename {weasyprint/tests => tests}/resources/acid2-test.html (100%) rename {weasyprint/tests => tests}/resources/blue.jpg (100%) rename {weasyprint/tests => tests}/resources/doc1.html (100%) rename {weasyprint/tests => tests}/resources/doc1_UTF-16BE.html (100%) rename {weasyprint/tests => tests}/resources/icon.png (100%) rename {weasyprint/tests => tests}/resources/latin1-test.css (100%) rename {weasyprint/tests => tests}/resources/logo_small.png (100%) rename {weasyprint/tests => tests}/resources/mini_ua.css (100%) rename {weasyprint/tests => tests}/resources/pattern.gif (100%) rename {weasyprint/tests => tests}/resources/pattern.palette.png (100%) rename {weasyprint/tests => tests}/resources/pattern.png (100%) rename {weasyprint/tests => tests}/resources/pattern.svg (100%) rename {weasyprint/tests => tests}/resources/really-a-png.svg (100%) rename {weasyprint/tests => tests}/resources/really-a-svg.png (100%) rename {weasyprint/tests => tests}/resources/sheet2.css (100%) rename {weasyprint/tests => tests}/resources/sub_directory/sheet1.css (100%) rename {weasyprint/tests => tests}/resources/user.css (100%) rename {weasyprint/tests => tests}/resources/utf8-test.css (100%) rename {weasyprint/tests => tests}/resources/weasyprint.otf (100%) rename {weasyprint/tests => tests}/test_acid2.py (97%) rename {weasyprint/tests => tests}/test_api.py (99%) rename {weasyprint/tests => tests}/test_boxes.py (99%) rename {weasyprint/tests => tests}/test_counters.py (99%) rename {weasyprint/tests => tests}/test_css.py (98%) rename {weasyprint/tests => tests}/test_css_descriptors.py (98%) rename {weasyprint/tests => tests}/test_css_validation.py (99%) rename {weasyprint/tests => tests}/test_draw/__init__.py (100%) rename {weasyprint/tests => tests}/test_draw/test_background.py (100%) rename {weasyprint/tests => tests}/test_draw/test_before_after.py (100%) rename {weasyprint/tests => tests}/test_draw/test_box.py (99%) rename {weasyprint/tests => tests}/test_draw/test_column.py (100%) rename {weasyprint/tests => tests}/test_draw/test_current_color.py (100%) rename {weasyprint/tests => tests}/test_draw/test_float.py (100%) rename {weasyprint/tests => tests}/test_draw/test_gradient.py (100%) rename {weasyprint/tests => tests}/test_draw/test_image.py (100%) rename {weasyprint/tests => tests}/test_draw/test_list.py (100%) rename {weasyprint/tests => tests}/test_draw/test_opacity.py (100%) rename {weasyprint/tests => tests}/test_draw/test_overflow.py (100%) rename {weasyprint/tests => tests}/test_draw/test_table.py (99%) rename {weasyprint/tests => tests}/test_draw/test_text.py (100%) rename {weasyprint/tests => tests}/test_draw/test_transform.py (100%) rename {weasyprint/tests => tests}/test_draw/test_visibility.py (100%) rename {weasyprint/tests => tests}/test_float.py (99%) rename {weasyprint/tests => tests}/test_fonts.py (100%) rename {weasyprint/tests => tests}/test_layout/__init__.py (100%) rename {weasyprint/tests => tests}/test_layout/test_block.py (99%) rename {weasyprint/tests => tests}/test_layout/test_column.py (100%) rename {weasyprint/tests => tests}/test_layout/test_flex.py (100%) rename {weasyprint/tests => tests}/test_layout/test_image.py (99%) rename {weasyprint/tests => tests}/test_layout/test_inline.py (99%) rename {weasyprint/tests => tests}/test_layout/test_inline_block.py (100%) rename {weasyprint/tests => tests}/test_layout/test_list.py (100%) rename {weasyprint/tests => tests}/test_layout/test_page.py (99%) rename {weasyprint/tests => tests}/test_layout/test_position.py (100%) rename {weasyprint/tests => tests}/test_layout/test_shrink_to_fit.py (100%) rename {weasyprint/tests => tests}/test_layout/test_table.py (100%) rename {weasyprint/tests => tests}/test_pdf.py (99%) rename {weasyprint/tests => tests}/test_presentational_hints.py (99%) rename {weasyprint/tests => tests}/test_stacking.py (98%) rename {weasyprint/tests => tests}/test_target.py (100%) rename {weasyprint/tests => tests}/test_text.py (99%) rename {weasyprint/tests => tests}/test_unicode.py (97%) rename {weasyprint/tests => tests}/test_variables.py (97%) rename {weasyprint/tests => tests}/testing_utils.py (95%) diff --git a/.gitignore b/.gitignore index 6938e2ea..0a264f0c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,4 @@ # Tests /.pytest_cache -/weasyprint/tests/.cache -/weasyprint/tests/test_draw/results +/tests/test_draw/results diff --git a/NEWS.rst b/NEWS.rst deleted file mode 100644 index bc28ea75..00000000 --- a/NEWS.rst +++ /dev/null @@ -1,1688 +0,0 @@ -====== - News -====== - - -Version 52.2 ------------- - -Released on 2020-12-06. - -Bug fixes: - -* `238e214 `_: - Fix URL handling with tinycss2 -* `#1248 `_: - Include missing test data -* `#1254 `_: - Top margins removed from children when tables are displayed on multiple pages -* `#1250 `_: - Correctly draw borders on the last line of split tables -* `a6f9c80 `_: - Add a nice gif to please gdk-pixbuf 2.42.0 - -Contributors: - -* Guillaume Ayoub -* Lucie Anglade -* Felix Schwarz - -Backers and sponsors: - -* PDF Blocks -* SimonSoft -* Menutech -* Simon Sapin -* Nathalie Gutton -* Andreas Zetti -* Tom Pohl -* Florian Demmer -* Moritz Mahringer - - -Version 52.1 ------------- - -Released on 2020-11-02. - -Bug fixes: - -* `238e214 `_: - Fix URL handling with tinycss2 - -Contributors: - -* Guillaume Ayoub - -Backers and sponsors: - -* SimonSoft -* Simon Sapin -* Nathalie Gutton -* Andreas Zettl -* Florian Demmer -* Moritz Mahringer - - -Version 52 ----------- - -Released on 2020-10-29. - -Dependencies: - -* Python 3.6+ is now needed, Python 3.5 is not supported anymore -* WeasyPrint now depends on Pillow - -New features: - -* `#1019 `_: - Implement ``counter-set`` -* `#1080 `_: - Don’t display ``template`` tags -* `#1210 `_: - Use ``download`` attribute in ``a`` tags for attachment's filename -* `#1206 `_: - Handle strings in ``list-style-type`` -* `#1165 `_: - Add support for concatenating ``var()`` functions in ``content`` declarations -* `c56b96b `_: - Add an option to optimize embedded images size, with financial support from - Hashbang -* `#969 `_: - Add an image cache that can be shared between documents, with financial - support from Hashbang - -Bug fixes: - -* `#1141 `_: - Don’t clip page margins on account of ``body`` overflow -* `#1000 `_: - Don’t apply ``text-indent`` twice on inline blocks -* `#1051 `_: - Avoid random line breaks -* `#1120 `_: - Gather target counters in page margins -* `#1110 `_: - Handle most cases for boxes avoiding floats in rtl containers, with financial - support from Innovative Software -* `#1111 `_: - Fix horizontal position of last rtl line, with financial support from - Innovative Software -* `#1114 `_: - Fix bug with transparent borders in tables -* `#1146 `_: - Don’t gather bookmarks twice for blocks that are displayed on two pages -* `#1237 `_: - Use fallback fonts on unsupported WOFF2 and WOFF fonts -* `#1025 `_: - Don’t insert the same layout attributes multiple times -* `#1027 `_: - Don’t try to break tables after the header or before the footer -* `#1050 `_: - Don’t crash on absolute SVG files with no intrinsic size -* `#1204 `_: - Fix a crash with a flexbox corner case -* `#1030 `_: - Fix frozen builds -* `#1089 `_: - Fix Pyinstaller builds -* `#1216 `_: - Fix embedded files -* `#1225 `_: - Initial support of RTL direction in flexbox layout - -Documentation: - -* `#1149 `_: - Add the ``--quiet`` CLI option in the documentation -* `#1061 `_: - Update install instructions on Windows - -Tests: - -* `#1209 `_: - Use GitHub Actions instead of Travis - -Contributors: - -* Guillaume Ayoub -* Lucie Anglade -* Tontyna -* Mohammed Y. Alnajdi -* Mike Voets -* Bjarni Þórisson -* Balázs Dukai -* Bart Broere -* Endalkachew -* Felix Schwarz -* Julien Sanchez -* Konstantin Alekseev -* Nicolas Hart -* Nikolaus Schlemm -* Thomas J. Lampoltshammer -* mPyth -* nempoBu4 -* saddy001 - -Backers and sponsors: - -* Hashbang -* Innovative Software -* Screenbreak -* Simon Sapin -* Lisa Warshaw -* Nathalie Gutton -* Andreas Zettl -* Florian Demmer -* Moritz Mahringer - - -Version 51 ----------- - -Released on 2019-12-23. - -Dependencies: - -* Pyphen 0.9.1+ is now needed - -New features: - -* `#882 `_: - Add support of ``element()`` and ``running()`` -* `#972 `_: - Add HTML element to Box class -* `7a4d6f8 `_: - Support ``larger`` and ``smaller`` values for ``font-size`` - -Bug fixes: - -* `#960 `_: - Fix how fonts used for macOS tests are installed -* `#956 `_: - Fix various crashes due to line breaking bugs -* `#983 `_: - Fix typo in variable name -* `#975 `_: - Don’t crash when ``string-set`` is set to ``none`` -* `#998 `_: - Keep font attributes when text lines are modified -* `#1005 `_: - Don’t let presentational hints add decorations on tables with no borders -* `#974 `_: - Don’t crash on improper ``var()`` values -* `#1012 `_: - Fix rendering of header and footer for empty tables -* `#1013 `_: - Avoid quadratic time relative to tree depth when setting page names - -Contributors: - -- Lucie Anglade -- Guillaume Ayoub -- Guillermo Bonvehí -- Holger Brunn -- Felix Schwarz -- Tontyna - - -Version 50 ----------- - -Released on 2019-09-19. - -New features: - -* `#209 `_: - Make ``break-*`` properties work inside tables -* `#661 `_: - Make blocks with ``overflow: auto`` grow to include floating children - -Bug fixes: - -* `#945 `_: - Don't break pages between a list item and its marker -* `#727 `_: - Avoid tables lost between pages -* `#831 `_: - Ignore auto margins on flex containers -* `#923 `_: - Fix a couple of crashes when splitting a line twice -* `#896 `_: - Fix skip stack order when using a reverse flex direction - -Contributors: - -- Lucie Anglade -- Guillaume Ayoub - - -Version 49 ----------- - -Released on 2019-09-11. - -Performance: - -* Speed and memory use have been largely improved. - -New features: - -* `#700 `_: - Handle ``::marker`` pseudo-selector -* `135dc06c `_: - Handle ``recto`` and ``verso`` parameters for page breaks -* `#907 `_: - Provide a clean way to build layout contexts - -Bug fixes: - -* `#937 `_: - Fix rendering of tables with empty lines and rowspans -* `#897 `_: - Don't crash when small columns are wrapped in absolute blocks -* `#913 `_: - Fix a test about gradient colors -* `#924 `_: - Fix title for document with attachments -* `#917 `_: - Fix tests with Pango 1.44 -* `#919 `_: - Fix padding and margin management for column flex boxes -* `#901 `_: - Fix width of replaced boxes with no intrinsic width -* `#906 `_: - Don't respect table cell width when content doesn't fit -* `#927 `_: - Don't use deprecated ``logger.warn`` anymore -* `a8662794 `_: - Fix margin collapsing between caption and table wrapper -* `87d9e84f `_: - Avoid infinite loops when rendering columns -* `789b80e6 `_: - Only use in flow children to set columns height -* `615e298a `_: - Don't include floating elements each time we try to render a column -* `48d8632e `_: - Avoid not in flow children to compute column height -* `e7c452ce `_: - Fix collapsing margins for columns -* `fb0887cf `_: - Fix crash when using currentColor in gradients -* `f66df067 `_: - Don't crash when using ex units in word-spacing in letter-spacing -* `c790ff20 `_: - Don't crash when properties needing base URL use var functions -* `d63eac31 `_: - Don't crash with object-fit: non images with no intrinsic size - -Documentation: - -* `#900 `_: - Add documentation about semantic versioning -* `#692 `_: - Add a snippet about PDF magnification -* `#899 `_: - Add .NET wrapper link -* `#893 `_: - Fixed wrong nested list comprehension example -* `#902 `_: - Add ``state`` to the ``make_bookmark_tree`` documentation -* `#921 `_: - Fix typos in the documentation -* `#328 `_: - Add CSS sample for forms - -Contributors: - -- Lucie Anglade -- Guillaume Ayoub -- Raphael Gaschignard -- Stani -- Szmen -- Thomas Dexter -- Tontyna - - -Version 48 ----------- - -Released on 2019-07-08. - -Dependencies: - -* CairoSVG 2.4.0+ is now needed - -New features: - -* `#891 `_: - Handle ``text-overflow`` -* `#878 `_: - Handle ``column-span`` -* `#855 `_: - Handle all the ``text-decoration`` features -* `#238 `_: - Don't repeat background images when it's not needed -* `#875 `_: - Handle ``object-fit`` and ``object-position`` -* `#870 `_: - Handle ``bookmark-state`` - -Bug fixes: - -* `#686 `_: - Fix column balance when children are not inline -* `#885 `_: - Actually use the content box to resolve flex items percentages -* `#867 `_: - Fix rendering of KaTeX output, including (1) set row baseline of tables when - no cells are baseline-aligned, (2) set baseline for inline tables, (3) don't - align lines larger than their parents, (4) force CairoSVG to respect image - size defined by CSS. -* `#873 `_: - Set a minimum height for empty list elements with outside marker -* `#811 `_: - Don't use translations to align flex items -* `#851 `_, - `#860 `_: - Don't cut pages when content overflows a very little bit -* `#862 `_: - Don't crash when using UTC dates in metadata - -Documentation: - -* `#854 `_: - Add a "Tips & Tricks" section - -Contributors: - -- Gabriel Corona -- Guillaume Ayoub -- Manuel Barkhau -- Nathan de Maestri -- Lucie Anglade -- theopeek - - -Version 47 ----------- - -Released on 2019-04-12. - -New features: - -* `#843 `_: - Handle CSS variables -* `#846 `_: - Handle ``:nth()`` page selector -* `#847 `_: - Allow users to use a custom SSL context for HTTP requests - -Bug fixes: - -* `#797 `_: - Fix underlined justified text -* `#836 `_: - Fix crash when flex items are replaced boxes -* `#835 `_: - Fix ``margin-break: auto`` - - -Version 46 ----------- - -Released on 2019-03-20. - -New features: - -* `#771 `_: - Handle ``box-decoration-break`` -* `#115 `_: - Handle ``margin-break`` -* `#821 `_: - Continuous integration includes tests on Windows - -Bug fixes: - -* `#765 `_, - `#754 `_, - `#800 `_: - Fix many crashes related to the flex layout -* `#783 `_: - Fix a couple of crashes with strange texts -* `#827 `_: - Named strings and counters are case-sensitive -* `#823 `_: - Shrink min/max-height/width according to box-sizing -* `#728 `_, - `#171 `_: - Don't crash when fixed boxes are nested -* `#610 `_, - `#828 `_: - Don't crash when preformatted text lines end with a space -* `#808 `_, - `#387 `_: - Fix position of some images -* `#813 `_: - Don't crash when long preformatted text lines end with ``\n`` - -Documentation: - -* `#815 `_: - Add documentation about custom ``url_fetcher`` - - -Version 45 ----------- - -Released on 2019-02-20. - -WeasyPrint now has a `code of conduct -`_. - -A new website has been launched, with beautiful and useful graphs about speed -and memory use across versions: check `WeasyPerf -`_. - -Dependencies: - -* Python 3.5+ is now needed, Python 3.4 is not supported anymore - -Bug fixes: - -* `#798 `_: - Prevent endless loop and index out of range in pagination -* `#767 `_: - Add a ``--quiet`` CLI parameter -* `#784 `_: - Fix library loading on Alpine -* `#791 `_: - Use path2url in tests for Windows -* `#789 `_: - Add LICENSE file to distributed sources -* `#788 `_: - Fix pending references -* `#780 `_: - Don't draw patterns for empty page backgrounds -* `#774 `_: - Don't crash when links include quotes -* `#637 `_: - Fix a problem with justified text -* `#763 `_: - Launch tests with Python 3.7 -* `#704 `_: - Fix a corner case with tables -* `#804 `_: - Don't logger handlers defined before importing WeasyPrint -* `#109 `_, - `#748 `_: - Don't include punctuation for hyphenation -* `#770 `_: - Don't crash when people use uppercase words from old-fashioned Microsoft - fonts in tables, especially when there's an 5th column -* Use a `separate logger - `_ to - report the rendering process -* Add a ``--debug`` CLI parameter and set debug level for unknown prefixed CSS - properties -* Define minimal versions of Python and setuptools in setup.cfg - -Documentation: - -* `#796 `_: - Fix a small typo in the tutorial -* `#792 `_: - Document no alignement character support -* `#773 `_: - Fix phrasing in Hacking section -* `#402 `_: - Add a paragraph about fontconfig error -* `#764 `_: - Fix list of dependencies for Alpine -* Fix API documentation of HTML and CSS classes - - -Version 44 ----------- - -Released on 2018-12-29. - -Bug fixes: - -* `#742 `_: - Don't crash during PDF generation when locale uses commas as decimal separator -* `#746 `_: - Close file when reading VERSION -* Improve speed and memory usage for long texts. - -Documentation: - -* `#733 `_: - Small documentation fixes -* `#735 `_: - Fix broken links in NEWS.rst - - -Version 43 ----------- - -Released on 2018-11-09. - -Bug fixes: - -* `#726 `_: - Make empty strings clear previous values of named strings -* `#729 `_: - Include tools in packaging - -This version also includes the changes from unstable rc1 and rc2 versions -listed below. - - -Version 43rc2 -------------- - -Released on 2018-11-02. - -**This version is experimental, don't use it in production. If you find bugs, -please report them!** - -Bug fixes: - -* `#706 `_: - Fix text-indent at the beginning of a page -* `#687 `_: - Allow query strings in file:// URIs -* `#720 `_: - Optimize minimum size calculation of long inline elements -* `#717 `_: - Display
tags as blocks -* `#691 `_: - Don't recalculate max content widths when distributing extra space for tables -* `#722 `_: - Fix bookmarks and strings set on images -* `#723 `_: - Warn users when string() is not used in page margin - - -Version 43rc1 -------------- - -Released on 2018-10-15. - -**This version is experimental, don't use it in production. If you find bugs, -please report them!** - -Dependencies: - -* Python 3.4+ is now needed, Python 2.x is not supported anymore -* Cairo 1.15.4+ is now needed, but 1.10+ should work with missing features - (such as links, outlines and metadata) -* Pdfrw is not needed anymore - -New features: - -* `Beautiful website `_ -* `#579 `_: - Initial support of flexbox -* `#592 `_: - Support @font-face on Windows -* `#306 `_: - Add a timeout parameter to the URL fetcher functions -* `#594 `_: - Split tests using modern pytest features -* `#599 `_: - Make tests pass on Windows -* `#604 `_: - Handle target counters and target texts -* `#631 `_: - Enable counter-increment and counter-reset in page context -* `#622 `_: - Allow pathlib.Path objects for HTML, CSS and Attachment classes -* `#674 `_: - Add extensive installation instructions for Windows - -Bug fixes: - -* `#558 `_: - Fix attachments -* `#565 `_, - `#596 `_, - `#539 `_: - Fix many PDF rendering, printing and compatibility problems -* `#614 `_: - Avoid crashes and endless loops caused by a Pango bug -* `#662 `_: - Fix warnings and errors when generating documentation -* `#666 `_, - `#685 `_: - Fix many table layout rendering problems -* `#680 `_: - Don't crash when there's no font available -* `#662 `_: - Fix support of some align values in tables - - -Version 0.42.3 --------------- - -Released on 2018-03-27. - -Bug fixes: - -* `#583 `_: - Fix floating-point number error to fix floating box layout -* `#586 `_: - Don't optimize resume_at when splitting lines with trailing spaces -* `#582 `_: - Fix table layout with no overflow -* `#580 `_: - Fix inline box breaking function -* `#576 `_: - Split replaced_min_content_width and replaced_max_content_width -* `#574 `_: - Respect text direction and don't translate rtl columns twice -* `#569 `_: - Get only first line's width of inline children to get linebox width - - -Version 0.42.2 --------------- - -Released on 2018-02-04. - -Bug fixes: - -* `#560 `_: - Fix a couple of crashes and endless loops when breaking lines. - - -Version 0.42.1 --------------- - -Released on 2018-02-01. - -Bug fixes: - -* `#566 `_: - Don't crash when using @font-config. -* `#567 `_: - Fix text-indent with text-align: justify. -* `#465 `_: - Fix string(\*, start). -* `#562 `_: - Handle named pages with pseudo-class. -* `#507 `_: - Fix running headers. -* `#557 `_: - Avoid infinite loops in inline_line_width. -* `#555 `_: - Fix margins, borders and padding in column layouts. - - -Version 0.42 ------------- - -Released on 2017-12-26. - -WeasyPrint is not tested with (end-of-life) Python 3.3 anymore. - -**This release is probably the last version of the 0.x series.** - -Next version may include big changes: - -- end of Python 2.7 support, -- initial support of bidirectional text, -- initial support of flexbox, -- improvements for speed and memory usage. - -New features: - -* `#532 `_: - Support relative file URIs when using CLI. - -Bug fixes: - -* `#553 `_: - Fix slow performance for pre-formatted boxes with a lot of children. -* `#409 `_: - Don't crash when rendering some tables. -* `#39 `_: - Fix rendering of floats in inlines. -* `#301 `_: - Split lines carefully. -* `#530 `_: - Fix root when frozen with Pyinstaller. -* `#534 `_: - Handle SVGs containing images embedded as data URIs. -* `#360 `_: - Fix border-radius rendering problem with some PDF readers. -* `#525 `_: - Fix pipenv support. -* `#227 `_: - Smartly handle replaced boxes with percentage width in auto-width parents. -* `#520 `_: - Don't ignore CSS @page rules that are imported by an @import rule. - - -Version 0.41 ------------- - -Released on 2017-10-05. - -WeasyPrint now depends on pdfrw >= 0.4. - -New features: - -* `#471 `_: - Support page marks and bleed. - -Bug fixes: - -* `#513 `_: - Don't crash on unsupported image-resolution values. -* `#506 `_: - Fix @font-face use with write_* methods. -* `#500 `_: - Improve readability of _select_source function. -* `#498 `_: - Use CSS prefixes as recommanded by the CSSWG. -* `#441 `_: - Fix rendering problems and crashes when using @font-face. -* `bb3a4db `_: - Try to break pages after a block before trying to break inside it. -* `1d1654c `_: - Fix and test corner cases about named pages. - -Documentation: - -* `#508 `_: - Add missing libpangocairo dependency for Debian and Ubuntu. -* `a7b17fb `_: - Add documentation on logged rendering steps. - - -Version 0.40 ------------- - -Released on 2017-08-17. - -WeasyPrint now depends on cssselect2 instead of cssselect and lxml. - -New features: - -* `#57 `_: - Named pages. -* Unprefix properties, see - `#498 `_. -* Add a "verbose" option logging the document generation steps. - -Bug fixes: - -* `#483 `_: - Fix slow performance with long pre-formatted texts. -* `#70 `_: - Improve speed and memory usage for long documents. -* `#487 `_: - Don't crash on local() fonts with a space and no quotes. - - -Version 0.39 ------------- - -Released on 2017-06-24. - -Bug fixes: - -* Fix the use of WeasyPrint's URL fetcher with CairoSVG. - - -Version 0.38 ------------- - -Released on 2017-06-16. - -Bug fixes: - -* `#477 `_: - Don't crash on font-face's src attributes with local functions. - - -Version 0.37 ------------- - -Released on 2017-06-15. - -WeasyPrint now depends on tinycss2 instead of tinycss. - -New features: - -* `#437 `_: - Support local links in generated PDFs. - -Bug fixes: - -* `#412 `_: - Use a NullHandler log handler when WeasyPrint is used as a library. -* `#417 `_, - `#472 `_: - Don't crash on some line breaks. -* `#327 `_: - Don't crash with replaced elements with height set in percentages. -* `#467 `_: - Remove incorrect line breaks. -* `#446 `_: - Let the logging module do the string interpolation. - - -Version 0.36 ------------- - -Released on 2017-02-25. - -New features: - -* `#407 `_: - Handle ::first-letter. -* `#423 `_: - Warn user about broken cairo versions. - -Bug fixes: - -* `#411 `_: - Typos fixed in command-line help. - - -Version 0.35 ------------- - -Released on 2017-02-25. - -Bug fixes: - -* `#410 `_: - Fix AssertionError in split_text_box. - - -Version 0.34 ------------- - -Released on 2016-12-21. - -Bug fixes: - -* `#398 `_: - Honor the presentational_hints option for PDFs. -* `#399 `_: - Avoid CairoSVG-2.0.0rc* on Python 2. -* `#396 `_: - Correctly close files open by mkstemp. -* `#403 `_: - Cast the number of columns into int. -* Fix multi-page multi-columns and add related tests. - - -Version 0.33 ------------- - -Released on 2016-11-28. - -New features: - -* `#393 `_: - Add tests on MacOS. -* `#370 `_: - Enable @font-face on MacOS. - -Bug fixes: - -* `#389 `_: - Always update resume_at when splitting lines. -* `#394 `_: - Don't build universal wheels. -* `#388 `_: - Fix logic when finishing block formatting context. - - -Version 0.32 ------------- - -Released on 2016-11-17. - -New features: - -* `#28 `_: - Support @font-face on Linux. -* Support CSS fonts level 3 almost entirely, including OpenType features. -* `#253 `_: - Support presentational hints (optional). -* Support break-after, break-before and break-inside for pages and columns. -* `#384 `_: - Major performance boost. - -Bux fixes: - -* `#368 `_: - Respect white-space for shrink-to-fit. -* `#382 `_: - Fix the preferred width for column groups. -* Handle relative boxes in column-layout boxes. - -Documentation: - -* Add more and more documentation about Windows installation. -* `#355 `_: - Add fonts requirements for tests. - - -Version 0.31 ------------- - -Released on 2016-08-28. - -New features: - -* `#124 `_: - Add MIME sniffing for images. -* `#60 `_: - CSS Multi-column Layout. -* `#197 `_: - Add hyphens at line breaks activated by a soft hyphen. - -Bux fixes: - -* `#132 `_: - Fix Python 3 compatibility on Windows. - -Documentation: - -* `#329 `_: - Add documentation about installation on Windows. - - -Version 0.30 ------------- - -Released on 2016-07-18. - -WeasyPrint now depends on html5lib-0.999999999. - -Bux fixes: - -* Fix Acid2 -* `#325 `_: - Cutting lines is broken in page margin boxes. -* `#334 `_: - Newest html5lib 0.999999999 breaks rendering. - - -Version 0.29 ------------- - -Released on 2016-06-17. - -Bug fixes: - -* `#263 `_: - Don't crash with floats with percents in positions. -* `#323 `_: - Fix CairoSVG 2.0 pre-release dependency in Python 2.x. - - -Version 0.28 ------------- - -Released on 2016-05-16. - -Bug fixes: - -* `#189 `_: - ``white-space: nowrap`` still wraps on hyphens -* `#305 `_: - Fix crashes on some tables -* Don't crash when transform matrix isn't invertible -* Don't crash when rendering ratio-only SVG images -* Fix margins and borders on some tables - - -Version 0.27 ------------- - -Released on 2016-04-08. - -New features: - -* `#295 `_: - Support the 'rem' unit. -* `#299 `_: - Enhance the support of SVG images. - -Bug fixes: - -* `#307 `_: - Fix the layout of cells larger than their tables. - -Documentation: - -* The website is now on GitHub Pages, the documentation is on Read the Docs. -* `#297 `_: - Rewrite the CSS chapter of the documentation. - - -Version 0.26 ------------- - -Released on 2016-01-29. - -New features: - -* Support the `empty-cells` attribute. -* Respect table, column and cell widths. - -Bug fixes: - -* `#172 `_: - Unable to set table column width on tables td's. -* `#151 `_: - Table background colour bleeds beyond table cell boundaries. -* `#260 `_: - TypeError: unsupported operand type(s) for +: 'float' and 'str'. -* `#288 `_: - Unwanted line-breaks in bold text. -* `#286 `_: - AttributeError: 'Namespace' object has no attribute 'attachments'. - - -Version 0.25 ------------- - -Released on 2015-12-17. - -New features: - -* Support the 'q' unit. - -Bug fixes: - -* `#285 `_: - Fix a crash happening when splitting lines. -* `#284 `_: - Escape parenthesis in PDF links. -* `#280 `_: - Replace utf8 with utf-8 for gettext/django compatibility. -* `#269 `_: - Add support for use when frozen. -* `#250 `_: - Don't crash when attachments are not available. - - -Version 0.24 ------------- - -Released on 2015-08-04. - -New features: - -* `#174 `_: - Basic support for Named strings. - -Bug fixes: - -* `#207 `_: - Draw rounded corners on replaced boxes. -* `#224 `_: - Rely on the font size for rounding bug workaround. -* `#31 `_: - Honor the vertical-align property in fixed-height cells. -* `#202 `_: - Remove unreachable area/border at bottom of page. -* `#225 `_: - Don't allow unknown units during line-height validation. -* Fix some wrong conflict resolutions for table borders with inset - and outset styles. - - -Version 0.23 ------------- - -Released on 2014-09-16. - -Bug fixes: - -* `#196 `_: - Use the default image sizing algorithm for images’s preferred size. -* `#194 `_: - Try more library aliases with ``dlopen()``. -* `#201 `_: - Consider ``page-break-after-avoid`` when pushing floats to the next page. -* `#217 `_: - Avoid a crash on zero-sized background images. - -Release process: - -* Start testing on Python 3.4 on Travis-CI. - - -Version 0.22 ------------- - -Released on 2014-05-05. - -New features: - -* `#86 `_: - Support gzip and deflate encoding in HTTP responses -* `#177 `_: - Support for PDF attachments. - -Bug fixes: - -* `#169 `_: - Fix a crash on percentage-width columns in an auto-width table. -* `#168 `_: - Make ``
`` a block in the user-agent stylesheet. -* `#175 `_: - Fix some ``dlopen()`` library loading issues on OS X. -* `#183 `_: - Break to the next page before a float that would overflow the page. - (It might still overflow if it’s bigger than the page.) -* `#188 `_: - Require a recent enough version of Pyphen - -Release process: - -* Drop Python 3.1 support. -* Set up [Travis CI](http://travis-ci.org/) - to automatically test all pushes and pull requests. -* Start testing on Python 3.4 locally. (Travis does not support 3.4 yet.) - - -Version 0.21 ------------- - -Released on 2014-01-11. - -New features: - -* Add the `overflow-wrap `_ - property, allowing line breaks inside otherwise-unbreakable words. - Thanks Frédérick Deslandes! -* Add the `image-resolution - `_ property, - allowing images to be sized proportionally to their intrinsic size - at a resolution other than 96 image pixels per CSS ``in`` - (ie. one image pixel per CSS ``px``) - -Bug fixes: - -* `#145 `_: - Fix parsing HTML from an HTTP URL on Python 3.x -* `#40 `_: - Use more general hyphenation dictionnaries for specific document languages. - (E.g. use ``hyph_fr.dic`` for ``lang="fr_FR"``.) -* `#26 `_: - Fix ``min-width`` and ``max-width`` on floats. -* `#100 `_: - Fix a crash on trailing whitespace with ``font-size: 0`` -* `#82 `_: - Borders on tables with ``border-collapse: collapse`` were sometimes - drawn at an incorrect position. -* `#30 `_: - Fix positioning of images with ``position: absolute``. -* `#118 `_: - Fix a crash when using ``position: absolute`` - inside a ``position: relative`` element. -* Fix ``visibility: collapse`` to behave like ``visibility: hidden`` - on elements other than table rows and table columns. -* `#147 `_ and - `#153 `_: - Fix dependencies to require lxml 3.0 or a more recent version. - Thanks gizmonerd and Thomas Grainger! -* `#152 `_: - Fix a crash on percentage-sized table cells in auto-sized tables. - Thanks Johannes Duschl! - - -Version 0.20.2 --------------- - -Released on 2013-12-18. - -* Fix `#146 `_: don't crash - when drawing really small boxes with dotted/dashed borders - - -Version 0.20.1 --------------- - -Released on 2013-12-16. - -* Depend on html5lib >= 0.99 instead of 1.0b3 to fix pip 1.4 support. -* Fix `#74 `_: don't crash on - space followed by dot at line break. -* Fix `#78 `_: nicer colors for - border-style: ridge/groove/inset/outset. - - -Version 0.20 ------------- - -Released on 2013-12-14. - -* Add support for ``border-radius``. -* Feature `#77 `_: Add PDF - metadata from HTML. -* Feature `#12 `_: Use html5lib. -* Tables: handle percentages for column groups, columns and cells, and values - for row height. -* Bug fixes: - - * Fix `#84 `_: don't crash when - stylesheets are not available. - * Fix `#101 `_: use page ids - instead of page numbers in PDF bookmarks. - * Use ``logger.warning`` instead of deprecated ``logger.warn``. - * Add 'font-stretch' in the 'font' shorthand. - - -Version 0.19.2 --------------- - -Released on 2013-06-18. - -Bug fix release: - -* Fix `#88 `_: - ``text-decoration: overline`` not being drawn above the text -* Bug fix: Actually draw multiple lines when multiple values are given - to ``text-decoration``. -* Use the font metrics for text decoration positioning. -* Bug fix: Don't clip the border with ``overflow: hidden``. -* Fix `#99 `_: - Regression: JPEG images not loading with cairo 1.8.x. - - -Version 0.19.1 --------------- - -Released on 2013-04-30. - -Bug fix release: - -* Fix incorrect intrinsic width calculation - leading to unnecessary line breaks in floats, tables, etc. -* Tweak border painting to look better -* Fix unnecessary page break before big tables. -* Fix table row overflowing at the bottom of the page - when there are margins above the table. -* Fix ``position: fixed`` to actually repeat on every page. -* Fix `#76 `_: - repeat ```` and ```` elements on every page, - even with table border collapsing. - - -Version 0.19 ------------- - -Released on 2013-04-18. - -* Add support for ``linear-gradient()`` and ``radial-gradient`` - in background images. -* Add support for the ``ex`` and ``ch`` length units. - (``1ex`` is based on the font instead of being always ``0.5em`` as before.) -* Add experimental support for Level 4 hyphenation properties. -* Drop support for CFFI < 0.6 and cairocffi < 0.4. -* Many bug fixes, including: - - * Fix `#54 `_: - min/max-width/height on block-level images. - * Fix `#71 `_: - Crash when parsing nested functional notation. - - -Version 0.18 ------------- - -Released on 2013-03-30. - -* Add support for Level 3 backgrounds, - including multiple background layers per element/box. -* Forward-compatibility with (future releases of) cairocffi 0.4+ and CFFI 0.6+. -* Bug fixes: - - * Avoid some unnecessary line breaks - for elements sized based on their content (aka. “shrink-to-fit”) - such as floats and page headers. - * Allow page breaks between empty blocks. - * Fix `#66 `_: - Resolve images’ auto width from non-auto height and intrinsic ratio. - * Fix `#21 `_: - The ``data:`` URL scheme is case-insensitive. - * Fix `#53 `_: - Crash when backtracking for ``break-before/after: avoid``. - - -Version 0.17.1 --------------- - -Released on 2013-03-18. - -Bug fixes: - -* Fix `#41 `_: - GObject initialization when GDK-PixBuf is not installed. -* Fix `#42 `_: - absolute URLs without a base URL (ie. document parsed from a string.) -* Fix some whitespace collapsing bugs. -* Fix absolutely-positioned elements inside inline elements. -* Fix URL escaping of image references from CSS. -* Fix `#49 `_: - Division by 0 on dashed or dotted border smaller than one dot/dash. -* Fix `#44 `_: - bad interaction of ``page-break-before/after: avoid`` and floats. - - -Version 0.17 ------------- - -Released on 2013-02-27. - -* Added `text hyphenation`_ with the ``-weasy-hyphens`` property. -* When a document includes JPEG images, embed them as JPEG in the PDF output. - This often results in smaller PDF file size - compared to the default *deflate* compression. -* Switched to using CFFI instead of PyGTK or PyGObject-introspection. -* Layout bug fixes: - - - Correctly trim whitespace at the end of lines. - - Fix some cases with floats within inline content. - -.. _text hyphenation: https://weasyprint.readthedocs.io/en/latest/features.html#css-text-module-level-3-4 - - -Version 0.16 ------------- - -Released on 2012-12-13. - -* Add the ``zoom`` parameter to ``HTML.write_pdf`` and - ``Document.write_pdf() `` -* Fix compatibility with old (and buggy) pycairo versions. - WeasyPrint is now tested on 1.8.8 in addition to the latest. -* Fix layout bugs related to line trailing spaces. - - -Version 0.15 ------------- - -Released on 2012-10-09. - -* Add a low-level API that enables painting pages individually on any - cairo surface. -* **Backward-incompatible change**: remove the ``HTML.get_png_pages`` - method. The new low-level API covers this functionality and more. -* Add support for the ``font-stretch`` property. -* Add support for ``@page:blank`` to select blank pages. -* New Sphinx-based and improved docs -* Bug fixes: - - - Importing Pango in some PyGTK installations. - - Layout of inline-blocks with `vertical-align: top` or `bottom`. - - Do not repeat a block’s margin-top or padding-top after a page break. - - Performance problem with large tables split across many pages. - - Anchors and hyperlinks areas now follow CSS transforms. - Since PDF links have to be axis-aligned rectangles, the bounding box - is used. This may be larger than expected with rotations that are - not a multiple of 90 degrees. - - -Version 0.14 ------------- - -Released on 2012-08-03. - -* Add a public API to choose media type used for @media. - (It still defaults to ``print``). Thanks Chung Lu! -* Add ``--base-url`` and ``--resolution`` to the command-line API, making it - as complete as the Python one. -* Add support for the ```` element in HTML. -* Add support for CSS outlines -* Switch to gdk-pixbuf instead of Pystacia for loading raster images. -* Bug fixes: - - - Handling of filenames and URLs on Windows - - Unicode filenames with older version of py2cairo - - ``base_url`` now behaves as expected when set to a directory name. - - Make some tests more robust - - -Version 0.13 ------------- - -Released on 2012-07-23. - -* Add support for PyGTK, as an alternative to PyGObject + introspection. - This should make WeasyPrint easier to run on platforms that not not have - packages for PyGObject 3.x yet. -* Bug fix: crash in PDF outlines for some malformed HTML documents - - -Version 0.12 ------------- - -Released on 2012-07-19. - -* Add support for collapsed borders on tables. This is currently incompatible - with repeating header and footer row groups on each page: headers and footers - are treated as normal row groups on table with ``border-collapse: collapse``. -* Add ``url_fetcher`` to the public API. This enables users to hook into - WeasyPrint for fetching linked stylesheets or images, eg. to generate them - on the fly without going through the network. - This enables the creation of `Flask-WeasyPrint - `_. - - -Version 0.11 ------------- - -Released on 2012-07-04. - -* Add support for floats and clear. - Together with various bug fixes, this enables WeasyPrint to pass the Acid2 - test! Acid2 is now part of our automated test suite. -* Add support for the width, min-width, max-width, height, min-height and - max-height properties in @page. The size property is now the size of the - page’s containing block. -* Switch the Variable Dimension rules to `the new proposal - `_. - The previous implementation was broken in many cases. -* The ``image-rendering``, ``transform``, ``transform-origin`` and ``size`` - properties are now unprefixed. The prefixed form (eg. -weasy-size) is ignored - but gives a specific warning. - - -Version 0.10 ------------- - -Released on 2012-06-25. - -* Add ``get_png_pages()`` to the public API. It returns each page as - a separate PNG image. -* Add a ``resolution`` parameter for PNG. -* Add *WeasyPrint Navigator*, a web application that shows WeasyPrint’s - output with clickable links. Yes, that’s a browser in your browser. - Start it with ``python -m weasyprint.navigator`` -* Add support for `vertical-align: top` and `vertical-align: bottom` -* Add support for `page-break-before: avoid` and `page-break-after: avoid` -* Bug fixes - - -Version 0.9 ------------ - -Released on 2012-06-04. - -* Relative, absolute and fixed positioning -* Proper painting order (z-index) -* In PDF: support for internal and external hyperlinks as well as bookmarks. -* Added the ``tree`` parameter to the ``HTML`` class: accepts a parsed lxml - object. -* Bug fixes, including many crashes. - -Bookmarks can be controlled by the ``-weasy-bookmark-level`` and -``-weasy-bookmark-label`` properties, as described in `CSS Generated Content -for Paged Media Module `_. - -The default UA stylesheet sets a matching bookmark level on all ``

`` -to ``

`` elements. - - -Version 0.8 ------------ - -Released on 2012-05-07. - -* Switch from cssutils to tinycss_ as the CSS parser. -* Switch to the new cssselect_, almost all level 3 selectors are supported now. -* Support for inline blocks and inline tables -* Automatic table layout (column widths) -* Support for the ``min-width``, ``max-width``, ``min-height`` and - ``max-height`` properties, except on table-related and page-related boxes. -* Speed improvements on big stylesheets / small documents thanks to tinycss. -* Many bug fixes - -.. _tinycss: http://packages.python.org/tinycss/ -.. _cssselect: http://packages.python.org/cssselect/ - - -Version 0.7.1 -------------- - -Released on 2012-03-21. - -Change the license from AGPL to BSD. - - -Version 0.7 ------------ - -Released on 2012-03-21. - -* Support page breaks between table rows -* Support for the ``orphans`` and ``widows`` properties. -* Support for ``page-break-inside: avoid`` -* Bug fixes - -Only avoiding page breaks before/after an element is still missing. - - -Version 0.6.1 -------------- - -Released on 2012-03-01. - -Fix a packaging bug. (Remove use_2to3 in setup.py. We use the same -codebase for Python 2 and 3.) - - -Version 0.6 ------------ - -Released on 2012-02-29. - -* *Backward incompatible*: completely change the Python API. See the - documentation: - https://weasyprint.readthedocs.io/en/latest/tutorial.html#as-a-python-library -* *Backward incompatible*: Proper margin collapsing. - This changes how blocks are rendered: adjoining margins "collapse" - (their maximum is used) instead of accumulating. -* Support images in ``embed`` or ``object`` elements. -* Switch to pystacia instead of PIL for raster images -* Add compatibility with CPython 2.6 and 3.2. (Previously only 2.7 - was supported) -* Many bug fixes - - -Version 0.5 ------------ - -Released on 2012-02-08. - -* Support for the ``overflow`` and ``clip`` properties. -* Support for the ``opacity`` property from CSS3 Colors. -* Support for CSS 2D Transforms. These are prefixed, so you need to use - ``-weasy-transform`` and ``-weasy-transform-origin``. - - -Version 0.4 ------------ - -Released on 2012-02-07. - -* Support ``text-align: justify``, ``word-spacing`` and ``letter-spacing``. -* Partial support for CSS3 Paged Media: page size and margin boxes with - page-based counters. -* All CSS 2.1 border styles -* Fix SVG images with non-pixel units. Requires CairoSVG 0.3 -* Support for ``page-break-before`` and ``page-break-after``, except for - the value ``avoid``. -* Support for the ``background-clip``, ``background-origin`` and - ``background-size`` from CSS3 (but still with a single background - per element) -* Support for the ``image-rendering`` from SVG. This one is prefixed, - use ``-weasy-image-rendering``. It only has an effect on PNG output. - - -Version 0.3.1 -------------- - -Released on 2011-12-14. - -Compatibility with CairoSVG 0.1.2 - - -Version 0.3 ------------ - -Released on 2011-12-13. - -* **Backward-incompatible change:** the 'size' property is now prefixed (since - it is in an experimental specification). Use '-weasy-size' instead. -* cssutils 0.9.8 or higher is now required. -* Support SVG images with CairoSVG -* Support generated content: the ``:before`` and ``:after`` pseudo-elements, - the ``content``, ``quotes`` and ``counter-*`` properties. -* Support ordered lists: all CSS 2.1 values of the ``list-style-type`` property. -* New user-agent stylesheet with HTML 5 elements and automatic quotes for many - languages. Thanks Peter Moulder! -* Disable cssutils validation warnings, they are redundant with WeasyPrint’s. -* Add ``--version`` to the command-line script. -* Various bug fixes - - -Version 0.2 ------------ - -Released on 2011-11-25. - -* Support for tables. -* Support the `box-sizing` property from CSS 3 Basic User Interface -* Support all values of vertical-align except top and bottom. They are - interpreted as text-top and text-bottom. -* Minor bug fixes - -Tables have some limitations: -Only the fixed layout and separate border model are supported. -There are also no page break inside tables so a table higher -than a page will overflow. - - -Version 0.1 ------------ - -Released on 2011-10-28. - -First packaged release. Supports "simple" CSS 2.1 pages: there is no -support for floats, tables, or absolute positioning. Other than that -most of CSS 2.1 is supported, as well as CSS 3 Colors and Selectors. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d1651324 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,74 @@ +[build-system] +requires = ['flit'] +build-backend = 'flit.buildapi' + +[tool.flit.metadata] +module = 'weasyprint' +dist-name = 'WeasyPrint' +author = 'Simon Sapin' +author-email = 'simon.sapin@exyr.org' +maintainer = 'CourtBouillon' +maintainer-email = 'contact@courtbouillon.org' +home-page = 'https://www.courtbouillon.org/weasyprint' +requires = [ + 'cffi >=0.6', + 'html5lib >=0.999999999', + 'tinycss2 >=1.0.0', + 'cssselect2 >=0.1', + 'Pyphen >=0.9.1', + 'fonttools[woff] >=4.0', + 'Pillow >=4.0.0', +] +requires-python = '>=3.6' +keywords = 'html css pdf converter' +description-file = 'README.rst' +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + '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 :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Text Processing :: Markup :: HTML', + 'Topic :: Multimedia :: Graphics :: Graphics Conversion', + 'Topic :: Printing', +] + +[tool.flit.metadata.requires-extra] +doc = ['sphinx', 'sphinx_rtd_theme'] +test = ['pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]'] + +[tool.flit.scripts] +weasyprint = 'weasyprint.__main__:main' + +[tool.flit.metadata.urls] +Documentation = 'https://doc.courtbouillon.org/weasyprint/' +Code = 'https://github.com/Kozea/WeasyPrint' +Issues = 'https://github.com/Kozea/WeasyPrint/issues' +Donation = 'https://opencollective.com/courtbouillon' + +[tool.flit.sdist] +exclude = ['.*', 'tests/results'] + +[tool.pytest.ini_options] +addopts = '--isort --flake8 --cov' + +[tool.coverage.run] +branch = true +include = ['tests/*', 'weasyprint/*'] + +[tool.coverage.report] +exclude_lines = ['pragma: no cover', 'def __repr__', 'raise NotImplementedError'] +omit = ['.*'] + +[tool.isort] +default_section = 'FIRSTPARTY' +multi_line_output = 4 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 515d114b..00000000 --- a/setup.cfg +++ /dev/null @@ -1,116 +0,0 @@ -[metadata] -name = WeasyPrint -url = https://courtbouillon.org/weasyprint -version = file: weasyprint/VERSION -license = BSD -license_file = LICENSE -description = The Awesome Document Factory -long_description = file: README.rst -long_description_content_type = text/x-rst -author = Simon Sapin -author_email = contact@courtbouillon.org -platforms = - Linux - macOS - Windows -keywords = - html - css - pdf - converter -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: BSD License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Topic :: Internet :: WWW/HTTP - Topic :: Text Processing :: Markup :: HTML - Topic :: Multimedia :: Graphics :: Graphics Conversion - Topic :: Printing -project_urls = - Documentation = https://weasyprint.readthedocs.io/ - Code = https://github.com/Kozea/WeasyPrint/ - Issue tracker = https://github.com/Kozea/WeasyPrint/issues - Donation = https://opencollective.com/courtbouillon - -[options] -packages = - weasyprint - weasyprint.css - weasyprint.css.validation - weasyprint.formatting_structure - weasyprint.layout - weasyprint.tests - weasyprint.tests.test_draw - weasyprint.tests.test_layout -zip_safe = false -setup_requires = pytest-runner -install_requires = - setuptools>=39.2.0 - cffi>=0.6 - html5lib>=0.999999999 - cairocffi>=0.9.0 - tinycss2>=1.0.0 - cssselect2>=0.1 - CairoSVG>=2.4.0 - Pyphen>=0.9.1 - fonttools[woff]>=4.0 - Pillow>=4.0.0 -tests_require = - pytest-runner - pytest-cov - pytest-flake8 - pytest-isort -python_requires = >= 3.6 - -[options.entry_points] -console-scripts = weasyprint = weasyprint.__main__:main - -[options.package_data] -weasyprint = VERSION -weasyprint.tests = resources/*.*, resources/*/* -weasyprint.css = *.css - -[options.extras_require] -doc = - sphinx - sphinx_rtd_theme -test = - pytest-runner - pytest-cov - pytest-flake8 - pytest-isort - -[bdist_wheel] -python-tag = py3 - -[build_sphinx] -source-dir = docs -build-dir = docs/_build - -[aliases] -test = pytest - -[tool:pytest] -addopts = --flake8 --isort -norecursedirs = build dist .cache .eggs .git - -[coverage:run] -branch = True -include = weasyprint/* - -[coverage:report] -exclude_lines = - pragma: no cover - def __repr__ - raise NotImplementedError -omit = - .* - -[isort] -default_section = FIRSTPARTY -multi_line_output = 4 diff --git a/setup.py b/setup.py deleted file mode 100755 index df92273b..00000000 --- a/setup.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -""" - WeasyPrint - ========== - - WeasyPrint converts web documents to PDF. - -""" - -from setuptools import setup - -setup() diff --git a/weasyprint/tests/__init__.py b/tests/__init__.py similarity index 100% rename from weasyprint/tests/__init__.py rename to tests/__init__.py diff --git a/weasyprint/tests/conftest.py b/tests/conftest.py similarity index 97% rename from weasyprint/tests/conftest.py rename to tests/conftest.py index 912f32e5..9000a3c3 100644 --- a/weasyprint/tests/conftest.py +++ b/tests/conftest.py @@ -16,9 +16,8 @@ from subprocess import PIPE, run import pytest from PIL import Image - -from .. import HTML -from ..document import Document +from weasyprint import HTML +from weasyprint.document import Document MAGIC_NUMBER = b'\x89\x50\x4e\x47\x0d\x0a\x1a\x0a' diff --git a/weasyprint/tests/resources/AHEM____.TTF b/tests/resources/AHEM____.TTF similarity index 100% rename from weasyprint/tests/resources/AHEM____.TTF rename to tests/resources/AHEM____.TTF diff --git a/weasyprint/tests/resources/acid2-reference.html b/tests/resources/acid2-reference.html similarity index 100% rename from weasyprint/tests/resources/acid2-reference.html rename to tests/resources/acid2-reference.html diff --git a/weasyprint/tests/resources/acid2-test.html b/tests/resources/acid2-test.html similarity index 100% rename from weasyprint/tests/resources/acid2-test.html rename to tests/resources/acid2-test.html diff --git a/weasyprint/tests/resources/blue.jpg b/tests/resources/blue.jpg similarity index 100% rename from weasyprint/tests/resources/blue.jpg rename to tests/resources/blue.jpg diff --git a/weasyprint/tests/resources/doc1.html b/tests/resources/doc1.html similarity index 100% rename from weasyprint/tests/resources/doc1.html rename to tests/resources/doc1.html diff --git a/weasyprint/tests/resources/doc1_UTF-16BE.html b/tests/resources/doc1_UTF-16BE.html similarity index 100% rename from weasyprint/tests/resources/doc1_UTF-16BE.html rename to tests/resources/doc1_UTF-16BE.html diff --git a/weasyprint/tests/resources/icon.png b/tests/resources/icon.png similarity index 100% rename from weasyprint/tests/resources/icon.png rename to tests/resources/icon.png diff --git a/weasyprint/tests/resources/latin1-test.css b/tests/resources/latin1-test.css similarity index 100% rename from weasyprint/tests/resources/latin1-test.css rename to tests/resources/latin1-test.css diff --git a/weasyprint/tests/resources/logo_small.png b/tests/resources/logo_small.png similarity index 100% rename from weasyprint/tests/resources/logo_small.png rename to tests/resources/logo_small.png diff --git a/weasyprint/tests/resources/mini_ua.css b/tests/resources/mini_ua.css similarity index 100% rename from weasyprint/tests/resources/mini_ua.css rename to tests/resources/mini_ua.css diff --git a/weasyprint/tests/resources/pattern.gif b/tests/resources/pattern.gif similarity index 100% rename from weasyprint/tests/resources/pattern.gif rename to tests/resources/pattern.gif diff --git a/weasyprint/tests/resources/pattern.palette.png b/tests/resources/pattern.palette.png similarity index 100% rename from weasyprint/tests/resources/pattern.palette.png rename to tests/resources/pattern.palette.png diff --git a/weasyprint/tests/resources/pattern.png b/tests/resources/pattern.png similarity index 100% rename from weasyprint/tests/resources/pattern.png rename to tests/resources/pattern.png diff --git a/weasyprint/tests/resources/pattern.svg b/tests/resources/pattern.svg similarity index 100% rename from weasyprint/tests/resources/pattern.svg rename to tests/resources/pattern.svg diff --git a/weasyprint/tests/resources/really-a-png.svg b/tests/resources/really-a-png.svg similarity index 100% rename from weasyprint/tests/resources/really-a-png.svg rename to tests/resources/really-a-png.svg diff --git a/weasyprint/tests/resources/really-a-svg.png b/tests/resources/really-a-svg.png similarity index 100% rename from weasyprint/tests/resources/really-a-svg.png rename to tests/resources/really-a-svg.png diff --git a/weasyprint/tests/resources/sheet2.css b/tests/resources/sheet2.css similarity index 100% rename from weasyprint/tests/resources/sheet2.css rename to tests/resources/sheet2.css diff --git a/weasyprint/tests/resources/sub_directory/sheet1.css b/tests/resources/sub_directory/sheet1.css similarity index 100% rename from weasyprint/tests/resources/sub_directory/sheet1.css rename to tests/resources/sub_directory/sheet1.css diff --git a/weasyprint/tests/resources/user.css b/tests/resources/user.css similarity index 100% rename from weasyprint/tests/resources/user.css rename to tests/resources/user.css diff --git a/weasyprint/tests/resources/utf8-test.css b/tests/resources/utf8-test.css similarity index 100% rename from weasyprint/tests/resources/utf8-test.css rename to tests/resources/utf8-test.css diff --git a/weasyprint/tests/resources/weasyprint.otf b/tests/resources/weasyprint.otf similarity index 100% rename from weasyprint/tests/resources/weasyprint.otf rename to tests/resources/weasyprint.otf diff --git a/weasyprint/tests/test_acid2.py b/tests/test_acid2.py similarity index 97% rename from weasyprint/tests/test_acid2.py rename to tests/test_acid2.py index c4fecc8b..8f67a6ca 100644 --- a/weasyprint/tests/test_acid2.py +++ b/tests/test_acid2.py @@ -9,8 +9,8 @@ import io from PIL import Image +from weasyprint import HTML -from .. import HTML from .test_draw import assert_pixels_equal from .testing_utils import assert_no_logs, capture_logs, resource_filename diff --git a/weasyprint/tests/test_api.py b/tests/test_api.py similarity index 99% rename from weasyprint/tests/test_api.py rename to tests/test_api.py index 21a036bb..b7c43560 100644 --- a/weasyprint/tests/test_api.py +++ b/tests/test_api.py @@ -18,10 +18,10 @@ from urllib.parse import urljoin, uses_relative import py import pytest from PIL import Image +from weasyprint import CSS, HTML, __main__, default_url_fetcher +from weasyprint.document import resolve_links +from weasyprint.urls import path2url -from .. import CSS, HTML, __main__, default_url_fetcher -from ..document import resolve_links -from ..urls import path2url from .test_draw import assert_pixels_equal, parse_pixels from .testing_utils import ( FakeHTML, assert_no_logs, capture_logs, http_server, resource_filename) diff --git a/weasyprint/tests/test_boxes.py b/tests/test_boxes.py similarity index 99% rename from weasyprint/tests/test_boxes.py rename to tests/test_boxes.py index f333dba6..75a610a2 100644 --- a/weasyprint/tests/test_boxes.py +++ b/tests/test_boxes.py @@ -9,13 +9,13 @@ import functools import pytest +from weasyprint import images +from weasyprint.css import PageType, get_all_computed_styles +from weasyprint.css.counters import CounterStyle +from weasyprint.css.targets import TargetCollector +from weasyprint.formatting_structure import boxes, build +from weasyprint.layout.pages import set_page_type_computed_styles -from .. import images -from ..css import PageType, get_all_computed_styles -from ..css.counters import CounterStyle -from ..css.targets import TargetCollector -from ..formatting_structure import boxes, build -from ..layout.pages import set_page_type_computed_styles from .testing_utils import BASE_URL, FakeHTML, assert_no_logs, capture_logs PROPER_CHILDREN = dict((key, tuple(map(tuple, value))) for key, value in { diff --git a/weasyprint/tests/test_counters.py b/tests/test_counters.py similarity index 99% rename from weasyprint/tests/test_counters.py rename to tests/test_counters.py index a5035b84..57cd249e 100644 --- a/weasyprint/tests/test_counters.py +++ b/tests/test_counters.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint import HTML -from .. import HTML from .test_boxes import assert_tree, parse_all, render_pages from .testing_utils import assert_no_logs diff --git a/weasyprint/tests/test_css.py b/tests/test_css.py similarity index 98% rename from weasyprint/tests/test_css.py rename to tests/test_css.py index 6eecd2a8..43067c66 100644 --- a/weasyprint/tests/test_css.py +++ b/tests/test_css.py @@ -9,12 +9,13 @@ from math import isclose import pytest import tinycss2 +from weasyprint import CSS, css, default_url_fetcher +from weasyprint.css import ( + PageType, get_all_computed_styles, parse_page_selectors) +from weasyprint.css.computed_values import strut_layout +from weasyprint.layout.pages import set_page_type_computed_styles +from weasyprint.urls import path2url -from .. import CSS, css, default_url_fetcher -from ..css import PageType, get_all_computed_styles, parse_page_selectors -from ..css.computed_values import strut_layout -from ..layout.pages import set_page_type_computed_styles -from ..urls import path2url from .testing_utils import ( BASE_URL, FakeHTML, assert_no_logs, capture_logs, resource_filename) diff --git a/weasyprint/tests/test_css_descriptors.py b/tests/test_css_descriptors.py similarity index 98% rename from weasyprint/tests/test_css_descriptors.py rename to tests/test_css_descriptors.py index bcb89176..482b0d5c 100644 --- a/weasyprint/tests/test_css_descriptors.py +++ b/tests/test_css_descriptors.py @@ -8,9 +8,9 @@ import pytest import tinycss2 +from weasyprint.css import preprocess_stylesheet +from weasyprint.css.validation.descriptors import preprocess_descriptors -from ..css import preprocess_stylesheet -from ..css.validation.descriptors import preprocess_descriptors from .testing_utils import assert_no_logs, capture_logs diff --git a/weasyprint/tests/test_css_validation.py b/tests/test_css_validation.py similarity index 99% rename from weasyprint/tests/test_css_validation.py rename to tests/test_css_validation.py index b569b659..d96bacaf 100644 --- a/weasyprint/tests/test_css_validation.py +++ b/tests/test_css_validation.py @@ -10,11 +10,11 @@ import math import pytest import tinycss2 +from weasyprint.css import preprocess_declarations +from weasyprint.css.computed_values import ZERO_PIXELS +from weasyprint.css.properties import INITIAL_VALUES +from weasyprint.images import LinearGradient, RadialGradient -from ..css import preprocess_declarations -from ..css.computed_values import ZERO_PIXELS -from ..css.properties import INITIAL_VALUES -from ..images import LinearGradient, RadialGradient from .testing_utils import assert_no_logs, capture_logs diff --git a/weasyprint/tests/test_draw/__init__.py b/tests/test_draw/__init__.py similarity index 100% rename from weasyprint/tests/test_draw/__init__.py rename to tests/test_draw/__init__.py diff --git a/weasyprint/tests/test_draw/test_background.py b/tests/test_draw/test_background.py similarity index 100% rename from weasyprint/tests/test_draw/test_background.py rename to tests/test_draw/test_background.py diff --git a/weasyprint/tests/test_draw/test_before_after.py b/tests/test_draw/test_before_after.py similarity index 100% rename from weasyprint/tests/test_draw/test_before_after.py rename to tests/test_draw/test_before_after.py diff --git a/weasyprint/tests/test_draw/test_box.py b/tests/test_draw/test_box.py similarity index 99% rename from weasyprint/tests/test_draw/test_box.py rename to tests/test_draw/test_box.py index a7984bc4..faf60b7d 100644 --- a/weasyprint/tests/test_draw/test_box.py +++ b/tests/test_draw/test_box.py @@ -8,7 +8,8 @@ import itertools -from ... import HTML +from weasyprint import HTML + from ..testing_utils import assert_no_logs from . import PIXELS_BY_CHAR, assert_different_renderings, assert_pixels diff --git a/weasyprint/tests/test_draw/test_column.py b/tests/test_draw/test_column.py similarity index 100% rename from weasyprint/tests/test_draw/test_column.py rename to tests/test_draw/test_column.py diff --git a/weasyprint/tests/test_draw/test_current_color.py b/tests/test_draw/test_current_color.py similarity index 100% rename from weasyprint/tests/test_draw/test_current_color.py rename to tests/test_draw/test_current_color.py diff --git a/weasyprint/tests/test_draw/test_float.py b/tests/test_draw/test_float.py similarity index 100% rename from weasyprint/tests/test_draw/test_float.py rename to tests/test_draw/test_float.py diff --git a/weasyprint/tests/test_draw/test_gradient.py b/tests/test_draw/test_gradient.py similarity index 100% rename from weasyprint/tests/test_draw/test_gradient.py rename to tests/test_draw/test_gradient.py diff --git a/weasyprint/tests/test_draw/test_image.py b/tests/test_draw/test_image.py similarity index 100% rename from weasyprint/tests/test_draw/test_image.py rename to tests/test_draw/test_image.py diff --git a/weasyprint/tests/test_draw/test_list.py b/tests/test_draw/test_list.py similarity index 100% rename from weasyprint/tests/test_draw/test_list.py rename to tests/test_draw/test_list.py diff --git a/weasyprint/tests/test_draw/test_opacity.py b/tests/test_draw/test_opacity.py similarity index 100% rename from weasyprint/tests/test_draw/test_opacity.py rename to tests/test_draw/test_opacity.py diff --git a/weasyprint/tests/test_draw/test_overflow.py b/tests/test_draw/test_overflow.py similarity index 100% rename from weasyprint/tests/test_draw/test_overflow.py rename to tests/test_draw/test_overflow.py diff --git a/weasyprint/tests/test_draw/test_table.py b/tests/test_draw/test_table.py similarity index 99% rename from weasyprint/tests/test_draw/test_table.py rename to tests/test_draw/test_table.py index a6499c3f..8ad07fab 100644 --- a/weasyprint/tests/test_draw/test_table.py +++ b/tests/test_draw/test_table.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.html import HTML_HANDLERS -from ...html import HTML_HANDLERS from ..testing_utils import assert_no_logs from . import assert_pixels, parse_pixels diff --git a/weasyprint/tests/test_draw/test_text.py b/tests/test_draw/test_text.py similarity index 100% rename from weasyprint/tests/test_draw/test_text.py rename to tests/test_draw/test_text.py diff --git a/weasyprint/tests/test_draw/test_transform.py b/tests/test_draw/test_transform.py similarity index 100% rename from weasyprint/tests/test_draw/test_transform.py rename to tests/test_draw/test_transform.py diff --git a/weasyprint/tests/test_draw/test_visibility.py b/tests/test_draw/test_visibility.py similarity index 100% rename from weasyprint/tests/test_draw/test_visibility.py rename to tests/test_draw/test_visibility.py diff --git a/weasyprint/tests/test_float.py b/tests/test_float.py similarity index 99% rename from weasyprint/tests/test_float.py rename to tests/test_float.py index d54a2d96..6fe53bc4 100644 --- a/weasyprint/tests/test_float.py +++ b/tests/test_float.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.formatting_structure import boxes -from ..formatting_structure import boxes from .test_boxes import render_pages from .testing_utils import assert_no_logs diff --git a/weasyprint/tests/test_fonts.py b/tests/test_fonts.py similarity index 100% rename from weasyprint/tests/test_fonts.py rename to tests/test_fonts.py diff --git a/weasyprint/tests/test_layout/__init__.py b/tests/test_layout/__init__.py similarity index 100% rename from weasyprint/tests/test_layout/__init__.py rename to tests/test_layout/__init__.py diff --git a/weasyprint/tests/test_layout/test_block.py b/tests/test_layout/test_block.py similarity index 99% rename from weasyprint/tests/test_layout/test_block.py rename to tests/test_layout/test_block.py index db72aead..253f14cb 100644 --- a/weasyprint/tests/test_layout/test_block.py +++ b/tests/test_layout/test_block.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.formatting_structure import boxes -from ...formatting_structure import boxes from ..test_boxes import render_pages as parse from ..testing_utils import assert_no_logs diff --git a/weasyprint/tests/test_layout/test_column.py b/tests/test_layout/test_column.py similarity index 100% rename from weasyprint/tests/test_layout/test_column.py rename to tests/test_layout/test_column.py diff --git a/weasyprint/tests/test_layout/test_flex.py b/tests/test_layout/test_flex.py similarity index 100% rename from weasyprint/tests/test_layout/test_flex.py rename to tests/test_layout/test_flex.py diff --git a/weasyprint/tests/test_layout/test_image.py b/tests/test_layout/test_image.py similarity index 99% rename from weasyprint/tests/test_layout/test_image.py rename to tests/test_layout/test_image.py index 73036abe..f98fb4eb 100644 --- a/weasyprint/tests/test_layout/test_image.py +++ b/tests/test_layout/test_image.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.formatting_structure import boxes -from ...formatting_structure import boxes from ..test_boxes import render_pages as parse from ..testing_utils import assert_no_logs, capture_logs diff --git a/weasyprint/tests/test_layout/test_inline.py b/tests/test_layout/test_inline.py similarity index 99% rename from weasyprint/tests/test_layout/test_inline.py rename to tests/test_layout/test_inline.py index f63456c1..cf8c6073 100644 --- a/weasyprint/tests/test_layout/test_inline.py +++ b/tests/test_layout/test_inline.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.formatting_structure import boxes -from ...formatting_structure import boxes from ..test_boxes import render_pages as parse from ..testing_utils import SANS_FONTS, assert_no_logs diff --git a/weasyprint/tests/test_layout/test_inline_block.py b/tests/test_layout/test_inline_block.py similarity index 100% rename from weasyprint/tests/test_layout/test_inline_block.py rename to tests/test_layout/test_inline_block.py diff --git a/weasyprint/tests/test_layout/test_list.py b/tests/test_layout/test_list.py similarity index 100% rename from weasyprint/tests/test_layout/test_list.py rename to tests/test_layout/test_list.py diff --git a/weasyprint/tests/test_layout/test_page.py b/tests/test_layout/test_page.py similarity index 99% rename from weasyprint/tests/test_layout/test_page.py rename to tests/test_layout/test_page.py index 7b6882f6..90f3d8e0 100644 --- a/weasyprint/tests/test_layout/test_page.py +++ b/tests/test_layout/test_page.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.formatting_structure import boxes -from ...formatting_structure import boxes from ..test_boxes import render_pages from ..testing_utils import assert_no_logs diff --git a/weasyprint/tests/test_layout/test_position.py b/tests/test_layout/test_position.py similarity index 100% rename from weasyprint/tests/test_layout/test_position.py rename to tests/test_layout/test_position.py diff --git a/weasyprint/tests/test_layout/test_shrink_to_fit.py b/tests/test_layout/test_shrink_to_fit.py similarity index 100% rename from weasyprint/tests/test_layout/test_shrink_to_fit.py rename to tests/test_layout/test_shrink_to_fit.py diff --git a/weasyprint/tests/test_layout/test_table.py b/tests/test_layout/test_table.py similarity index 100% rename from weasyprint/tests/test_layout/test_table.py rename to tests/test_layout/test_table.py diff --git a/weasyprint/tests/test_pdf.py b/tests/test_pdf.py similarity index 99% rename from weasyprint/tests/test_pdf.py rename to tests/test_pdf.py index 2ad790d0..9436f54e 100644 --- a/weasyprint/tests/test_pdf.py +++ b/tests/test_pdf.py @@ -13,9 +13,9 @@ import re from codecs import BOM_UTF16_BE import pytest +from weasyprint import Attachment +from weasyprint.urls import path2url -from .. import Attachment -from ..urls import path2url from .testing_utils import ( FakeHTML, assert_no_logs, capture_logs, resource_filename) diff --git a/weasyprint/tests/test_presentational_hints.py b/tests/test_presentational_hints.py similarity index 99% rename from weasyprint/tests/test_presentational_hints.py rename to tests/test_presentational_hints.py index c7504124..1a31eb4c 100644 --- a/weasyprint/tests/test_presentational_hints.py +++ b/tests/test_presentational_hints.py @@ -6,7 +6,8 @@ """ -from .. import CSS, HTML +from weasyprint import CSS, HTML + from .testing_utils import BASE_URL, assert_no_logs PH_TESTING_CSS = CSS(string=''' diff --git a/weasyprint/tests/test_stacking.py b/tests/test_stacking.py similarity index 98% rename from weasyprint/tests/test_stacking.py rename to tests/test_stacking.py index 5eeef7c1..fc348753 100644 --- a/weasyprint/tests/test_stacking.py +++ b/tests/test_stacking.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.stacking import StackingContext -from ..stacking import StackingContext from .test_boxes import render_pages, serialize from .test_draw import assert_pixels from .testing_utils import assert_no_logs diff --git a/weasyprint/tests/test_target.py b/tests/test_target.py similarity index 100% rename from weasyprint/tests/test_target.py rename to tests/test_target.py diff --git a/weasyprint/tests/test_text.py b/tests/test_text.py similarity index 99% rename from weasyprint/tests/test_text.py rename to tests/test_text.py index e21de4a8..e0e7b408 100644 --- a/weasyprint/tests/test_text.py +++ b/tests/test_text.py @@ -7,9 +7,9 @@ """ import pytest +from weasyprint.css.properties import INITIAL_VALUES +from weasyprint.text import split_first_line -from ..css.properties import INITIAL_VALUES -from ..text import split_first_line from .test_boxes import render_pages from .testing_utils import MONO_FONTS, SANS_FONTS, assert_no_logs diff --git a/weasyprint/tests/test_unicode.py b/tests/test_unicode.py similarity index 97% rename from weasyprint/tests/test_unicode.py rename to tests/test_unicode.py index 9e0a82d0..d4ad9d5c 100644 --- a/weasyprint/tests/test_unicode.py +++ b/tests/test_unicode.py @@ -10,7 +10,8 @@ import os.path import shutil import tempfile -from ..urls import ensure_url +from weasyprint.urls import ensure_url + from .test_draw import assert_pixels_equal, document_to_pixels, html_to_pixels from .testing_utils import FakeHTML, assert_no_logs, resource_filename diff --git a/weasyprint/tests/test_variables.py b/tests/test_variables.py similarity index 97% rename from weasyprint/tests/test_variables.py rename to tests/test_variables.py index c36cb849..8b5f62cc 100644 --- a/weasyprint/tests/test_variables.py +++ b/tests/test_variables.py @@ -7,8 +7,8 @@ """ import pytest +from weasyprint.css.properties import KNOWN_PROPERTIES -from ..css.properties import KNOWN_PROPERTIES from .test_boxes import render_pages as parse SIDES = ('top', 'right', 'bottom', 'left') diff --git a/weasyprint/tests/testing_utils.py b/tests/testing_utils.py similarity index 95% rename from weasyprint/tests/testing_utils.py rename to tests/testing_utils.py index 63a51a67..5730a207 100644 --- a/weasyprint/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -14,9 +14,9 @@ import sys import threading import wsgiref.simple_server -from .. import CSS, HTML -from ..logger import LOGGER -from ..urls import path2url +from weasyprint import CSS, HTML +from weasyprint.logger import LOGGER +from weasyprint.urls import path2url # Lists of fonts with many variants (including condensed) if sys.platform.startswith('win'): # pragma: no cover @@ -27,7 +27,7 @@ else: # pragma: no cover MONO_FONTS = 'DejaVu Sans Mono, monospace' TEST_UA_STYLESHEET = CSS(filename=os.path.join( - os.path.dirname(__file__), '..', 'css', 'tests_ua.css' + os.path.dirname(__file__), '..', 'weasyprint', 'css', 'tests_ua.css' ))