Merge pull request 'chore: Python 3.12 is the floor, part B (#6)' (#8) from chore/python-312-floor-b into main
This commit was merged in pull request #8.
This commit is contained in:
commit
0e74cbbd3e
6 files changed
+14
-12
No files matched your search
+4
-2
@@ -9,8 +9,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/), versions fol
|
|||||||
- Python 3.12 is the floor: the shared workflow tests on 3.12 and 3.13 by default and
|
- Python 3.12 is the floor: the shared workflow tests on 3.12 and 3.13 by default and
|
||||||
runs `lowest` on 3.12, the template declares `requires-python = ">=3.12"` with ruff
|
runs `lowest` on 3.12, the template declares `requires-python = ">=3.12"` with ruff
|
||||||
and mypy targeting 3.12, and the tool itself needs 3.12. netOrk runs every driver in
|
and mypy targeting 3.12, and the tool itself needs 3.12. netOrk runs every driver in
|
||||||
its own containers on 3.12, so older versions are no longer tested. `check` keeps
|
its own containers on 3.12, so older versions are no longer tested. `check`
|
||||||
accepting a 3.10 floor until every driver has moved.
|
requires `requires-python` ≥ 3.12.
|
||||||
|
- The template's floor on napalm is 5.1: older releases import `pkg_resources`, which a
|
||||||
|
Python 3.12 venv no longer has, so `lowest` fails on them.
|
||||||
- `check` reports a license given as a TOML table or as a `License ::` classifier:
|
- `check` reports a license given as a TOML table or as a `License ::` classifier:
|
||||||
setuptools refuses both from 2027-02-18 (PEP 639). The template builds with
|
setuptools refuses both from 2027-02-18 (PEP 639). The template builds with
|
||||||
setuptools>=77.
|
setuptools>=77.
|
||||||
|
|||||||
+1
-1
@@ -178,7 +178,7 @@ release tags:
|
|||||||
- **`py.typed`** ships with the package.
|
- **`py.typed`** ships with the package.
|
||||||
|
|
||||||
`napalm-standard check` verifies: LICENSE, README and CHANGELOG present; the
|
`napalm-standard check` verifies: LICENSE, README and CHANGELOG present; the
|
||||||
metadata fields; `requires-python` ≥ 3.10; a floor on `napalm-device-types`; a
|
metadata fields; `requires-python` ≥ 3.12; a floor on `napalm-device-types`; a
|
||||||
`napalm.drivers` entry point; URLs in the org; `py.typed`; CI in `.gitea/` and no
|
`napalm.drivers` entry point; URLs in the org; `py.typed`; CI in `.gitea/` and no
|
||||||
`.github/`; strict mypy, a coverage source and floor; on a tag, tag = version and a
|
`.github/`; strict mypy, a coverage source and floor; on a tag, tag = version and a
|
||||||
CHANGELOG section for it.
|
CHANGELOG section for it.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from packaging.version import Version
|
|||||||
from napalm_standard.changelog import changelog_section
|
from napalm_standard.changelog import changelog_section
|
||||||
|
|
||||||
DEVICE_TYPES = "napalm-device-types"
|
DEVICE_TYPES = "napalm-device-types"
|
||||||
MIN_PYTHON = Version("3.10")
|
MIN_PYTHON = Version("3.12")
|
||||||
URL_PREFIX = "https://git.netork.io/NAPALM/"
|
URL_PREFIX = "https://git.netork.io/NAPALM/"
|
||||||
REQUIRED_FILES = ("LICENSE", "README.md", "CHANGELOG.md")
|
REQUIRED_FILES = ("LICENSE", "README.md", "CHANGELOG.md")
|
||||||
REQUIRED_FIELDS = ("name", "version", "description", "license")
|
REQUIRED_FIELDS = ("name", "version", "description", "license")
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ classifiers = [
|
|||||||
"Topic :: System :: Networking",
|
"Topic :: System :: Networking",
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"napalm>=5.0",
|
"napalm>=5.1", # older releases import pkg_resources, which a 3.12 venv lacks
|
||||||
"napalm-device-types>=4.21",
|
"napalm-device-types>=4.21",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ version = "1.2.0"
|
|||||||
description = "NAPALM driver for Example devices"
|
description = "NAPALM driver for Example devices"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"napalm>=5.0",
|
"napalm>=5.0",
|
||||||
"napalm-device-types>=4.21",
|
"napalm-device-types>=4.21",
|
||||||
|
|||||||
+6
-6
@@ -67,23 +67,23 @@ def test_a_license_table_is_reported(make_repo: RepoFactory, license_line: str)
|
|||||||
|
|
||||||
def test_a_license_classifier_is_reported(make_repo: RepoFactory) -> None:
|
def test_a_license_classifier_is_reported(make_repo: RepoFactory) -> None:
|
||||||
pyproject = PYPROJECT.replace(
|
pyproject = PYPROJECT.replace(
|
||||||
'requires-python = ">=3.10"\n',
|
'requires-python = ">=3.12"\n',
|
||||||
'requires-python = ">=3.10"\n'
|
'requires-python = ">=3.12"\n'
|
||||||
'classifiers = ["License :: OSI Approved :: Apache Software License"]\n',
|
'classifiers = ["License :: OSI Approved :: Apache Software License"]\n',
|
||||||
)
|
)
|
||||||
|
|
||||||
assert rules(check_repo(make_repo({"pyproject.toml": pyproject}))) == {"metadata"}
|
assert rules(check_repo(make_repo({"pyproject.toml": pyproject}))) == {"metadata"}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("spec", [">=3.8", ">=3.9", ""])
|
@pytest.mark.parametrize("spec", [">=3.9", ">=3.10", ">=3.11", ""])
|
||||||
def test_python_below_310_or_unbounded_is_reported(make_repo: RepoFactory, spec: str) -> None:
|
def test_python_below_312_or_unbounded_is_reported(make_repo: RepoFactory, spec: str) -> None:
|
||||||
pyproject = PYPROJECT.replace('requires-python = ">=3.10"', f'requires-python = "{spec}"')
|
pyproject = PYPROJECT.replace('requires-python = ">=3.12"', f'requires-python = "{spec}"')
|
||||||
|
|
||||||
assert rules(check_repo(make_repo({"pyproject.toml": pyproject}))) == {"python"}
|
assert rules(check_repo(make_repo({"pyproject.toml": pyproject}))) == {"python"}
|
||||||
|
|
||||||
|
|
||||||
def test_a_higher_python_floor_is_fine(make_repo: RepoFactory) -> None:
|
def test_a_higher_python_floor_is_fine(make_repo: RepoFactory) -> None:
|
||||||
pyproject = PYPROJECT.replace('">=3.10"', '">=3.11"')
|
pyproject = PYPROJECT.replace('">=3.12"', '">=3.13"')
|
||||||
|
|
||||||
assert check_repo(make_repo({"pyproject.toml": pyproject})) == []
|
assert check_repo(make_repo({"pyproject.toml": pyproject})) == []
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user