-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathpyproject.toml
More file actions
180 lines (162 loc) · 6.54 KB
/
Copy pathpyproject.toml
File metadata and controls
180 lines (162 loc) · 6.54 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
[build-system]
requires = ["hatchling", "hatch-vcs", "requests"]
build-backend = "hatchling.build"
[project]
name = "panda-server"
dynamic = ["version"]
description = "Unified PanDA Server and JEDI Package"
readme = "README.md"
license = {text = "Apache-2.0"}
authors = [
{ name = "PanDA Team", email = "panda-support@cern.ch" },
]
dependencies = [
'panda-common>=0.1.11',
'panda-client-light>=1.5.55',
'pyOpenSSL',
'python-daemon',
'mod_wsgi',
'stomp.py',
'pyyaml',
'pyjwt',
'polars',
'requests',
'psutil>=5.4.8',
'idds-common',
'idds-client',
'idds-workflow>=1.1.0',
'idds-doma',
'idds-atlas',
'ruamel.yaml',
'cwl-utils>=0.13',
'packaging',
'snakemake>=9.14.5',
'numpy',
'scipy',
'werkzeug',
'requests',
'bs4'
]
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
[project.optional-dependencies]
oracle = ['oracledb']
mysql = ['mysqlclient']
postgres = ['psycopg2-binary']
rucio = ['rucio-clients']
elasticsearch = ['elasticsearch']
atlasprod = ['oracledb', 'rucio-clients', 'elasticsearch', 'numpy', 'scipy']
mcp = ['uvicorn', 'fastmcp']
[project.urls]
Homepage = "https://panda-wms.readthedocs.io/en/latest/"
[tool.hatch.version]
path = "PandaPkgInfo.py"
pattern = "release_version = \"(?P<version>[^\"]+)\""
[tool.hatch.build]
directory = "dist"
[tool.hatch.build.targets.wheel]
exclude = ["*.template", "PandaPkgInfo.py", "hatch_build.py"]
packages = ["pandaserver", "pandajedi"]
[tool.hatch.build.targets.wheel.shared-data]
"templates" = "etc/panda"
"templates/bin" = "usr/bin"
"templates/init.d" = "etc/rc.d/init.d"
"templates/systemd" = "etc/systemd/system"
[tool.hatch.build.targets.wheel.hooks.custom]
path = "package/hatch_build.py"
[tool.hatch.build.targets.sdist]
exclude = [
".github",
".idea",
]
[tool.autopep8]
# https://pypi.org/project/autopep8/#pyproject-toml
max_line_length = 160
ignore = ["E501", "W6"]
in-place = true
recursive = true
aggressive = 3
[tool.pylint.master]
max-line-length = 160
[tool.pylint.'MESSAGES CONTROL']
disable = [
"C0209",
"R0902",
"R0913",
"R0914", # R0914: Too many local variables
]
[tool.flake8]
ignore = ['E501', 'U100']
# The rules live here rather than in .pre-commit-config.yaml so that a hook, a CI job and
# a developer running ruff by hand all get the same answer.
[tool.ruff]
line-length = 160
[tool.ruff.lint]
# F: pyflakes, the same set panda-common enforces. An undefined name (F821) parses fine
# and raises at import time instead -- in a daemon that is an outage rather than a failed
# check -- and annotations make it easy to hit, because the class named in one has to be
# imported even though nothing calls it. The rest of F earns its place too: clearing the
# tree for it turned up a "%" applied to a "{0}" template, which raised TypeError out of
# a daemon's main(), a name imported from two modules at once, and a DB call and a query
# whose results went nowhere.
#
# I: import order, in place of isort. ruff's defaults already agree with ruff-format, so
# there is no profile to set, and they agreed with the isort-formatted tree everywhere but
# one file.
select = ["F", "I"]
# The tree is clean under these flags and the mypy hook in .pre-commit-config.yaml fails on
# any finding, so a change that introduces one has to fix it. `mypy` with no arguments is
# the same run, which is how to get the answer without waiting for the hook.
#
# Widening the flags further will surface findings that were never counted; do that in a PR
# that also resolves them. --strict is not the next step: most of what it adds is
# disallow_untyped_calls, which reports a call into an unannotated function rather than an
# unannotated function, so it counts the same gaps again from the other side.
[tool.mypy]
files = ["pandaserver", "pandajedi"]
# Run without the third-party packages installed -- which is how a checkout with only mypy
# in the environment runs -- and every third-party import in the tree is unresolvable,
# which would otherwise be 455 findings that say nothing about this code. The override
# below takes this back off for pandaserver and pandajedi.
ignore_missing_imports = true
# Without this, mypy skips the body of every function that has no annotations --
# which is most of this tree, so the gate would only cover the code that needs it
# least. New code goes through the gate whether or not its author annotates it.
check_untyped_defs = true
# A bare `dict` or `list` in an annotation says nothing about what is in it, and
# nothing outside mypy -- the code map, an MCP tool schema, the next reader -- can
# recover it. Filling the parameters in is what makes an annotation worth having,
# so it is required rather than left to whoever writes the line.
disallow_any_generics = true
# A function that declares a type and then returns a value the checker knows nothing about
# has an annotation nobody verified. Most of those values are real -- a cursor result, a
# json.loads, a plugin the configuration named -- so this does not ask for them to go away;
# it asks for the type to be written on the value where it is received, which is the one
# place a reader can check it against the code that produced it.
warn_return_any = true
# Every function states the type of each parameter and of what it returns. A function that
# does not is not a style problem: it is a function whose body check_untyped_defs above
# checks in isolation and whose call sites nothing checks at all, so a wrong argument
# reaches production. disallow_incomplete_defs is the other half -- without it a single
# annotation on one parameter counts as annotating the function.
disallow_untyped_defs = true
disallow_incomplete_defs = true
# ignore_missing_imports silences a module mypy cannot find, which for a first-party path
# means it silences a typo: the name becomes Any and nothing is reported. py_compile parses
# rather than imports, so an import naming a module that is not there passes it, and the
# override below is what catches it instead. Seven of them were in the tree, two fatal in
# production and three written by the annotation work itself. For ignore_missing_imports the
# module patterns match the module being imported, not the file importing it, so naming the
# two first-party roots here makes only their paths a findable-or-fail matter and leaves
# every third-party import silent.
[[tool.mypy.overrides]]
module = [
"pandajedi.*",
"pandaserver.*",
]
ignore_missing_imports = false