-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
206 lines (171 loc) · 5.93 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
[project]
name = "okkie"
dynamic = [
"version"
]
description = "Python package for gamma-ray pulsar astronomy"
readme = "README.rst"
authors = [
{ name = "REGEARD Maxime"}
]
license = { text = "BSD-3-Clause" }
requires-python = ">=3.9"
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Astronomy",
]
keywords = [
"astronomy",
"astrophysics",
"pulsars",
"space",
"science",
"modeling",
"models",
]
dependencies = [
"numpy>=1.23.2",
"gammapy>=1.2",
"astropy>=5.0",
"packaging>=22.0.0",
"PyYAML>=6.0.0",
]
[project.optional-dependencies]
# Recommended run-time dependencies to enable a lot of functionality within Astropy.
recommended = [
"pint-pulsar>=1.0",
"scipy>=1.9.2",
"matplotlib>=3.6.0",
]
tests-only = [
"pytest>=7.1.0",
]
# Optional IPython-related behavior is in many places in Astropy. IPython is a complex
# dependency that occasionally requires pinning one of it's upstream dependencies. If
# you are using Astropy from an IPython-dependent IDE, like Jupyter, this should enforce
# the minimum supported version of IPython.
ipython = [
"ipython>=8.0.0",
]
[build-system]
requires = ["setuptools",
"setuptools_scm>=6.2",
"cython>=3.0.0, <4",
"numpy>=2.0.0, <3",
"extension-helpers>=1,<2"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
include-package-data = true
license-files = ["LICENSE.rst", "licenses/*.rst"]
zip-safe = false
platforms = ["any"]
provides = ["okkie"]
[tool.setuptools.packages.find]
include = ["okkie*"]
namespaces = true
[tool.setuptools_scm]
write_to = "okkie/_version.py"
[tool.ruff]
exclude = ["docs", "dev"]
# Like black
line-length = 88
indent-width = 4
lint.select = ["ALL"]
lint.ignore = [ # NOTE: non-permanent exclusions should be added to `.ruff.toml` instead.
# flake8-builtins (A) : shadowing a Python built-in.
# New ones should be avoided and is up to maintainers to enforce.
"A00",
# flake8-bugbear (B)
"B008", # FunctionCallArgumentDefault
# flake8-commas (COM)
"COM812", # TrailingCommaMissing
"COM819", # TrailingCommaProhibited
# pydocstyle (D)
# Missing Docstrings
"D102", # Missing docstring in public method. Don't check b/c docstring inheritance.
"D105", # Missing docstring in magic method. Don't check b/c class docstring.
# Whitespace Issues
"D200", # FitsOnOneLine
# Docstring Content Issues
"D410", # BlankLineAfterSection. Using D412 instead.
"D400", # EndsInPeriod. NOTE: might want to revisit this.
# pycodestyle (E, W)
"E711", # NoneComparison (see unfixable)
"E741", # AmbiguousVariableName. Physics variables are often poor code variables
# flake8-fixme (FIX)
"FIX002", # Line contains TODO | notes for improvements are OK iff the code works
# ISC001 shouldn't be used with ruff format
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"ISC001",
# pep8-naming (N)
"N803", # invalid-argument-name. Physics variables are often poor code variables
"N806", # non-lowercase-variable-in-function. Physics variables are often poor code variables
# pandas-vet (PD)
"PD",
# pylint (PLR and PLW)
"PLR1730",#commented because unknown rule selector # if-stmt-min-max (not always clearer, and sometimes slower)
"PLW0642", # self-or-cls-assignment (occasionally desirable, very rarely a mistake)
# flake8-use-pathlib (PTH)
"PTH123", # builtin-open (not worth creating a Path object, builtin open is fine)
# flake8-simplify (SIM)
"SIM103", # needless-bool (cannot be safely applied in all contexts (np.True_ is not True))
# flake8-self (SLF)
"SLF001", # private member access
# flake8-todos (TD)
"TD002", # Missing author in TODO
# flake8-return (RET)
# RET can sometimes help find places where refactoring is very helpful,
# but enforcing it everywhere might create undesirable churn
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
# Ruff-specific rules (RUF)
"RUF005", # unpack-instead-of-concatenating-to-collection-literal -- it's not clearly faster.
]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.extend-per-file-ignores]
"setup.py" = ["INP001"] # Part of configuration, not a package.
".github/workflows/*.py" = ["INP001"]
"test_*.py" = [
"ANN201", # Public function without return type annotation
"B018", # UselessExpression
"D", # pydocstyle
"S101", # Use of assert detected
]
".pyinstaller/*.py" = ["INP001"] # Not a package.
"conftest.py" = ["INP001"] # Part of configuration, not a package.
"docs/*.py" = [
"INP001", # implicit-namespace-package. The examples are not a package.
]
"examples/*.py" = [
"E402", # Imports are done as needed.
"INP001", # implicit-namespace-package. The examples are not a package.
"T203" # pprint found
]
"__init__.py" = ["F403"] # Wildcard imports
[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true
mypy-init-return = true
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.flake8-type-checking]
exempt-modules = []
[tool.ruff.lint.isort]
known-first-party = ["okkie", "extension_helpers"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"