Skip to content

Commit

Permalink
Merge branch 'incuna:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
astorozhevsky authored Aug 14, 2024
2 parents 86aee9a + 1163613 commit e4176b5
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 99 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python:
- 3.7
- 3.8
- 3.9
django-version:
- "2.2,<3.0"
- "3.2,<4.0"
- "4.0,<4.1"

steps:
- name: Installing wkhtmltopdf dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libxrender1 libfontconfig1 zlib1g libfreetype6 libx11-6 libxext6
- name: Installing wkhtmltopdf
run: |
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mkdir -p ~/bin
cp ./wkhtmltox/bin/wkhtmltopdf ~/bin
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Install Dependencies on ${{ matrix.python-version }}
run: |
python -m pip install --upgrade pip
pip install "Django>=${{ matrix.django-version }}"
pip install -r test_requirements.txt
pip install .
- name: Run Tests
run: |
WKHTMLTOPDF_CMD=~/bin/wkhtmltopdf make test
95 changes: 0 additions & 95 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog for django-wkhtmltopdf
================================

3.4.0
-------
* Fix for Django 4.0
* Remove travis CI
* Add GitHub actions CI with for Python 3.7, 3.8 3.9 and Django 2.2, 3.2 and 4.0

3.3.0
--------

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ help:
@echo " make test | Run the tests."

release:
python setup.py register sdist bdist_wheel upload
python setup.py sdist bdist_wheel
twine upload dist/*

test:
python ./wkhtmltopdf/tests/run.py
2 changes: 1 addition & 1 deletion wkhtmltopdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .utils import *

__author__ = 'Incuna Ltd'
__version__ = '3.3.0'
__version__ = '3.4.0'
4 changes: 2 additions & 2 deletions wkhtmltopdf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import shlex
from tempfile import NamedTemporaryFile

from django.utils.encoding import smart_text
from django.utils.encoding import smart_str

try:
from urllib.request import pathname2url
Expand Down Expand Up @@ -347,7 +347,7 @@ def render_to_temporary_file(template, context, request=None, mode='w+b',
content = render(context)
else:
content = render(context, request)
content = smart_text(content)
content = smart_str(content)
content = make_absolute_paths(content)

try:
Expand Down

0 comments on commit e4176b5

Please sign in to comment.