summaryrefslogtreecommitdiff
path: root/pyproject.toml
blob: e8a8e6965960ececfa01a3bdd4092ee38f91218c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
[project]
requires-python = ">=3.6"

[build-system]
requires = [
  "setuptools >= 50",
  "wheel >= 0.35",
  "setuptools_scm[toml] >= 4.1",
  "setuptools_scm_git_archive",
  "pybind11 >= 2.7.1, <= 2.8.0"
]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 88
target-version = ["py36", "py37", "py38"]
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
/(
    \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | _build
  | buck-out
  | build
  | dist
  | docs
  | misc
  | \.egg-info
)/
'''

[tool.cibuildwheel]
test-command = "pytest -nauto {project}/tests"
test-extras = "test"
skip = "cp310-*"
test-skip = "*_arm64 *_universal2:arm64"

[tool.cibuildwheel.environment]
QPDF_MIN_VERSION = "10.3.1"
QPDF_VERSION = "10.3.2"
QPDF_PATTERN = "https://github.com/qpdf/qpdf/releases/download/release-qpdf-VERSION/qpdf-VERSION.tar.gz"
JPEG_RELEASE = "https://www.ijg.org/files/jpegsrc.v9d.tar.gz"
ZLIB_RELEASE = "https://www.zlib.net/zlib-1.2.11.tar.gz"

[tool.cibuildwheel.linux]
before-all = [
  "yum install -y wget libxml2-devel libxslt-devel libxmp",
  "bash build-scripts/linux-download-qpdf-deps.bash",
  "bash build-scripts/linux-download-qpdf.bash $QPDF_VERSION",
  "bash build-scripts/linux-build-wheel-deps.bash"
]
manylinux-x86_64-image = "manylinux2010"
manylinux-i686-image = "manylinux2010"

[tool.cibuildwheel.macos]
before-all = "brew install qpdf"

[tool.cibuildwheel.windows]
# pp3*-win32 fails because there is no wheel for lxml
# pp3*-win_amd64 does not execute because cibuildwheel does not implement it
# or PyPy3 doesn't work on Windows 64-bit, one or the other
# PyPy+Win32 seems like a very low priority combination
skip = "pp3* cp310-*"

[tool.mypy]

[[tool.mypy.overrides]]
module = [
  'PIL',
  'PIL.TiffTags',
  'lxml',
  'lxml.etree'
]
ignore_missing_imports = true

[tool.pytest.ini_options]
minversion = "6.0"
norecursedirs = ["lib", ".pc", ".git", "venv"]
testpaths = ["tests"]
addopts = "-n auto"

[tool.coverage.run]
concurrency = ["multiprocessing"]

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

    # 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__.:",
]

[tool.coverage.html]
directory = "coverage/pycov"

[tool.isort]
profile = "black"
known_first_party = ["pikepdf"]
known_third_party = ["PIL","conftest","hypothesis","lxml","pkg_resources","psutil","pytest","setuptools"]