-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml.bk
More file actions
281 lines (250 loc) · 7.19 KB
/
pyproject.toml.bk
File metadata and controls
281 lines (250 loc) · 7.19 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
########################
### Project Metadata ###
########################
# Note: This is a notebook collection project, not a Python package
[project]
name = "python-notebooks-development"
description = "Python notebooks for neutron imaging beamlines at ORNL"
version = "0.1.0"
requires-python = "==3.12"
license = { text = "MIT" }
readme = "README.md"
[project.urls]
homepage = "https://github.com/ornlneutronimaging/python_notebooks"
repository = "https://github.com/ornlneutronimaging/python_notebooks"
documentation = "https://neutronimaging.pages.ornl.gov/tutorial/"
issues = "https://github.com/ornlneutronimaging/python_notebooks/issues"
###################
### Pixi config ###
###################
[tool.pixi.workspace]
channels = ["neutronimaging", "conda-forge", "oncat"]
platforms = ["linux-64"]
# Base dependencies (always included)
[tool.pixi.dependencies]
python = "3.12.*"
requests = "*"
requests-oauthlib = "*"
# ============================================
# Feature: Scientific Computing
# ============================================
[tool.pixi.feature.scientific]
[tool.pixi.feature.scientific.dependencies]
astropy = "*"
scipy = "*"
pandas = "*"
scikit-image = "*"
h5py = "*"
lmfit = "*"
pillow = "*"
neunorm = "*"
# ============================================
# Feature: Supporting Libraries
# ============================================
[tool.pixi.feature.support]
[tool.pixi.feature.support.dependencies]
poco = "*"
# ============================================
# Feature: Visualization
# ============================================
[tool.pixi.feature.viz]
[tool.pixi.feature.viz.dependencies]
matplotlib = "*"
plotly = "*"
dash = "*"
# ============================================
# Feature: Jupyter and Notebooks
# ============================================
[tool.pixi.feature.jupyter]
[tool.pixi.feature.jupyter.dependencies]
jupyterlab = "*"
ipympl = "*"
ipywidgets = "*"
jupytext = "*"
nbstripout = "*"
ipython = "*"
[tool.pixi.feature.jupyter.tasks]
lab = "jupyter lab --NotebookApp.nbserver_extensions=\"{'jupyterlab':True}\""
notebook = "jupyter notebook"
lab-build = "jupyter lab build --dev-build=False --minimize=True"
lab-clean = "jupyter lab clean --all"
lab-rebuild = { depends-on = ["lab-clean", "lab-build"] }
# ============================================
# Feature: Excel Support
# ============================================
[tool.pixi.feature.excel]
[tool.pixi.feature.excel.dependencies]
xlrd = "*"
openpyxl = "*"
xlsxwriter = "*"
# ============================================
# Feature: Qt and GUI
# ============================================
[tool.pixi.feature.gui]
[tool.pixi.feature.gui.dependencies]
qt = "*"
qtpy = "*"
pyqt = "*"
pyqtgraph = "*"
# ============================================
# Feature: Utilities
# ============================================
[tool.pixi.feature.utils]
[tool.pixi.feature.utils.dependencies]
inflect = "*"
werkzeug = "*"
tqdm = "*"
pyoncat = "*"
# ============================================
# Feature: Testing
# ============================================
[tool.pixi.feature.test]
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
[tool.pixi.feature.test.tasks]
test = "pytest notebooks/tests/ -v"
test_imports = "pytest notebooks/tests/test_imports.py -v"
# ============================================
# Feature: Development
# ============================================
[tool.pixi.feature.dev]
[tool.pixi.feature.dev.dependencies]
pre-commit = "*"
ruff = "*"
pip-audit = "*"
[tool.pixi.feature.dev.tasks]
lint = "ruff check notebooks/"
format = "ruff format notebooks/"
clean_notebooks = "python notebooks/_before_and_after_github_script.py -b"
restore_notebooks = "python notebooks/_before_and_after_github_script.py -a"
# Non-blocking audit - just warns about vulnerabilities
audit = "pip-audit --local || echo 'Warning: Some vulnerabilities found. Consider updating dependencies.'"
# ============================================
# PyPI Dependencies (all environments)
# ============================================
[tool.pixi.pypi-dependencies]
# tdcsophiread = { path = "/SNS/VENUS/shared/zhangc/wheels/tdcsophiread-3.0.2-cp312-abi3-linux_x86_64.whl" }
# neunorm = "*"
changepy = { git = "https://github.com/JeanBilheux/changepy" }
# ipywe = "*"
neutronbraggedge = "*"
sectorizedradialprofile = "*"
imagingreso = "*"
# tdcsophiread = { path = "/SNS/VENUS/shared/zhangc/wheels/tdcsophiread-3.0.2-cp312-abi3-linux_x86_64.whl" }
# ============================================
# Environments
# ============================================
[tool.pixi.environments]
# Default environment includes all features
default = { features = [
"scientific",
"support",
"viz",
"jupyter",
"excel",
"gui",
"utils",
"test",
], solve-group = "default" }
# Development environment includes everything plus dev tools
dev = { features = [
"scientific",
"support",
"viz",
"jupyter",
"excel",
"gui",
"utils",
"test",
"dev",
], solve-group = "default" }
# Minimal environment for CI/CD or lightweight usage
minimal = { features = [
"scientific",
"utils",
"test",
], solve-group = "minimal" }
# Jupyter-only environment
jupyter = { features = [
"scientific",
"viz",
"jupyter",
"utils",
], solve-group = "jupyter" }
# ============================================
# Global Tasks (available in all environments)
# ============================================
[tool.pixi.tasks]
# Installation check
check = "python util/installation_check.py"
# Combined test task
test_all = { depends-on = ["test_imports", "test"] }
# Clean all caches and build artifacts
clean = 'rm -rf .pytest_cache .ruff_cache **/__pycache__ notebooks/**/.ipynb_checkpoints'
##############
### Pytest ###
##############
[tool.pytest.ini_options]
# Adjusted for notebook testing
addopts = "-v"
pythonpath = [".", "notebooks"]
testpaths = ["notebooks/tests"]
python_files = ["test*.py"]
norecursedirs = [
".git",
"tmp*",
"_tmp*",
"__pycache__",
"*dataset*",
"*data_set*",
".ipynb_checkpoints",
]
# Add markers for different test categories
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
############
### Ruff ###
############
[tool.ruff]
target-version = "py311"
line-length = 120
# Exclude notebooks from direct linting (we'll handle them separately if needed)
exclude = [
"*.ipynb",
".ipynb_checkpoints",
"__pycache__",
".git",
".ruff_cache",
".pytest_cache",
]
[tool.ruff.lint]
# Selected rules appropriate for scientific notebooks
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"W", # pycodestyle warnings
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"NPY", # NumPy-specific rules
"PD", # pandas-vet
]
ignore = [
"E501", # line too long (handled by formatter)
"N802", # function names should be lowercase (scientific computing often uses math notation)
"N803", # argument names should be lowercase
"N806", # variable in function should be lowercase
"PD901", # avoid using 'df' as variable name (common in notebooks)
]
[tool.ruff.lint.isort]
known-first-party = ["__code"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"