File tree Expand file tree Collapse file tree
tests/cicd_utils/test_scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 3.10
Original file line number Diff line number Diff line change 22include Makefile
33include .coveragerc
44include .editorconfig
5+ include .python-version
56include *.cfg
67include *.ini
78include *.md
Original file line number Diff line number Diff line change 1- #!/usr/bin/env python
1+ #!/usr/bin/env -S uv run --script
2+ # /// script
3+ # requires-python = ">=3.10"
4+ # dependencies = [
5+ # "markdown-it-py",
6+ # "mdit-py-plugins",
7+ # "mdformat",
8+ # "mdformat-footnote",
9+ # ]
10+ # ///
11+ # NOTE: The PEP 723 inline metadata above is used when running this
12+ # script standalone (e.g. via `uv run` or the `release-notes`
13+ # tox env). The same dependencies are also declared in the
14+ # `cicd_utils` dependency group in pyproject.toml, which is
15+ # needed for the unit tests that import this module.
216"""Extract the latest release notes
317
418Execution steps:
Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ cicd_utils = [
6464 # manylinux2014_armv7l wheel, which breaks universal
6565 # (multi-platform) resolution with `uv sync`/`uv lock`
6666 " kaleido<0.4,!=0.2.1.post1" ,
67- # ./cicd_utils/cicd/scripts/extract_latest_release_notes.py
67+ # Deps for ./cicd_utils/cicd/scripts/extract_latest_release_notes.py
68+ # NOTE: these are also declared in the script's PEP 723 inline
69+ # metadata (used by `uv run`); they are duplicated here so
70+ # that the unit tests can import the script's module
6871 " markdown-it-py" ,
6972 " mdit-py-plugins" ,
7073 " mdformat" ,
Original file line number Diff line number Diff line change @@ -26,4 +26,6 @@ def test_py_scripts_are_executable(script_path: Path) -> None:
2626def test_py_scripts_have_py_shebang (script_path : Path ) -> None :
2727 with script_path .open ("r" ) as f :
2828 first_line = f .readline ()
29- assert first_line .startswith ("#!/usr/bin/env python" )
29+ # Scripts are either run directly with python or, when they declare
30+ # PEP 723 inline metadata, through `uv run --script`
31+ assert first_line .startswith (("#!/usr/bin/env python" , "#!/usr/bin/env -S uv run --script" ))
Original file line number Diff line number Diff line change @@ -103,16 +103,17 @@ commands =
103103[testenv:release-notes]
104104description = extract release notes from docs/reference/changelog.md
105105skip_install = true
106- dependency_groups = cicd_utils
107- commands = python cicd_utils/cicd/scripts/extract_latest_release_notes.py
106+ allowlist_externals = uv
107+ # The script's dependencies are declared as PEP 723 inline metadata,
108+ # which `uv run` resolves into an isolated (cached) script environment
109+ commands = uv run --no-project --script cicd_utils/cicd/scripts/extract_latest_release_notes.py
108110
109111[testenv:build-dists]
110112description = build source (sdist) and binary (wheel) distributions
111- deps =
112- build
113- twine
114- allowlist_externals = rm
113+ skip_install = true
114+ deps = twine
115+ allowlist_externals = rm, uv
115116commands =
116117 rm -rf dist/
117- python -m build
118+ uv build
118119 twine check --strict dist/*
You can’t perform that action at this time.
0 commit comments