potiuk opened a new pull request, #63598: URL: https://github.com/apache/airflow/pull/63598
## Summary - Remove 85 redundant `sys.path.insert(0, str(Path(__file__).parent.resolve()))` calls from prek/cov/in_container scripts — Python already adds the script's directory to `sys.path` when running a file directly - Add `__init__.py` files and `scripts/pyproject.toml` to make scripts a proper workspace distribution (`apache-airflow-scripts`) - Refactor `changelog_duplicates.py` and `newsfragments.py` to extract testable functions from module-level code - Add 177 pytest tests for prek script utilities: `common_prek_utils`, `new_session_in_provide_session`, `check_deprecations`, `unittest_testcase`, `changelog_duplicates`, `newsfragments`, `checkout_no_credentials`, `check_order_dockerfile_extras` - Integrate scripts tests into CI via selective checks (`SCRIPTS_FILES` file group) and a new `tests-scripts` job in `basic-tests.yml` - Exclude `scripts/tests/` from `check-core-deprecation-classes` pygrep hook and ruff S101 rule ## Test plan - [x] All 177 scripts tests pass locally (`uv run --project scripts pytest scripts/tests/ -xvs`) - [x] All pre-commit hooks pass - [ ] CI `tests-scripts` job runs when scripts files are changed - [ ] Existing prek hooks still work correctly (scripts run standalone without sys.path.insert) --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Claude Opus 4.6) Generated-by: Claude Code (Claude Opus 4.6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
