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:
@@ -6,11 +6,13 @@ on:
|
|||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
contents: read # Required for actions/checkout
|
||||||
id-token: write # Required for OIDC Trusted Publisher
|
id-token: write # Required for OIDC Trusted Publisher
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
environment: pypi
|
environment: pypi
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -2061,6 +2061,7 @@ def test_doctor_tls_nudge_hidden_on_localhost(capsys, tmp_path, monkeypatch):
|
|||||||
|
|
||||||
|
|
||||||
def test_pyproject_has_authors():
|
def test_pyproject_has_authors():
|
||||||
|
"""pyproject.toml must declare at least one author with name and email."""
|
||||||
import tomllib
|
import tomllib
|
||||||
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
||||||
data = tomllib.loads(pyproject.read_text())
|
data = tomllib.loads(pyproject.read_text())
|
||||||
@@ -2071,6 +2072,7 @@ def test_pyproject_has_authors():
|
|||||||
|
|
||||||
|
|
||||||
def test_pyproject_has_classifiers():
|
def test_pyproject_has_classifiers():
|
||||||
|
"""pyproject.toml must declare at least 3 classifiers including License and Python version."""
|
||||||
import tomllib
|
import tomllib
|
||||||
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
||||||
data = tomllib.loads(pyproject.read_text())
|
data = tomllib.loads(pyproject.read_text())
|
||||||
@@ -2082,6 +2084,7 @@ def test_pyproject_has_classifiers():
|
|||||||
|
|
||||||
|
|
||||||
def test_pyproject_has_keywords():
|
def test_pyproject_has_keywords():
|
||||||
|
"""pyproject.toml must declare at least 3 keywords for PyPI discoverability."""
|
||||||
import tomllib
|
import tomllib
|
||||||
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
|
||||||
data = tomllib.loads(pyproject.read_text())
|
data = tomllib.loads(pyproject.read_text())
|
||||||
|
|||||||
Reference in New Issue
Block a user