denet 0.4.2

a simple process monitor
Documentation
[build-system]
requires = ["maturin>=1.8.3,<2.0"]
build-backend = "maturin"

[project]
name = "denet"
version = "0.4.2"
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.project]
name = "denet"
version = "0.4.2"
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" }
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