-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpixi.toml
More file actions
166 lines (140 loc) · 12 KB
/
pixi.toml
File metadata and controls
166 lines (140 loc) · 12 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
[workspace]
name = "gridappsd-python-workspace"
version = "2026.1.1b2"
description = "A GridAPPS-D Python Adapter"
authors = [
"C. Allwardt <3979063+craig8@users.noreply.github.com>",
"P. Sharma <poorva.sharma@pnnl.gov>",
"A. Fisher <andrew.fisher@pnnl.gov>",
]
license = "BSD-3-Clause"
readme = "README.md"
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
[dependencies]
python = ">=3.10,<4.0"
[pypi-dependencies]
# Main library dependencies
pyyaml = ">=6.0"
pytz = ">=2022.7"
dateutils = ">=0.6.7"
stomp-py = ">=6.0.0"
requests = ">=2.28"
python-dotenv = ">=0.9"
loguru = ">=0.7"
# Field bus dependencies
cim-graph = ">=0.4.3a6"
click = ">=8.1"
# Install local packages in editable mode
gridappsd-python = { path = "gridappsd-python-lib", editable = true }
gridappsd-field-bus = { path = "gridappsd-field-bus-lib", editable = true }
[feature.dev.pypi-dependencies]
pytest = ">=8.0"
pytest-cov = ">=4.0"
pytest-html = ">=3.1"
mypy = ">=1.3"
types-python-dateutil = ">=2.8"
types-pyyaml = ">=6.0"
ruff = ">=0.1"
pre-commit = ">=3.0"
python-on-whales = ">=0.60"
gitpython = ">=3.1"
sphinx = ">=7.0"
build = ">=1.0"
twine = ">=4.0"
# ══════════════════════════════════════════════════════════════════════════════
# Python Version Features (for CI matrix testing)
# ══════════════════════════════════════════════════════════════════════════════
[feature.py310.dependencies]
python = "~=3.10.0"
[feature.py311.dependencies]
python = "~=3.11.0"
[feature.py312.dependencies]
python = "~=3.12.0"
[feature.py313.dependencies]
python = "~=3.13.0"
[feature.py314.dependencies]
python = "~=3.14.0"
[environments]
default = { features = ["dev"], solve-group = "default" }
py310 = { features = ["dev", "py310"], solve-group = "py310" }
py311 = { features = ["dev", "py311"], solve-group = "py311" }
py312 = { features = ["dev", "py312"], solve-group = "py312" }
py313 = { features = ["dev", "py313"], solve-group = "py313" }
py314 = { features = ["dev", "py314"], solve-group = "py314" }
# ══════════════════════════════════════════════════════════════════════════════
# Tasks
# ══════════════════════════════════════════════════════════════════════════════
[tasks]
# ──────────────────────────────────────────────────────────────────────────────
# Testing
# ──────────────────────────────────────────────────────────────────────────────
test = { cmd = "pytest gridappsd-python-lib/tests -v -m 'not integration'", description = "Run main library tests" }
test-cov = { cmd = "pytest gridappsd-python-lib/tests -v -m 'not integration' --cov=gridappsd --cov-report=term-missing --cov-report=html", description = "Run tests with coverage" }
test-field-bus = { cmd = "pytest gridappsd-field-bus-lib/tests -v", description = "Run field bus tests" }
test-all = { depends-on = ["test", "test-field-bus"], description = "Run all tests" }
test-integration = { cmd = "pytest gridappsd-python-lib/tests -v -m integration", description = "Run integration tests only" }
# ──────────────────────────────────────────────────────────────────────────────
# Code Quality
# ──────────────────────────────────────────────────────────────────────────────
lint = { cmd = "ruff check gridappsd-python-lib/gridappsd gridappsd-field-bus-lib/gridappsd_field_bus", description = "Run linter" }
lint-fix = { cmd = "ruff check --fix gridappsd-python-lib/gridappsd gridappsd-field-bus-lib/gridappsd_field_bus", description = "Run linter with auto-fix" }
format = { cmd = "ruff format gridappsd-python-lib/gridappsd gridappsd-field-bus-lib/gridappsd_field_bus", description = "Format code" }
format-check = { cmd = "ruff format --check gridappsd-python-lib/gridappsd gridappsd-field-bus-lib/gridappsd_field_bus", description = "Check code formatting" }
typecheck = { cmd = "mypy gridappsd-python-lib/gridappsd gridappsd-field-bus-lib/gridappsd_field_bus --ignore-missing-imports", description = "Run type checker" }
check = { depends-on = ["lint", "format-check", "typecheck"], description = "Run all code quality checks" }
# ──────────────────────────────────────────────────────────────────────────────
# Building
# ──────────────────────────────────────────────────────────────────────────────
build-lib = { cmd = "python -m build", cwd = "gridappsd-python-lib", description = "Build main library" }
build-field-bus = { cmd = "python -m build", cwd = "gridappsd-field-bus-lib", description = "Build field bus library" }
build-all = { depends-on = ["build-lib", "build-field-bus"], description = "Build all packages" }
collect-dist = { cmd = "mkdir -p dist && cp gridappsd-python-lib/dist/*.whl dist/ 2>/dev/null || true && cp gridappsd-python-lib/dist/*.tar.gz dist/ 2>/dev/null || true && cp gridappsd-field-bus-lib/dist/*.whl dist/ 2>/dev/null || true && cp gridappsd-field-bus-lib/dist/*.tar.gz dist/ 2>/dev/null || true", description = "Collect dist files to root" }
build = { depends-on = ["build-all", "collect-dist"], description = "Build all and collect artifacts" }
# ──────────────────────────────────────────────────────────────────────────────
# Documentation
# ──────────────────────────────────────────────────────────────────────────────
docs = { cmd = "make html", cwd = "docs", description = "Build documentation" }
docs-serve = { cmd = "python -m http.server -d build/html 8000", cwd = "docs", description = "Serve documentation locally" }
docs-clean = { cmd = "make clean", cwd = "docs", description = "Clean documentation build" }
# ──────────────────────────────────────────────────────────────────────────────
# Docker / Integration Environment
# ──────────────────────────────────────────────────────────────────────────────
docker-clone = { cmd = "git clone --depth 1 https://github.com/GRIDAPPSD/gridappsd-docker /tmp/gridappsd-docker 2>/dev/null || (cd /tmp/gridappsd-docker && git pull)", description = "Clone/update gridappsd-docker" }
docker-up = { cmd = "docker compose up -d", cwd = "/tmp/gridappsd-docker", depends-on = ["docker-clone"], description = "Start GridAPPS-D containers" }
docker-down = { cmd = "docker compose down", cwd = "/tmp/gridappsd-docker", description = "Stop GridAPPS-D containers" }
docker-logs = { cmd = "docker compose logs -f gridappsd", cwd = "/tmp/gridappsd-docker", description = "Follow GridAPPS-D logs" }
# ──────────────────────────────────────────────────────────────────────────────
# Pre-commit
# ──────────────────────────────────────────────────────────────────────────────
pre-commit-install = { cmd = "pre-commit install", description = "Install pre-commit hooks" }
pre-commit-run = { cmd = "pre-commit run --all-files", description = "Run pre-commit on all files" }
# ──────────────────────────────────────────────────────────────────────────────
# Cleaning
# ──────────────────────────────────────────────────────────────────────────────
clean = { cmd = "rm -rf dist/ build/ gridappsd-python-lib/dist gridappsd-python-lib/build gridappsd-field-bus-lib/dist gridappsd-field-bus-lib/build .pytest_cache .mypy_cache .ruff_cache htmlcov && find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && find . -type d -name '*.egg-info' -exec rm -rf {} + 2>/dev/null || true", description = "Clean all build artifacts" }
# ──────────────────────────────────────────────────────────────────────────────
# Publishing
# ──────────────────────────────────────────────────────────────────────────────
publish-test = { cmd = "twine upload --repository testpypi dist/*", description = "Publish to TestPyPI" }
publish = { cmd = "twine upload dist/*", description = "Publish to PyPI" }
# ──────────────────────────────────────────────────────────────────────────────
# Convenience Workflows
# ──────────────────────────────────────────────────────────────────────────────
ci = { depends-on = ["check", "test-all"], description = "Run full CI pipeline" }
release = { depends-on = ["clean", "check", "test-all", "build"], description = "Full release workflow" }
# ══════════════════════════════════════════════════════════════════════════════
# Tool Configuration
# ══════════════════════════════════════════════════════════════════════════════
# Note: Ruff configuration is in ruff.toml (not read from pixi.toml)
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_ignores = true
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["gridappsd-python-lib/tests", "gridappsd-field-bus-lib/tests"]
addopts = "-v"
markers = [
"integration: marks tests as integration tests (require docker)",
]