-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpyproject.toml
More file actions
291 lines (259 loc) · 10.6 KB
/
Copy pathpyproject.toml
File metadata and controls
291 lines (259 loc) · 10.6 KB
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
[build-system]
build-backend = "setuptools.build_meta:__legacy__"
requires = ["setuptools>=42",
"setuptools_scm[toml]>=6.2",
"swig>=4.2.1,<=4.2.1.post0", # pin `swig` to 4.2.1 (swig 4.3.0 creates extensions that segfault)
# fallback to 4.2.1 if a 4.2.1.post0 compatible package not available
"tomli",
"cffconvert @ git+https://github.com/alexlancaster/cffconvert.git@combine_features#egg=cffconvert",
"importlib-metadata; python_version <= '3.8'"
]
[project]
name = "pypop-genomics"
description = "PyPop: Python for Population Genomics"
license = { text = "GPL-2.0-or-later" }
authors = [{ name = "Alex Lancaster" }]
maintainers = [{ name = "PyPop team" }]
dynamic = ["readme", "version"]
keywords = [
"bioinformatics",
"population-genomics",
"evolutionary-biology",
"population-genetics"
]
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux"
]
dependencies = [
"numpy <= 2.5.0",
"lxml <= 6.1.1",
"pooch <=1.9.0",
"importlib-resources; python_version <= '3.8'",
"importlib-metadata; python_version <= '3.8'"
]
[project.optional-dependencies]
test = [
"pytest",
"pytest-benchmark[histogram]",
"pytest-doctestplus",
'sphinx; platform_python_implementation != "PyPy"',
]
test-pval-benchmarking = ["scipy"]
[project.urls]
Homepage = "http://pypop.org/"
Documentation = "http://pypop.org/docs/"
Changelog = "https://github.com/alexlancaster/pypop/blob/main/NEWS.md"
Source = "https://github.com/alexlancaster/pypop/"
Tracker = "https://github.com/alexlancaster/pypop/issues"
[project.scripts]
pypop = "PyPop.pypop:main"
popmeta = "PyPop.popmeta:main"
pypop-interactive = "PyPop.pypop:main_interactive"
[tool.setuptools]
[tool.setuptools.packages.find]
where = ["src"]
include = ["PyPop", "PyPop.xslt"]
[tool.setuptools.package-data]
"PyPop" = ["citation/CITATION*"]
[tool.setuptools.dynamic]
readme = { file = "README.rst", content-type = "text/x-rst" }
[tool.setuptools_scm]
write_to = "src/PyPop/_version.py"
version_scheme = "post-release"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config", "--doctest-modules", "--doctest-glob=*.rst"]
xfail_strict = true
# convert warnings to errors, except for ImportWarnings in numpy (needed for pp38)
# FIXME: eventually we should be able to remove the numpy exception
filterwarnings = ["error", "default::ImportWarning", "ignore:.*Arlequin.*deprecated.*"]
log_cli_level = "INFO"
testpaths = [
"website/docs",
"tests",
]
norecursedirs = [
"tests/data"
]
[tool.cibuildwheel]
enable = ["pypy"] # explicitly enable, this will be required for cibuildwheel >= 3
skip = ["*-win32", "*_i686", # skip 32-bit builds
"pp37-*", # skip certain PyPy configurations
"pp*_aarch64 ", # no numpy wheels for aarch64 on PyPy
"pp311-*", # no numpy wheels for PyPy 3.11
"cp36-musllinux_*", "cp37-musllinux_*", "cp38-musllinux_*", # older musllinux missing numpy wheels
"cp314t*" # lxml not yet built
]
test-skip = ["*-win_arm64", "cp38-macosx_arm64"]
test-extras = ["test"]
test-command = ["sphinx-build -b doctest {package}/website/doctest _doctests",
"pytest -v --pyargs PyPop {package}/tests"]
# FIXME: can add "test-command" that would allow unit test output to be saved
# "pytest -v {package}/tests && echo {package} && ls && tar zcvf unit_tests_output.tar.gz run_test_* && cp unit_tests_output.tar.gz {package}/wheelhouse/"
# don't try and install pypi packages that need build from source
# this is mainly import during the testing phase
environment = { PIP_ONLY_BINARY=":all:", PIP_VERBOSE="0", PYPOP_DOCS_MODE="installed" }
# use pip and override the PIP_ONLY_BINARY=:all: during wheel generation
# so that certain source-only build deps (like cffconvert) install
build-frontend = { name = "pip", args = ["--only-binary=:none:"] }
[tool.cibuildwheel.linux]
# add aarch64 to default ("auto") architectures
archs = ["auto", "aarch64"]
# default linux wheels use CentOS-based runners, local cibuildwheel docker
before-all = ["yum install -y gsl-devel"]
# force use of newer `manylinux_2_28`: in cibuildwheel >= 3.0 it will be the default
manylinux-x86_64-image = "manylinux_2_28"
manylinux-pypy_x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
manylinux-pypy_aarch64-image = "manylinux_2_28"
[[tool.cibuildwheel.overrides]]
# run the benchmarking only on cp314
select = "cp314-manylinux_x86_64"
inherit.test-extras = "append"
test-extras = ["test-pval-benchmarking"]
inherit.environment = "append"
environment = { PYTEST_OPTIONS="--runslow --pval-benchmarking" }
[[tool.cibuildwheel.overrides]]
# skip sphinx doctest on PyPy: can't install sphinx
select = "pp*"
test-command = ["pytest -v --pyargs PyPop {package}/tests"]
[[tool.cibuildwheel.overrides]]
# musl uses apk/apt
select = "*musllinux*"
before-all = ["apk add gsl-dev"]
# FIXME: if we want to run the full tests, need to enable the below to force
# musllinux_1_1 image for the time being on x86_64 (musllinux_1_2 segfaults on
# any test involving emhaplofreq)
# musllinux-x86_64-image="musllinux_1_1"
[tool.cibuildwheel.macos]
# use oras to get archived 2.7.1 bottles of `gsl` that has 10.15 (on x86) / 11.0 (on arm64) builds
before-all = ["brew install --quiet oras",
"oras pull ghcr.io/homebrew/core/gsl:2.7.1"]
archs = ["arm64", "x86_64"] # don't enable "universal2" binary
[[tool.cibuildwheel.overrides]]
select = "*-macosx_*"
inherit.environment="append"
environment = { CPATH="/opt/homebrew/include", LIBRARY_PATH="/opt/homebrew/lib", PYTHONFAULTHANDLER="1", HOMEBREW_DEVELOPER="1", HOMEBREW_GREP_WARNINGS="-e 'is available and more recent than version' -e 'Cannot verify the integrity of'" }
[[tool.cibuildwheel.overrides]]
select = "*-macosx_x86_64"
inherit.environment="append"
environment = { MACOSX_DEPLOYMENT_TARGET="10.15" } # target 10.15/Catalina
inherit.before-all="append"
# install the Catalina version of `gsl` to match
before-all = ["brew install --quiet ./gsl--2.7.1.catalina.bottle.tar.gz"]
[[tool.cibuildwheel.overrides]]
select = "*-macosx_arm64"
inherit.environment="append"
environment = { MACOSX_DEPLOYMENT_TARGET="11.0" } # target for 11.0/Big Sur
inherit.before-all="append"
# install the Big Sur version of `gsl` to match
before-all = ["brew install --quiet ./gsl--2.7.1.arm64_big_sur.bottle.tar.gz"]
[tool.cibuildwheel.windows]
archs = ["auto", "ARM64"]
[[tool.cibuildwheel.overrides]]
# overrides for X86
select ="*-win_amd64*"
# use nuget to install gsl on Windows, and manually supply paths
before-all = "nuget install gsl-msvc14-x64 -Version 2.3.0.2779"
inherit.environment="append"
environment = { CPATH="gsl-msvc14-x64.2.3.0.2779\\\\build\\\\native", LIBRARY_PATH="gsl-msvc14-x64.2.3.0.2779\\\\build\\\\native\\\\static" }
[[tool.cibuildwheel.overrides]]
# overrides for ARM64
select ="*-win_arm64*"
before-all = 'nuget install gsl-msvc14-arm64 -Source "%CD%\\vendor-binaries"'
# use local nuget package to install gsl on Windows ARM64, and manually supply paths
inherit.environment = "append"
environment = { CPATH="gsl-msvc14-arm64.2.3.0.2779\\\\build\\\\native\\\\include", LIBRARY_PATH="gsl-msvc14-arm64.2.3.0.2779\\\\build\\\\native\\\\lib" }
[tool.ruff]
target-version = "py37"
[tool.ruff.lint]
extend-select = [
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
# "C90", # mccabe complexity
"D", # all pydocstyle/PEP 257 checks
"DTZ", # good datetime practices
"EM", # flake8-errmsg
# "ERA", # erdicate useless code
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"LOG", # logger
"N", # pep8 naming
"NPY", # NumPy specific rules
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
# "Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff-specific
# "S", # flake8-bandit (security testing)
"SIM", # flake8-simplify
"T20", # flake8-print
# "TD", # flake8-todos
"TID", # tidy imports
"TRY", # try.ceratptops exception handling
"UP", # pyupgrade
"YTT", # flake8-2020
]
ignore = [
"T201", # allow `print()`
"PTH107", # allow .`os.remove` until `Path.unlink` works on later Pythons
"PTH123", # allow `open()`
"ISC001", # Conflicts with formatter
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"D107", # Skip "missing docstring in __init__" if you merge class+init docstrings
"D102", # missing docstring in method -- FIXME disable currently
"N802", # we don't currently require functions to be lowercase
"N803", # we don't currently require methods to be lowercase
"N806", # we don't currently require methods to be lowercase
"N815", # mixed case OK in class scope
"N816", # mixed case OK in global scope
"S101", # allow assert
]
typing-modules = ["mypackage._compat.typing"]
# this won't work for Python 3.6, disable
#isort.required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.pydocstyle]
convention = "google" # also "numpy" or "pep257"
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20", "D100", "D103"] # don't need docs on every unit test function
[tool.codespell]
skip = '*tests/data/*,.data/*,src/obsolete/*,src/slatkin-exact/README,src/pval/*,src/PyPop/xslt/xsl.dtd,src/haplo-stats/haplo_em_pin.c,website/requirements-docs.txt'
count = true
quiet-level = 3
ignore-words-list = 'nd,Fallin,commmon'
[tool.mdformat]
number = true
#exclude = [
# "NEWS.md",
# "website/**"
# ]
[tool.repo-review.ignore]
PY004 = "docs in website not `docs` folder"
PC111 = "doesn't use blacken directly (uses ruff)"
PC140 = "doesn't use typechecker"
MY = "no typechecker"
RTD = "doesn't use read the docs"
[tool.pydoclint]
style = "google" # Google style
# require-return = true # Require documenting returns
check-param-types = true # Ensure param types are provided
check-return-types = false # Disable return type checking
arg-type-hints-in-signature = false # We don't use type hints in signature
should-document-star-arguments = false # don't require document **kwargs
allow-init-docstring = true # allow docstrin in init.py