-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
104 lines (95 loc) · 4.37 KB
/
Copy pathpyproject.toml
File metadata and controls
104 lines (95 loc) · 4.37 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
[project]
name = "meta-disco"
version = "0.1.0"
description = "Rule engine for classifying biological data files"
authors = [{ name = "AnVIL Team" }]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"pyyaml>=6.0",
"requests>=2.31",
# >=2.11: the generated metadata_model.py sets ConfigDict keys introduced then
# (validate_by_name, serialize_by_alias); older 2.x silently ignores them.
"pydantic>=2.11",
]
[dependency-groups]
dev = [
"pytest>=8.0",
"ruff>=0.9",
"pyright>=1.1.411",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
# src layout. The non-.py data files under the package — the schema YAML
# (src/meta_disco/schema/) and the rules YAML (src/meta_disco/rules/) — ship as
# package data; both are load-bearing at runtime, so don't add excludes that drop them.
packages = ["src/meta_disco"]
[tool.ruff]
target-version = "py310"
line-length = 120
# Generated by gen-pydantic (schema/ `make gen-metadata`) — a build artifact that
# is committed because the runtime imports it, but not hand-edited, so don't lint
# its generator-emitted unused imports.
extend-exclude = ["src/meta_disco/schema/metadata_model.py"]
[tool.ruff.lint]
# Shared Clever Canary rule set (cc-claude-tools templates/pyproject.ruff.template.toml).
select = [
"E", "W", # pycodestyle
"F", # pyflakes: unused imports and variables, undefined names
"I", # isort: import ordering
"UP", # pyupgrade: modern syntax for the target version
"B", # flake8-bugbear: real bug patterns
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"PIE", # flake8-pie
"RET", # flake8-return
"PTH", # flake8-use-pathlib
"RUF", # Ruff's own rules
]
ignore = [
"E501", # line length: not hard-capped; the formatter (arrives in #181) targets 120 best-effort
# Rules that conflict with the ruff formatter (arrives in #181), ignored
# now so they never fight the formatter once it is the layout authority.
"E111", "E114", "E117", "W191",
# --- Burn-down list: rules turned on but not yet cleaned up. Each has an
# open issue; remove the codes as each issue lands. Every OTHER rule in
# these families is already live and protects new code. Fixes are made
# in the burn-down PRs, with tests, not by a blanket `ruff --fix` here:
# several of these autofixes change behavior or strip re-export noqas. ---
# RUF022 kept ignored on purpose (#178): both __all__ lists use intentional,
# non-alphabetical ordering that RUF022's sort would degrade — src/meta_disco/
# __init__.py groups exports by source module, and validators/__init__.py has
# explicit comment-grouped sections (# Contig length validators, etc.).
"RUF022",
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["F401", "E402"] # unused imports ok in tests; E402 for helper functions defined before imports
# Ruff's black-compatible formatter is the single authority on layout (make
# format / format-check). docstring-code-format reformats code examples inside
# docstrings too; every other setting stays at ruff's black-compatible default.
[tool.ruff.format]
docstring-code-format = true
[tool.pyright]
# Type checker, run separately from Ruff (make type / make lint-all). Standard
# mode is the shared Clever Canary baseline. Pyright resolves imports and the
# meta_disco package from the active uv venv (make runs it under `uv run`).
typeCheckingMode = "standard"
pythonVersion = "3.10"
include = ["src", "scripts", "tests"]
# Scripts are a flat directory imported by sibling scripts and by tests (which
# do sys.path.insert(scripts) at runtime); extraPaths lets pyright resolve those
# imports statically instead of reporting them missing.
extraPaths = ["scripts"]
# Generated by gen-pydantic — a committed build artifact, not hand-edited.
exclude = ["src/meta_disco/schema/metadata_model.py", "**/__pycache__"]
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
# End-to-end eval tests that read real fetched headers from the local
# evidence cache (data/evidence/anvil/, gitignored). tests/conftest.py
# auto-skips them when that cache is absent — e.g. in CI, where a miss would
# otherwise fall through to a live S3 + samtools fetch. See issue #180.
"e2e: needs the local evidence cache; auto-skipped when it is absent",
]