Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move project configuration to pyproject.toml #1382

Merged
merged 7 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
23 changes: 0 additions & 23 deletions .coveragerc

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/github-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ jobs:
with:
python-version: ${{env.PYTHON_LATEST}}

- run: python -m pip install build twine check-wheel-contents
- run: python -m build --sdist --wheel .
- run: python -m pip install flit check-wheel-contents
- run: flit build
- run: ls -l dist
- run: check-wheel-contents dist/*.whl
- name: Check long_description
run: python -m twine check dist/*

- name: Test installing package
run: python -m pip install .
Expand Down
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ changelog:

upload:
make clean
python setup.py sdist bdist_wheel && twine upload -s dist/*
flit publish

clean:
python setup.py clean --all
Expand Down
96 changes: 96 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "PyPDF2"
authors = [{ name = "Mathieu Fenniak", email = "[email protected]" }]
maintainers = [{ name = "Martin Thoma", email = "[email protected]" }]
description = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files"
readme = "README.md"
dynamic = ["version"]
license = BSD-3-Clause
singingwolfboy marked this conversation as resolved.
Show resolved Hide resolved
requires-python = ">=3.6"
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",
"Programming Language :: Python :: 3.10",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"typing_extensions >= 3.10.0.0; python_version < '3.10'",
"dataclasses; python_version < '3.7'",
]

[project.urls]
Documentation = "https://pypdf2.readthedocs.io/en/latest/"
Source = "https://github.com/py-pdf/PyPDF2"
"Bug Reports" = "https://github.com/py-pdf/PyPDF2/issues"
Changelog = "https://pypdf2.readthedocs.io/en/latest/meta/CHANGELOG.html"

[project.optional-dependencies]
full = ["PyCryptodome", "Pillow"]
crypto = ["PyCryptodome"]
image = ["Pillow"]
dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "flit", "wheel"]
docs = ["sphinx", "sphinx_rtd_theme", "myst_parser"]

[tool.mutmut]
backup = false
runner = "./mutmut-test.sh"
tests_dir = "tests/"

[tool.check-wheel-contents]
package = "./PyPDF2"

singingwolfboy marked this conversation as resolved.
Show resolved Hide resolved
[tool.flit.sdist]
exclude = [".github/*", "docs/*", "resources/*", "sample-files/*", "sample-files/.github/*", "sample-files/.gitignore", "sample-files/.pre-commit-config.yaml", "requirements/*", "tests/*", ".flake8", ".gitignore", ".gitmodules", ".pylintrc", "tox.ini", "make_changelog.py", "mutmut-test.sh", ".pre-commit-config.yaml", ".gitblame-ignore-revs", "Makefile", "mutmut_config.py"]

[tool.pytest.ini_options]
filterwarnings = ["error"]
markers = [
"external: Tests which use files from https://github.com/py-pdf/sample-files",
]
testpaths = ["tests"]
norecursedirs = ["tests/pdf_cache"]

[tool.isort]
line_length = 79
indent = ' '
multi_line_output = 3
length_sort = 0
include_trailing_comma = true
known_third_party = ["pytest", "setuptools"]

[tool.coverage.run]
source = ["PyPDF2"]
branch = true

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
"@overload",

# Don't complain about missing debug-only code:
"def __repr__",
"def __str__",
"if self\\.debug",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
]
9 changes: 0 additions & 9 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ black
pip-tools
pre-commit<2.18.0
pytest-cov
twine
flit
wheel
89 changes: 13 additions & 76 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile requirements/dev.in
Expand All @@ -8,12 +8,8 @@ attrs==21.4.0
# via pytest
black==22.6.0
# via -r requirements/dev.in
bleach==4.1.0
# via readme-renderer
certifi==2022.6.15
# via requests
cffi==1.15.1
# via cryptography
cfgv==3.3.1
# via pre-commit
charset-normalizer==2.0.12
Expand All @@ -22,63 +18,36 @@ click==8.0.4
# via
# black
# pip-tools
colorama==0.4.5
# via twine
coverage[toml]==6.2
# via pytest-cov
cryptography==37.0.4
# via secretstorage
dataclasses==0.8
# via black
distlib==0.3.5
# via virtualenv
docutils==0.18.1
# via readme-renderer
# via flit
filelock==3.4.1
# via virtualenv
flit==3.7.1
# via -r requirements/dev.in
flit-core==3.7.1
# via flit
identify==2.4.4
# via pre-commit
idna==3.3
# via requests
importlib-metadata==4.8.3
# via
# click
# keyring
# pep517
# pluggy
# pre-commit
# pytest
# twine
# virtualenv
importlib-resources==5.2.3
# via
# pre-commit
# tqdm
# virtualenv
iniconfig==1.1.1
# via pytest
jeepney==0.7.1
# via
# keyring
# secretstorage
keyring==23.4.1
# via twine
mypy-extensions==0.4.3
# via black
nodeenv==1.6.0
# via pre-commit
packaging==21.3
# via
# bleach
# pytest
# via pytest
pathspec==0.9.0
# via black
pep517==0.12.0
# via pip-tools
pip-tools==6.4.0
# via -r requirements/dev.in
pkginfo==1.8.3
# via twine
platformdirs==2.4.0
# via
# black
Expand All @@ -89,10 +58,6 @@ pre-commit==2.17.0
# via -r requirements/dev.in
py==1.11.0
# via pytest
pycparser==2.21
# via cffi
pygments==2.12.0
# via readme-renderer
pyparsing==3.0.9
# via packaging
pytest==7.0.1
Expand All @@ -101,57 +66,29 @@ pytest-cov==3.0.0
# via -r requirements/dev.in
pyyaml==6.0
# via pre-commit
readme-renderer==34.0
# via twine
requests==2.27.1
# via
# requests-toolbelt
# twine
requests-toolbelt==0.9.1
# via twine
rfc3986==1.5.0
# via twine
secretstorage==3.3.2
# via keyring
# via flit
six==1.16.0
# via
# bleach
# virtualenv
# via virtualenv
toml==0.10.2
# via pre-commit
tomli==1.2.3
# via
# black
# coverage
# flit
# pep517
# pytest
tqdm==4.64.0
# via twine
twine==3.8.0
# via -r requirements/dev.in
typed-ast==1.5.4
# via black
typing-extensions==4.1.1
# via
# black
# importlib-metadata
tomli-w==1.0.0
# via flit
urllib3==1.26.10
# via
# requests
# twine
# via requests
virtualenv==20.15.1
# via pre-commit
webencodings==0.5.1
# via bleach
wheel==0.37.1
# via
# -r requirements/dev.in
# pip-tools
zipp==3.6.0
# via
# importlib-metadata
# importlib-resources
# pep517

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
17 changes: 0 additions & 17 deletions setup.py

This file was deleted.