8 Commits
Author SHA1 Message Date
Shahar Epstein e853537c04 Bump inline script metadata to Python 3.11 (#74152)
* Bump inline script metadata to Python 3.11

The prek hooks and dev scripts declare the interpreter they run under
in PEP 723 metadata, and prek picks the hook interpreter from it, so
this has to land before any hook starts using 3.11-only APIs. With
Python 3.10 gone from the project they can also drop the tomli backport from their dependency lists, because
tomllib is in the standard library from 3.11.

* Refresh diagram checksums for the Python 3.11 script headers
2026-10-06 23:20:46 +02:00
Jarek Potiuk 82f0fe9ce0 Move helm-tests/ to chart/tests/ and merge pyproject.toml into chart's (#66371)
* Move helm-tests/ to chart/tests/ and merge pyproject.toml into chart's

The Helm chart Python tests previously lived as their own workspace
member at `helm-tests/` with a dedicated `apache-airflow-helm-tests`
package. The chart sources and tests are inseparable in practice, so
this collapses them into a single `chart` workspace member: the test
files move under `chart/tests/`, and `helm-tests/pyproject.toml` is
merged into `chart/pyproject.toml` (which adopts the helm-tests
pytest config, the `mypy` dependency-group, and the test-only deps
on `apache-airflow-devel-common` and
`apache-airflow-providers-cncf-kubernetes`).

Names that are user/CI-visible are intentionally preserved:

* `breeze testing helm-tests` — command name unchanged.
* `mypy-helm-tests` — prek hook id unchanged (now lives in
  `chart/.pre-commit-config.yaml`, pointing at `chart/tests`).
* `run-helm-tests` — selective-checks output / CI gate, unchanged.
* `helm-tests.yml` — CI workflow file, unchanged.
* The directory `chart/tests/helm_tests/` keeps the Python package
  name `helm_tests` so test imports / module paths don't shift.

Path references updated everywhere they pointed at the old layout:
root `pyproject.toml` (workspace members, `[tool.uv.sources]`,
`apache-airflow-helm-chart = false` constraint rows, ruff per-file
ignores, mypy include path, dev dependency-group); `.github/CODEOWNERS`
(folded the `/helm-tests/` line into the existing `/chart/` entry —
same owners); `.github/dependabot.yml` and
`dev/update_github_branch_config.py`; breeze internals
(`global_constants.all_helm_test_packages`,
`run_tests.TEST_GROUP_TO_TEST_FOLDERS[GroupOfTests.HELM]`,
`run_tests.find_pytest_arguments`, `docker_command_utils` mounts,
`selective_checks` regexes); `scripts/ci/docker-compose/local.yml` and
`scripts/ci/prek/run_mypy_full_dist_local_venv_or_breeze_in_ci.py`
(with a `FOLDER_TO_PROJECT["chart/tests"] = "chart"` override since
`chart/tests` is not its own uv project); `dev/ide_setup/setup_idea.py`;
root `.pre-commit-config.yaml` exclusions; docs in
`contributing-docs/testing/helm_unit_tests.rst` and
`dev/breeze/doc/ci/04_selective_checks.md`; existing breeze unit tests
in `dev/breeze/tests/test_*.py`. `uv.lock` regenerated.

NOTE: developers running `breeze` via `uvx --from dev/breeze` may need
a one-time `uv cache clean` (or `touch dev/breeze/pyproject.toml`)
after pulling this commit so uvx rebuilds breeze from the current
source — uvx caches by content hash and will otherwise serve a stale
breeze that still references the old `helm-tests/tests/helm_tests`
path.

* Tighten chart/.helmignore and verify packaged chart contents in CI

Locally building the chart with `breeze release-management
prepare-helm-chart-package` after the helm-tests → chart/tests move
revealed that the published chart `.tgz` was bundling four files that
chart consumers do not need and that we did not realise had been
shipping for a while:

* `pyproject.toml` (workspace-member metadata for the chart's pytest /
  mypy config — irrelevant to consumers)
* `.pre-commit-config.yaml` (local dev/CI hook config)
* `docs/` (chart documentation source — rendered to
  airflow.apache.org/docs/helm-chart/, not needed inside the .tgz)
* `newsfragments/` (towncrier source for building RELEASE_NOTES.rst at
  release time)

Add all four to `chart/.helmignore` so they are no longer bundled.

To make sure this doesn't drift again, add a small verification script
`scripts/ci/verify_helm_chart_package.py` that:

* Reads the packaged `.tgz` and asserts the top-level entries match an
  explicit allowlist (Chart.yaml, values.yaml, templates/, etc.). Any
  newly-introduced top-level file fails the check until it is either
  added to the allowlist (chart-relevant) or to `.helmignore` (dev-only).
* Runs `helm lint` against the same `.tgz`.

Wire the script into the existing `tests-helm-release` job in
`.github/workflows/helm-tests.yml`, right after
`prepare-helm-chart-package` produces the artifact and before signing,
so a regression in the packaged set fails CI immediately.

The script is also runnable locally:

    uv run scripts/ci/verify_helm_chart_package.py dist/airflow-1.22.0.tgz

* Move missed otel_collector helm tests and ignore kustomize-overlays

Fixes two regressions caught by CI after the rebase:

* `helm-tests/tests/helm_tests/otel_collector/` was added on main after
  the original move commit was authored, so the rebase didn't pick it up.
  Move it to `chart/tests/helm_tests/otel_collector/` so the helm-tests
  tree is fully consolidated under chart/ as intended, and ruff /
  helm-tests no longer trip over the orphaned directory.
* The packaged-chart verification script flagged `kustomize-overlays/`
  as an unexpected top-level entry. The directory's own README states
  it is "not distributed with chart releases" — add it to
  `chart/.helmignore` so the .tgz matches that documented intent.

Refresh the breeze helm-tests command-help SVG/txt picked up by the
auto-fixer prek hook (now that breeze sees `otel_collector` as a valid
sub-package under `chart/tests/helm_tests/`).
2026-05-07 13:14:37 +02:00
Colten 251fe925b5 Use contextlib.suppress instead of try-except-pass and re-enable SIM105 (#66193)
Signed-off-by: ColtenOuO <jun930436@gmail.com>
2026-05-02 11:54:33 +02:00
Jarek Potiuk 9bb4c2075c Add .claude to IntelliJ IDEA excluded directories (#63843) 2026-03-17 21:29:17 +01:00
Jarek Potiuk e4dbc55b03 Add --open-ide flag and enhance --confirm in setup_idea.py (#63632)
* Add --confirm and --open-ide flags to setup_idea.py

- --confirm now auto-answers yes to all prompts (IDE close, process
  kill, file overwrite) instead of only the IDE close prompt
- --open-ide opens IntelliJ IDEA or PyCharm in the project directory
  after setup completes, supporting macOS (open -a) and Linux
  (Toolbox scripts and PATH lookup)

* Add AGENTS.md for IDE setup with --confirm and --open-ide usage

* Update setup_idea docs with --confirm and --open-ide descriptions
2026-03-15 12:33:17 +01:00
Jarek Potiuk 0e11c841f3 Fix IDEA setup to skip .claude directory and add scripts module (#63607)
- Add `.claude/` to EXCLUDED_PREFIXES so pyproject.toml discovery
  skips `.claude/worktrees/` directories
- Add `.claude` to _CLEANUP_SKIP_DIRS so IML cleanup ignores it
- Add `scripts` to STATIC_MODULES for the scripts distribution
2026-03-14 18:26:01 +01:00
Jarek Potiuk 263d3f8079 Improve PyCharm/IntelliJ IDEA setup with multi-module support and IDE auto-detection (#63508)
The `setup_idea.py` script now supports two modes: single-module (for PyCharm)
and multi-module (for IntelliJ IDEA Ultimate), with automatic IDE detection.
Key improvements:

- Auto-detect installed IDE and pick appropriate module mode
- Multi-module mode: each distribution gets its own .iml file for better
  per-module SDK control and cleaner project structure
- Register Python SDKs in global jdk.table.xml so interpreters are
  available immediately without manual setup
- Add --exclude flag to skip modules for faster indexing
- Add --python flag to choose Python version for the virtualenv
- Add --idea-path flag to target specific IDE installations
- Configure project-wide exclusion patterns for build artifacts
- Rename and expand PyCharm/IntelliJ quick-start documentation with
  detailed script options and mode explanations
2026-03-14 18:03:58 +01:00
Jed Cunningham 6e6aaa8a5c Move IDE setup scripts to dev/ide_setup (#61309)
Moves `setup_idea.py` and `setup_vscode.py` from the repo root to
`dev/ide_setup` to declutter the root directory. Updates the scripts
to correctly resolve the repository root from their new location,
and updates documentation references to point to the new paths.
2026-02-01 21:20:13 +08:00