-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
185 lines (162 loc) · 4.88 KB
/
pyproject.toml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
[project]
name = "edspdf-poppler"
description = "Poppler extension for EDS-PDF"
authors = [
{ name = "Perceval Wajsbürt", email = "perceval.wajsburt-ext@aphp.fr" },
]
license = { file = "LICENSE" }
readme = "README.md"
urls.homepage = "https://github.com/aphp/edspdf-poppler/"
urls.repository = "https://github.com/aphp/edspdf-poppler/"
urls.documentation = "https://aphp.github.io/edspdf-poppler/"
dynamic = ["version"]
requires-python = ">=3.7,<4.0"
dependencies = [
"edspdf>=0.7.0",
"six>=1.16.0",
"attrs>=23.1.0"
]
[project.optional-dependencies]
dev = [
"pre-commit~=2.18.1",
"pytest~=7.1.1",
"pytest-cov~=3.0.0",
]
[project.entry-points."edspdf_factories"]
# Extractors
"poppler-extractor" = "edspdf_poppler:PopplerExtractor"
[tool.setuptools.dynamic]
version = { attr = "edspdf_poppler.__version__" }
[tool.setuptools.packages.find]
where = ["."]
include = ["edspdf_poppler*"]
namespaces = false
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = false
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = false
ignore-module = true
ignore-nested-functions = false
ignore-nested-classes = true
ignore-setters = false
fail-under = 10
exclude = ["docs", "build", "tests"]
verbose = 0
quiet = false
whitelist-regex = []
color = true
omit-covered-files = false
[tool.coverage]
exclude_lines = [
"raise NotImplementedError",
"def __repr__",
]
[tool.pytest.ini_options]
testpaths = [
"tests",
]
[tool.mypy]
plugins = "pydantic.mypy"
[tool.ruff]
fix = true
exclude = [
".git",
"__pycache__",
"__init__.py",
".mypy_cache",
".pytest_cache",
".venv",
"build",
]
ignore = []
line-length = 88
select = [
"E",
"F",
"W",
"I001"
]
fixable = ["E", "F", "W", "I"]
[tool.ruff.isort]
known-first-party = ["edspdf"]
[tool.coverage.run]
omit = ["*edspdf_poppler/poppler_src*"]
[build-system]
requires = [
"setuptools>=42",
"wheel",
"cython",
]
build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
test-requires = "pytest"
test-command = "pytest {project}"
skip = [
"*p36-*", # Skip Python 3.6
"pp*", # Skip PyPy
"*-win32", # Skip 32-bit Windows
"*-manylinux_i686", # Skip 32-bit Linux
"*-win_arm64", # Skip experimental Windows on ARM
"*-musllinux*", # Skip slow Linux
"*-manylinux_aarch64", # Skip slow Linux
"*-manylinux_ppc64le", # Skip slow Linux
"*-manylinux_s390x", # Skip slow Linux
]
[tool.cibuildwheel.linux]
before-all = """
if command -v apt-get &> /dev/null; then
apt-get update
apt-get install -y libfreetype6-dev fontconfig
elif command -v yum &> /dev/null; then
yum install -y freetype-devel fontconfig-devel
else
echo "No package manager found"
exit 1
fi
"""
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
# We also need to set MACOSX_DEPLOYMENT_TARGET 11.0 if arch is arm64 and to 10.13
# (and no lower) otherwise to able to build against c++ runtime library
[[tool.cibuildwheel.overrides]]
select = "*-macosx_x86_64"
environment = { "MACOSX_DEPLOYMENT_TARGET" = "10.13", "PATH" = "/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" }
# We install gnu-sed to overcome the linux specific usage of sed in poppler's
# CMakeLists.txt, and because we cannot upgrade poppler to enable manylinux_2014 builds
# since the poppler team put a min version on some libs in latest poppler versions.
before-all = """
brew install gnu-sed
if ! file -b $(brew --prefix freetype)/lib/libfreetype.dylib | grep -q x86_64 ; then
brew reinstall freetype fontconfig
fi
exit 0
"""
[[tool.cibuildwheel.overrides]]
select = "*-macosx_arm64"
environment = { "MACOSX_DEPLOYMENT_TARGET" = "11.0", "PATH" = "/usr/local/opt/gnu-sed/libexec/gnubin:$PATH", "CMAKE_OSX_ARCHITECTURES"="arm64" }
# See: https://github.com/orgs/Homebrew/discussions/2843 to get a grip at what is
# happening here.
# Additionally, homebrew seems to install sub-formulas without taking the platform
# of their parent formula into account : we must list all formulas exhaustively
# (by trial and error). Otherwise, linked dependencies will have an incorrect arch
# (most likely x84_64).
# We use reinstall to force installation of manually fetched bottles, and use a
# condition (match the arch of the libfreetype.dylib file, if it exists, with arm64) to
# detect if we must install, to avoid reinstalling everytime. Any installed package
# with the right version, even if the arch differs, is good enough for homebrew and
# our arm64 deps might no get installed if we did'nt check + reinstall.
before-all = """
brew install gnu-sed
if ! file -b $(brew --prefix freetype)/lib/libfreetype.dylib | grep -q arm64 ; then
FORMULAS=(libpng libtiff little-cms2 freetype fontconfig jpeg-turbo zstd)
for FORMULA in "${FORMULAS[@]}"
do
brew fetch --force --bottle-tag=arm64_big_sur $FORMULA
brew reinstall $(brew --cache --bottle-tag=arm64_big_sur $FORMULA)
done
fi
exit 0
"""