Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
black = black -S -l 120 --target-version py38
isort = isort -w 120

.PHONY: install
install:
pip install -U setuptools pip
Expand All @@ -9,15 +6,14 @@ install:

.PHONY: format
format:
$(isort) pydf tests
$(black) pydf tests
ruff check --fix pydf tests
ruff format pydf tests

.PHONY: lint
lint:
python setup.py check -rms
flake8 pydf tests
$(isort) --check-only pydf tests
$(black) --check pydf tests
ruff check pydf tests
ruff format --check pydf tests

.PHONY: test
test:
Expand Down
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Install

pip install python-pdf

For python 2 use ``pip install python-pdf==0.30.0``.

Basic Usage
-----------

Expand Down
3 changes: 1 addition & 2 deletions pydf/wkhtmltopdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ async def generate_pdf(self, html, **cmd_args):
if p.returncode != 0 and pdf_content[:4] != b'%PDF':
stderr = await p.stderr.read()
raise RuntimeError(
'error running wkhtmltopdf, command: {!r}\n'
'response: "{}"'.format(cmd_args, stderr.decode().strip())
'error running wkhtmltopdf, command: {!r}\nresponse: "{}"'.format(cmd_args, stderr.decode().strip())
)
return pdf_content

Expand Down
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[tool.ruff]
line-length = 120

[tool.ruff.format]
quote-style = 'single'

[tool.ruff.lint]
extend-select = ['I']
ignore = ['E402']

[tool.ruff.lint.mccabe]
max-complexity = 12

[tool.ruff.lint.isort]
combine-as-imports = true

[tool.pytest]
testpaths = 'tests'
timeout = 10

[tool.coverage.run]
source = ['pdf']
branch = true

[tool.coverage.report]
precision = 2
exclude_lines = [
'pragma: no cover',
'raise NotImplementedError',
]

[tool.distutils.bdist_wheel]
python-tag = 'py311'
22 changes: 0 additions & 22 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run(self):
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.11',
'Topic :: Internet :: WWW/HTTP',
],
zip_safe=False
Expand Down
23 changes: 9 additions & 14 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
black==21.5b2
coverage==6.1.1
docutils==0.18
flake8==4.0.1
isort==5.10.1
pdfminer.six==20211012
pycodestyle==2.8.0
pyflakes==2.4.0
Pygments==2.10.0
pytest==6.2.5
pytest-cov==3.0.0
pytest-isort==2.0.0
pytest-sugar==0.9.4
pytest-timeout==1.4.2
coverage==7.4.4
docutils==0.20.1
pdfminer.six==20231228
Pygments==2.17.2
pytest==8.1.1
pytest-cov==5.0.0
pytest-sugar==1.0.0
pytest-timeout==2.3.1
ruff==0.3.4
2 changes: 1 addition & 1 deletion tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_pdf_title():


def test_unicode():
pdf_content = generate_pdf(u'<html><body>Schrödinger</body></html>')
pdf_content = generate_pdf('<html><body>Schrödinger</body></html>')
assert pdf_content[:4] == b'%PDF'


Expand Down