File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 workflow_dispatch :
2525
2626jobs :
27+ validate-metadata :
28+ name : " validate package metadata"
29+ runs-on : ubuntu-latest
30+ steps :
31+ - uses : actions/checkout@v6
32+ - name : Set up Python 3.11
33+ uses : actions/setup-python@v6
34+ with :
35+ python-version : " 3.11"
36+ - name : Validate optional dependency relationships
37+ run : |
38+ python - <<'PY'
39+ import tomllib
40+ from pathlib import Path
41+
42+ pyproject = Path("pyproject.toml")
43+ data = tomllib.loads(pyproject.read_text())
44+ optional = data["project"]["optional-dependencies"]
45+
46+ dataflow = set(optional.get("dataflow", []))
47+ examples = set(optional.get("examples", []))
48+
49+ missing = sorted(dataflow - examples)
50+ if missing:
51+ print("The [examples] extra must include all [dataflow] dependencies.")
52+ print("Missing from examples:")
53+ for dep in missing:
54+ print(f"- {dep}")
55+ raise SystemExit(1)
56+
57+ print("Optional dependency check passed: dataflow is a subset of examples.")
58+ PY
59+
2760 build :
2861 name : " python ${{ matrix.python-version }} tests"
2962 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -59,3 +59,13 @@ Use this to finalize a tested release branch.
5959- Avoid creating stable releases directly from ` main ` ; use the release branch path.
6060- If a stable release was published by mistake, coordinate with maintainers before
6161 deleting tags or editing release records.
62+
63+ ## Dependency extras guardrails
64+
65+ - ` dataflow ` is intended for production export workflows.
66+ - ` examples ` may include ` dataflow ` dependencies plus any additional packages used
67+ by user-facing examples.
68+ - Keep ` examples ` explicit (do not use self-referential extras like
69+ ` xee[dataflow] ` inside ` project.optional-dependencies ` ).
70+ - CI enforces that every dependency in ` dataflow ` is also present in ` examples `
71+ (subset check in ` .github/workflows/ci-build.yml ` ).
Original file line number Diff line number Diff line change @@ -49,8 +49,14 @@ dataflow = [
4949 " gcsfs<=2026.4.0" ,
5050 " xarray-beam" ,
5151]
52+ # Keep examples equivalent to dataflow, but avoid self-referential extras
53+ # ("xee[dataflow]") which can confuse dependency resolvers.
5254examples = [
53- " xee[dataflow]" ,
55+ " absl-py" ,
56+ " apache-beam[gcp]" ,
57+ " gcsfs<=2026.4.0" ,
58+ " matplotlib" ,
59+ " xarray-beam" ,
5460]
5561
5662[project .urls ]
You can’t perform that action at this time.
0 commit comments