Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
veghp committed Apr 16, 2024
1 parent 46e2adf commit d83d1f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
10 changes: 4 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
</p>


PDF_Reports
===========

.. image:: https://github.com/Edinburgh-Genome-Foundry/pdf_reports/actions/workflows/build.yml/badge.svg
:target: https://github.com/Edinburgh-Genome-Foundry/pdf_reports/actions/workflows/build.yml
:alt: GitHub CI build status

.. image:: https://coveralls.io/repos/github/Edinburgh-Genome-Foundry/pdf_reports/badge.svg?branch=master
:target: https://coveralls.io/github/Edinburgh-Genome-Foundry/pdf_reports?branch=master

Expand Down Expand Up @@ -177,9 +173,11 @@ Alternatively, you can unzip the sources in a folder and type:
**Note:** the package depends on the WeasyPrint Python package. If there are any issues,
see installation instructions in the `WeasyPrint documentation <https://doc.courtbouillon.org/weasyprint/stable/first_steps.html>`_.

If you have an older GNU/Linux distribution (e.g. Ubuntu 18.04), then install an older WeasyPrint (<=52),
as they don't have the latest Pango that is required by the latest WeasyPrint: ``pip install weasyprint==52``
If Pango is not available in your conda environment (``which pango-view``), but otherwise it's installed, then install it with ``conda install anaconda::pango``


PDF Reports has been tested on Ubuntu 22.04. If you have an older GNU/Linux distribution (e.g. Ubuntu 18.04) which
doesn't have the latest Pango that is required by the latest WeasyPrint, then installing an older WeasyPrint (<=52) may help: ``pip install weasyprint==52``

**Note: on some Debian systems** you may need to first install ``libffi-dev`` (``apt install libffi-dev``). The package name may be ``libffi-devel`` on some systems.

Expand Down
3 changes: 1 addition & 2 deletions pdf_reports/pdf_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
if "pango" in str(err):
message += (
"\nMaybe you haven't installed the Pango dependency? "
"('brew install pango' on Mac, 'apt install libpango' "
"on Ubuntu).\n"
"See PDF Reports install instructions in documentation.\n"
)
if "cairo" in str(err):
message += "\nMaybe you haven't installed the Cairo dependency?\n"
Expand Down
14 changes: 10 additions & 4 deletions tests/data/example_template.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
img(style="width:400px; display:block; margin:0 auto;"
src="file:///{{ egf_logo_url }}")

#sidebar: p {{ sidebar_text }}
#egf-logo

h1 {{ title }}

Expand Down Expand Up @@ -51,7 +53,7 @@ h3 Another paragraph

p Bla bla bla bla bla bla bla bla bla bla

h2 Another table just to get 2 pages
h2 Another table just to get 2 pages

table.ui.celled.table
thead
Expand All @@ -68,15 +70,19 @@ table.ui.celled.table
td Jimmy
td
i.exclamation.circle.icon
| Approved
| Approved
td None
tr
td Jamie
td Unknown
td.positive
i.exclamation.circle.icon
| Requires call
| Requires call
tr.negative
td Jill
td Unknown
td None
tr.negative
td John
td Unknown
td None

0 comments on commit d83d1f9

Please sign in to comment.