-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpyproject.toml
More file actions
206 lines (179 loc) · 5.45 KB
/
Copy pathpyproject.toml
File metadata and controls
206 lines (179 loc) · 5.45 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
[project]
name = "python-royal"
description = "A reference project for the Python Royal university at SnowCamp 2025."
readme = "README.md"
license = "MIT"
authors = [
{ name = "GAFFIOT_Jonathan", email = "j.gaffiot@laposte.net" },
{ name = "LENORMAND_Julien", email = "lenormand.julien0@gmail.com"}
]
version = "0" # no base project version, only packages are versionned (independently)
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
]
requires-python = ">=3.13"
dependencies = [
"spectrum",
"x-viz",
] # should remain mostly empty, packages handle their dependencies
[dependency-groups] # optionals
dev = [
"doit>=0.36.0",
"ipdb>=0.13.13",
"ipython>=8.31.0",
"mypy>=1.14.1",
"pandas-stubs>=2.2.3.241126",
"pre-commit>=4.1.0",
"pytest>=8.3.4",
"pytest-cov>=6.0.0",
"pytest-gitignore>=1.3",
"pytest-html>=4.1.1",
"pytest-ruff>=0.4.1",
"ruff>=0.9.2",
]
[project.urls]
Documentation = "https://gitlab.com/jgaffiot1/python-royal#readme"
Issues = "https://gitlab.com/jgaffiot1/python-royal/issues"
Source = "https://gitlab.com/jgaffiot1/python-royal"
[tool.uv]
publish-url="https://gitlab.com/api/v4/projects/66171775/packages/pypi"
[tool.uv.workspace]
members = ["packages/*"]
#exclude = ["packages/"]
[tool.uv.sources]
spectrum = { workspace = true }
x_viz = { workspace = true }
[tool.ruff]
target-version = "py313"
line-length = 88 # Same as Black
fix = true
[tool.ruff.lint]
select = ["ALL"] # enable all rules by default
ignore = [ # disable some specific rules (reason in comment)
"COM", # (flake8-commas) handled by ruff
"EM", # (flake8-errmsg) too little gain for the cost
"CPY", # (flake8-copyright ) no need to enforce copyright declaration
"PTH123", # (builtin open() should be replaced by Path.open()) use of path.py and not Pathlib
"TRY003", # (avoid specifying long messages outside the exception class) would recommend the opposite
"ISC001", # warning: The following rules may cause conflicts when used with the formatter: `ISC001`.
"G004", # (Logging statement uses f-string) Not a problem anymore
]
fixable = ["ALL"] # Allow autofix for all enabled rules
unfixable = []
exclude = [
".git",
".git-rewrite",
".mypy_cache",
".pytype",
".ruff_cache",
".coverage",
"__pypackages__",
".ipynb_checkpoints/",
".venv",
"env/python_startup.py",
]
[tool.ruff.lint.per-file-ignores]
# Ignore `D104` (missing docstring in public package) in all `__init__.py` files
"__init__.py" = ["D104"]
# Ignore `S101` (use of `assert` detected) for pytest files
# Ignore `PLR2004` (magic value used in comparison) for pytest files
# Ignore `INP001` (file is part of an implicit namespace package) for pytest files
# Ignore `N802` (function name should be lowercase) for pytest files
"**/test/*.py" = ["S101", "PLR2004", "INP001", "N802"]
# Ignore `N999` (invalid module name) for streamlit pages
# Ignore `INP001` (file is part of an implicit namespace package) for streamlit pages
"packages/x_viz/src/Accueil.py" = ["INP001", "N999"]
"packages/x_viz/src/main.py" = ["INP001"]
"*/pages/*.py" = ["N999"]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.mypy]
python_version = "3.13"
mypy_path=["packages/spectrum/src", "packages/x_viz/src"]
#explicit_package_bases = true
pretty = true
namespace_packages = false
exclude=["test", "env/python_startup.py"]
plugins = "numpy.typing.mypy_plugin"
[[tool.mypy.overrides]]
module = [
"doit.tools",
"plotly.*",
"scipy.*",
"ruamel",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["test/", "packages/*/test"]
pythonpath = ["packages/spectrum/src", "packages/x_viz/src"]
filterwarnings = [
"ignore: np.exceptions.RankWarning",
]
norecursedirs = [
".git",
".git-rewrite",
".mypy_cache",
".pytype",
".ruff_cache",
".coverage",
"__pypackages__",
".ipynb_checkpoints/",
".venv",
"dist",
"docs",
"__pycache__",
]
addopts = '''
-v
--capture=no
--showlocals
--import-mode=importlib
--cov=packages/spectrum/src
--cov=packages/x_viz/src
--cov-report html
--cov-report=term
--html=.pytest_cache/pytest_report.html
'''
# xdist option
# -n auto
# Daily options
# -s: shortcut for --capture=no
# --exitfirst
# --failed-first: relaunch all tests but failed tests first
# --pdb: launch pdb after first fail
# -k <regex>: launch only test matching the regex
[tool.coverage.run]
branch = true
data_file = ".coverage/default_output"
omit = [
"packages/spectrum/src/spectrum/__version__.py",
"packages/x_viz/src/__version__.py",
]
[tool.coverage.html]
directory = ".coverage/html_output"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Enable more clear skip
"no-coverage",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about our test functions
"^def test",
]
[tool.pymarkdown]
plugins.line-length.line_length = 88
plugins.line-length.heading_line_length = 88
plugins.line-length.code_block_line_length = 88
plugins.ul-style.style = "sublist"