-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathpyproject.toml
More file actions
191 lines (173 loc) · 4.8 KB
/
pyproject.toml
File metadata and controls
191 lines (173 loc) · 4.8 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
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[project]
name = "hmf"
description = "A halo mass function calculator"
requires-python = ">=3.12"
authors = [{name = "Steven Murray", email = "murray.steveng@gmail.com"}]
license = "MIT"
urls = {Documentation = "https://hmf.readthedocs.org"}
# Add here all kinds of additional classifiers as defined under
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
"Development Status :: 6 - Mature",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Astronomy"
]
dynamic = ["version"]
dependencies = [
"numpy>=1.6.2",
"scipy>=0.12.0",
"astropy>=1.1",
"deprecation",
"click",
"toml>=0.10.1",
"rich",
"cached_property",
"camb>=1.0.0"
]
[project.optional-dependencies]
cosmo = [
"colossus>=1.2.1"
]
fit = [
"emcee>=3.0"
]
extra = ["hmf[cosmo,fit]"]
[dependency-groups]
docs = [
"Sphinx>=1.7.5",
"numpydoc>=0.8.0",
"furo>=2025.12.19",
"sphinx-autoapi",
"nbsphinx>=0.9.8",
"ipython>=9.11.0",
]
tests = [
"coverage>=4.5.1",
"pytest>=3.5.1",
"pytest-cov>=2.5.1",
"mpmath>=1.0.0",
"colossus>=1.2.1",
"halomod>=1.4.6",
"numba>=0.64.0",
]
dev = [
{include-group = "docs"},
{include-group = "tests"},
"prek>=0.3.8",
"ruff>=0.15.6",
]
[project.scripts]
hmf = "hmf._cli:main"
[tool.pytest.ini_options]
addopts = [
"--cov=hmf",
"--cov-report=term-missing",
"--verbose"
]
norecursedirs = [
"dist",
"build",
".tox"
]
testpaths = [
"tests"
]
[tool.ruff]
exclude = [
"development/*.ipynb",
]
line-length=100
target-version="py312"
[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"E", # pycodestyle
"W", # pycodestyle warning
"F", # pyflakes
"C90", # mccabe complexity
"I", # isort
"N", # pep8-naming
"D", # docstyle
# "ANN" # type annotations
"B", # bugbear
"A", # builtins
"C4", # comprehensions
"DTZ", # datetime
"FA", # future annotations
"PIE", # flake8-pie
"T", # print statements
"PT", # pytest-style
"Q", # quotes
"SIM", # simplify
"PTH", # use Pathlib
"ERA", # kill commented code
"NPY", # numpy-specific rules
"PERF", # performance
# "FURB", # refurb
"RUF", # ruff-specific rules
"RET", # return statements
"RSE", # exception raises
"TRY201", # verbose raise
]
ignore = [
# "DTZ007", # use %z in strptime
# "DTZ001", # require tzinfo in datetime
# "B008", # do not performa function call in argument defaults
# "PTH207", # allow glob.glob() because when we use it, it's necessary
# "A003", # class attribute shadowing builtins
# "RUF009", # don;e perform function call in dataclass defaults
"N806", # Variable name should be lower case. We have some single-letter variables that make more sense to be caps.
"N803", # Argument name should be lowercase. Scientific notation (N, L, R, Mmin, etc.) - changing would break API.
"N801", # Class name should use CapWords. Names like Watson_FoF, EH_BAO are part of the public API.
"N802", # Function name should be lowercase. Test functions often use capitals for scientific notation.
"D401", # First line should be in imperative mood -- cached_properties and parameter descriptors don't fit this.
"B018", # Picks up "useless" expressions that are properties.
# "N815",
# "N807", # Allow method names to start and end with __
# "RUF012", # mutable class attributes annotation
# # The rest should be un-commented when possible...
# "PTH123",
# "PT011",
# "A005", # module name shadows builtin
# "RUF067", # allow defining new variables in __Init__ files
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"D1",
"T", # print statements
"N802", # function names - test functions often use capitals for scientific notation
"PT011", # pytest.raises too broad - acceptable in tests
"PT012", # pytest.raises with multiple statements - acceptable in tests
"PT030", # pytest.warns too broad - acceptable in tests
]
"docs/conf.py" = [
"A", # conf.py can shadow builtins
"ERA",
"DTZ",
]
"**/*.ipynb" = [
"T201", "DTZ", "D", "PTH119", "ERA"
]
[tool.ruff.lint.pydocstyle]
convention = 'numpy'
property-decorators = [
"pytest.fixture",
"property",
"cached_property",
"cached_quantity",
"parameter",
]
[tool.ruff.lint.mccabe]
max-complexity = 21