-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
149 lines (126 loc) · 5.06 KB
/
Copy pathpyproject.toml
File metadata and controls
149 lines (126 loc) · 5.06 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
[build-system]
requires = ["maturin>=1.8.3,<2.0"]
build-backend = "maturin"
[project]
name = "denet"
version = "0.7.1"
description = "A streaming process monitoring tool"
readme = "README.md"
authors = [{ name = "btraven00" }]
requires-python = ">=3.6"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
]
[tool.pixi.workspace]
name = "denet"
version = "0.7.1"
channels = ["conda-forge", "pypi"]
platforms = ["linux-64", "osx-arm64", "osx-64"]
[tool.pixi.dependencies]
python = "==3.12"
pip = "*"
maturin = "==1.8.6"
pytest = ">=7.0.0"
pytest-cov = ">=4.1.0"
pytest-xdist = ">=3.7.0,<4"
ruff = ">=0.1.0"
[tool.pixi.tasks]
build = { cmd = "maturin build --release --features python" }
develop = { cmd = "./scripts/build_and_install.sh --features python" }
test = { cmd = "python -m pytest -n 4 tests/python/" }
# 2 workers for github runners
coverage-rust = { cmd = "cargo llvm-cov --lib --lcov --output-path lcov.info --ignore-filename-regex 'python\\.rs$' -- --skip test_from_pid --skip test_process_metadata" }
pytest-with-coverage = { cmd = "python -m pytest -n 2 tests/python/ --cov=python/denet --cov-report=xml --cov-branch" }
pytest-with-coverage-html = { cmd = "python -m pytest -n 2 tests/python/ --cov=python/denet --cov-report=html --cov-branch" }
test-rust = { cmd = "cargo test" }
test-all = { cmd = "cargo test && python -m pytest tests/python/" }
lint = { cmd = "ruff check --force-exclude python/ tests/" }
lint-fix = { cmd = "ruff check --fix --force-exclude python/ tests/" }
fmt = { cmd = "cargo fmt --all && ruff format --force-exclude python/ tests/" }
fmt-python = { cmd = "ruff format tests/python/ python/denet/" }
check-fmt = { cmd = "cargo fmt --all -- --check && ruff format --force-exclude python/ tests/ --check" }
rust-lint = { cmd = "cargo clippy -- -D warnings" }
rust-fmt = { cmd = "cargo fmt --all" }
# Comprehensive lint check for all code (Rust + Python)
lint-all = { cmd = "cargo clippy -- -D warnings && ruff check --force-exclude python/ tests/ && ruff check tests/python/ python/denet/" }
# Clippy check for diagnosing issues without fixing (works on stable Rust)
clippy-check = { cmd = "cargo clippy -- -D warnings" }
# Clippy fix (requires nightly Rust)
clippy-fix = { cmd = "RUSTUP_TOOLCHAIN=nightly cargo clippy --fix -Z unstable-options --allow-dirty -- -D warnings" }
# Comprehensive fix for all code (Rust + Python)
fix-all = { cmd = "cargo fmt --all && ruff format --force-exclude python/ tests/ && ruff format tests/python/ python/denet/ && ruff check --fix --force-exclude python/ tests/ && ruff check --fix tests/python/ python/denet/ && RUSTUP_TOOLCHAIN=nightly cargo clippy --fix -Z unstable-options --allow-dirty -- -D warnings" }
# Publish to PyPI, crates.io
publish-pypi = { cmd = "maturin publish --skip-existing --features python -r denet" }
publish-crates = { cmd = "cargo publish --features python" }
extract-crates = { cmd = "cargo metadata --format-version 1 --locked | jq -r '.packages[] | \"(\\(.name|@sh), \\(.version|@sh)),\"'" }
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
# Only check for basic syntax errors initially
select = ["E", "F"]
# Ignore line length issues globally
ignore = ["E501"]
[tool.ruff.lint.per-file-ignores]
# Specific exclusions for changed files
"tests/python/test_process_monitor.py" = [
"F401", # Unused import
"F811", # Redefined name
"F841", # Unused variable
"E402", # Module level import not at top of file
"E711", # Comparison with None
"E712", # Comparison with True/False
"F821", # Undefined name
"E721", # Type comparison
"E722", # Bare except
"E741", # Ambiguous variable name
]
"tests/python/test_convenience.py" = [
"F401", # Unused import
"F811", # Redefined name
"F841", # Unused variable
"E402", # Module level import not at top of file
"E711", # Comparison with None
"E712", # Comparison with True/False
"F821", # Undefined name
"E722", # Bare except
"F541", # f-string without placeholders
]
"python/denet/__init__.py" = [
"F403", # Import * used
"F405", # Name from star imports
"E402", # Module level import not at top
"F821", # Undefined name
"E722", # Bare except
"E731", # Lambda assignment
"F541", # f-string without placeholders
"F811", # Redefined name
"F601", # Dictionary key repeated
]
"python/denet/analysis.py" = [
"F541", # f-string without placeholders
"F841", # Unused variable
"E722", # Bare except
"F821", # Undefined name
"E731", # Lambda assignment
"E741", # Ambiguous variable name
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
[tool.maturin]
python-source = "python"
module-name = "denet._denet"
features = ["python"]
[tool.ruff.lint.isort]
known-first-party = ["denet"]
combine-as-imports = true