-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpyproject.toml
231 lines (205 loc) · 8.51 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
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
[build-system]
build-backend = "setuptools.build_meta:__legacy__"
requires = ["setuptools>=42",
"setuptools_scm[toml]>=6.2",
"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",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux"
]
dependencies = [
"numpy <= 2.2.2",
"lxml <= 5.3.0",
"pooch <= v1.8.2",
"importlib-resources; python_version <= '3.8'",
"importlib-metadata; python_version <= '3.8'"
]
optional-dependencies.test = ["pytest"]
[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"]
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 = [
"tests",
]
[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
"cp313-musllinux_x86_64", # problem with this version
"cp36-musllinux_*", "cp37-musllinux_*", "cp38-musllinux_*"] # older musllinux missing numpy wheels
test-skip = ["*-win_arm64", "cp38-macosx_arm64"]
test-extras = ["test"]
# 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" }
# 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.overrides]]
# for latest CPython use newer manylinux image
select = "cp312-*linux*"
manylinux-x86_64-image = "manylinux_2_28"
[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 swig gsl-devel"
[[tool.cibuildwheel.overrides]]
# musl uses apk/apt
select = "*musllinux*"
before-all = "apk add swig gsl-dev"
# restore musllinux_1_1 image for the time being (musllinux_1_2 segfaults)
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
# and archived 4.2.1 bottles of `swig` (swig 4.3.0 creates extensions that segfault)
before-all = ["brew install --quiet oras",
"oras pull ghcr.io/homebrew/core/swig:4.2.1",
"oras pull ghcr.io/homebrew/core/gsl:2.7.1"]
# re-enable if we need to do a per-build 'gsl' installation to force correct architecture when
# cross-compiling (https://stackoverflow.com/a/75488269)
# before-build = [
# "echo ARCHFLAGS = $ARCHFLAGS", # gets the arch at build-time
# "if [[ $ARCHFLAGS == *arm64 ]]; then BOTTLE_TAG=arm64_big_sur gsl; else BOTTLE_TAG=x86_64_linux; fi",
# "echo BOTTLE_TAG = $BOTTLE_TAG",
#]
# force old bottle brew fetch --force --bottle-tag=arm64_monterey gsl; brew reinstall $(brew --cache --bottle-tag=arm64_monterey gsl)"
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_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 `swig` and the Catalina version of `gsl` to match
before-all = ["brew install --quiet ./swig--4.2.1.monterey.bottle.tar.gz 2> /dev/null",
"brew install --quiet ./gsl--2.7.1.catalina.bottle.tar.gz 2> /dev/null"]
[[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 `swig` and the Big Sur version of `gsl` to match
before-all = ["brew install --quiet ./swig--4.2.1.arm64_ventura.bottle.tar.gz 2> /dev/null",
"brew install --quiet ./gsl--2.7.1.arm64_big_sur.bottle.tar.gz 2> /dev/null"]
[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
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"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
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"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
]
typing-modules = ["mypackage._compat.typing"]
# this won't work for Python 3.6, disable
#isort.required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
[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'
count = true
quiet-level = 3
ignore-words-list = 'nd,Fallin,commmon'
[tool.mdformat]
number = true
#exclude = [
# "NEWS.md",
# "website/**"
# ]