fix: address code review — publish.yml permissions, test docstrings

- Add contents: read permission to publish.yml (required for actions/checkout)
  when any permission is explicitly set, unlisted permissions default to none
- Add timeout-minutes: 15 to publish.yml for consistency with ci.yml
- Add docstrings to 3 pyproject metadata test functions for consistency
  with the rest of the 2000+ line test file
This commit is contained in:
Brian Krabach
2026-04-04 14:53:40 -07:00
parent 1a4fd4cbed
commit 6294c075bc
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -6,11 +6,13 @@ on:
- "v*"
permissions:
contents: read # Required for actions/checkout
id-token: write # Required for OIDC Trusted Publisher
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 15
environment: pypi
steps:
- uses: actions/checkout@v4
+3
View File
@@ -2061,6 +2061,7 @@ def test_doctor_tls_nudge_hidden_on_localhost(capsys, tmp_path, monkeypatch):
def test_pyproject_has_authors():
"""pyproject.toml must declare at least one author with name and email."""
import tomllib
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
data = tomllib.loads(pyproject.read_text())
@@ -2071,6 +2072,7 @@ def test_pyproject_has_authors():
def test_pyproject_has_classifiers():
"""pyproject.toml must declare at least 3 classifiers including License and Python version."""
import tomllib
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
data = tomllib.loads(pyproject.read_text())
@@ -2082,6 +2084,7 @@ def test_pyproject_has_classifiers():
def test_pyproject_has_keywords():
"""pyproject.toml must declare at least 3 keywords for PyPI discoverability."""
import tomllib
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
data = tomllib.loads(pyproject.read_text())