Skip to content

Commit 0aeb7c6

Browse files
ianhitomwhite
authored andcommitted
build: switch to pyproject.toml
Previously pip was generating a warning when trying to do an editable install
1 parent fdcd7da commit 0aeb7c6

File tree

4 files changed

+225
-161
lines changed

4 files changed

+225
-161
lines changed

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
ignore =
3+
# whitespace before ':' - doesn't work well with black
4+
E203
5+
E402
6+
# line too long - let black worry about that
7+
E501
8+
# do not assign a lambda expression, use a def
9+
E731
10+
# line break before binary operator
11+
W503
12+

pyproject.toml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
[build-system]
2+
requires = ["setuptools >= 41.2", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sgkit"
7+
authors = [{ name = "sgkit Developers", email = "[email protected]" }]
8+
license = { text = "Apache" }
9+
description = "Statistical genetics toolkit"
10+
classifiers = [
11+
"Development Status :: 3 - Alpha",
12+
"License :: OSI Approved :: Apache Software License",
13+
"Operating System :: OS Independent",
14+
"Intended Audience :: Science/Research",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Topic :: Scientific/Engineering",
21+
]
22+
urls = { Homepage = "https://github.com/sgkit-dev/sgkit" }
23+
requires-python = ">=3.10"
24+
dependencies = [
25+
"numpy < 2.2",
26+
"xarray < 2025.03.1",
27+
"dask[array,dataframe] >= 2022.01.0, <= 2024.8.0",
28+
"distributed >= 2022.01.0, <= 2024.8.0",
29+
"scipy",
30+
"zarr >= 2.10.0, != 2.11.0, != 2.11.1, != 2.11.2, < 3",
31+
"numba",
32+
"typing-extensions",
33+
"fsspec != 2021.6.*",
34+
"scikit-learn",
35+
"pandas",
36+
"setuptools >= 41.2", # For pkg_resources
37+
]
38+
dynamic = ["version"]
39+
40+
[project.readme]
41+
text = """
42+
**sgkit** is an open source project for analyzing and manipulating genetic
43+
variation data."""
44+
content-type = "text/x-rst"
45+
46+
[project.optional-dependencies]
47+
# For plink we need dask[dataframe], we already have
48+
# dask[array] in install_requires, and since
49+
# https://github.com/pypa/pip/issues/4957, pip
50+
# will essentially ignore dask[dataframe] in the extras.
51+
# We can workaround this by either adding pip flag
52+
# --use-feature 2020-resolver, or installing
53+
# dask[dataframe] in the install_requires, or just listing
54+
# the 2 missing dependencies from dataframe, the way we do
55+
# here, when pip finally gets a resolver, this won't be
56+
# a problem. Here we opt for listing the 2 dependencies
57+
# since this is the least user invasive solution.
58+
plink = ["partd", "bed-reader"]
59+
bgen = ["rechunker", "cbgen > 1.0.5"]
60+
61+
[tool.setuptools]
62+
packages = ["sgkit"]
63+
zip-safe = false # https://mypy.readthedocs.io/en/latest/installed_packages.html
64+
include-package-data = true
65+
66+
[tool.coverage.report]
67+
fail_under = 100
68+
69+
[tool.pytest.ini_options]
70+
addopts = "--doctest-modules --ignore=validation --cov-fail-under=100"
71+
norecursedirs = [".eggs", "build", "docs"]
72+
filterwarnings = ["error", "ignore::DeprecationWarning"]
73+
74+
75+
[tool.isort]
76+
profile = "black"
77+
default_section = "THIRDPARTY"
78+
known_first_party = ["sgkit"]
79+
known_third_party = [
80+
"allel",
81+
"dask",
82+
"fire",
83+
"glow",
84+
"hail",
85+
"hypothesis",
86+
"invoke",
87+
"msprime",
88+
"numba",
89+
"numpy",
90+
"pandas",
91+
"pkg_resources",
92+
"pyspark",
93+
"pytest",
94+
"setuptools",
95+
"sgkit_plink",
96+
"sklearn",
97+
"sphinx",
98+
"typing_extensions",
99+
"xarray",
100+
"yaml",
101+
"zarr",
102+
]
103+
multi_line_output = 3
104+
include_trailing_comma = true
105+
force_grid_wrap = 0
106+
use_parentheses = true
107+
line_length = 88
108+
109+
[[tool.mypy.overrides]]
110+
module = ["callee.*"]
111+
ignore_missing_imports = true
112+
113+
[[tool.mypy.overrides]]
114+
module = ["dask.*"]
115+
ignore_missing_imports = true
116+
117+
[[tool.mypy.overrides]]
118+
module = ["fsspec.*"]
119+
ignore_missing_imports = true
120+
121+
[[tool.mypy.overrides]]
122+
module = ["dask_ml.*"]
123+
ignore_missing_imports = true
124+
125+
[[tool.mypy.overrides]]
126+
module = ["numpy.*"]
127+
ignore_missing_imports = true
128+
129+
[[tool.mypy.overrides]]
130+
module = ["pandas.*"]
131+
ignore_missing_imports = true
132+
133+
[[tool.mypy.overrides]]
134+
module = ["numba.*"]
135+
ignore_missing_imports = true
136+
137+
[[tool.mypy.overrides]]
138+
module = ["pytest.*"]
139+
ignore_missing_imports = true
140+
141+
[[tool.mypy.overrides]]
142+
module = ["statsmodels.*"]
143+
ignore_missing_imports = true
144+
145+
[[tool.mypy.overrides]]
146+
module = ["hypothesis.*"]
147+
ignore_missing_imports = true
148+
149+
[[tool.mypy.overrides]]
150+
module = ["zarr.*"]
151+
ignore_missing_imports = true
152+
153+
[[tool.mypy.overrides]]
154+
module = ["numcodecs.*"]
155+
ignore_missing_imports = true
156+
157+
[[tool.mypy.overrides]]
158+
module = ["setuptools"]
159+
ignore_missing_imports = true
160+
161+
[[tool.mypy.overrides]]
162+
module = ["sklearn.*"]
163+
ignore_missing_imports = true
164+
165+
[[tool.mypy.overrides]]
166+
module = ["cbgen.*"]
167+
ignore_missing_imports = true
168+
169+
[[tool.mypy.overrides]]
170+
module = ["rechunker.*"]
171+
ignore_missing_imports = true
172+
173+
[[tool.mypy.overrides]]
174+
module = ["bed_reader.*"]
175+
ignore_missing_imports = true
176+
177+
[[tool.mypy.overrides]]
178+
module = ["sphinx.*"]
179+
ignore_missing_imports = true
180+
181+
[[tool.mypy.overrides]]
182+
module = ["yarl.*"]
183+
ignore_missing_imports = true
184+
185+
[[tool.mypy.overrides]]
186+
module = ["allel.*"]
187+
ignore_missing_imports = true
188+
189+
[[tool.mypy.overrides]]
190+
module = ["networkx.*"]
191+
ignore_missing_imports = true
192+
193+
[[tool.mypy.overrides]]
194+
module = ["toolz.*"]
195+
ignore_missing_imports = true
196+
197+
[[tool.mypy.overrides]]
198+
module = ["scipy.*"]
199+
ignore_missing_imports = true
200+
201+
[[tool.mypy.overrides]]
202+
module = ["sgkit.*"]
203+
allow_redefinition = true
204+
205+
[[tool.mypy.overrides]]
206+
module = ["sgkit.*.tests.*"]
207+
disallow_untyped_calls = false
208+
disallow_untyped_defs = false
209+
disallow_untyped_decorators = false
210+
211+
[[tool.mypy.overrides]]
212+
module = ["validation.*"]
213+
ignore_errors = true

setup.cfg

Lines changed: 0 additions & 152 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)