From d70f4449618c0db393a840ad6c5630776df83971 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 23 Nov 2023 12:15:08 -0500 Subject: [PATCH 1/5] settings: remove old mypy workarounds Signed-off-by: William Woodruff --- twine/settings.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/twine/settings.py b/twine/settings.py index 4607c929..3f6b15f4 100644 --- a/twine/settings.py +++ b/twine/settings.py @@ -127,14 +127,12 @@ def __init__( @property def username(self) -> Optional[str]: - # Workaround for https://github.com/python/mypy/issues/5858 - return cast(Optional[str], self.auth.username) + return self.auth.username @property def password(self) -> Optional[str]: with self._allow_noninteractive(): - # Workaround for https://github.com/python/mypy/issues/5858 - return cast(Optional[str], self.auth.password) + return self.auth.password def _allow_noninteractive(self) -> "contextlib.AbstractContextManager[None]": """Bypass NonInteractive error when client cert is present.""" From b916d873398f957e6f67f3359fe91282d8dfe675 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 23 Nov 2023 16:42:18 -0500 Subject: [PATCH 2/5] CI, setup, tox: drop Python 3.7 Also adds 3.10 through 3.12, where missing. Signed-off-by: William Woodruff --- .github/workflows/main.yml | 7 ++++--- setup.cfg | 2 +- tox.ini | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 573c34f3..f9248c63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ concurrency: env: FORCE_COLOR: "1" TOX_TESTENV_PASSENV: "FORCE_COLOR" - MIN_PYTHON_VERSION: "3.7" - DEFAULT_PYTHON_VERSION: "3.9" + MIN_PYTHON_VERSION: "3.8" + DEFAULT_PYTHON_VERSION: "3.10" permissions: contents: read @@ -38,10 +38,11 @@ jobs: strategy: matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" + - "3.11" + - "3.12" platform: - ubuntu-latest - macos-latest diff --git a/setup.cfg b/setup.cfg index 5196d55d..91382b15 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ classifiers = packages = twine twine.commands -python_requires = >=3.7 +python_requires = >=3.8 install_requires= pkginfo >= 1.8.1 readme-renderer >= 35.0 diff --git a/tox.ini b/tox.ini index 813183c8..3c7c86f9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -minversion = 3.3 -envlist = lint,types,py{37,38,39,310},integration,docs +minversion = 3.8 +envlist = lint,types,py{38,39,310,311,312},integration,docs isolated_build = True [testenv] From 9ac84ea3136e970eed7b708b5ddf0bf05887c184 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 23 Nov 2023 16:43:36 -0500 Subject: [PATCH 3/5] setup: update classifiers for newer Pythons Signed-off-by: William Woodruff --- setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.cfg b/setup.cfg index 91382b15..86704c2e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,6 +27,8 @@ classifiers = Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython [options] From b213331956577b4dcf674ee9b09d46e6307076c8 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 23 Nov 2023 16:52:52 -0500 Subject: [PATCH 4/5] tox: add setuptools to test deps Signed-off-by: William Woodruff --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index 3c7c86f9..c9c9ae01 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,10 @@ deps = pytest-socket build coverage + # Needed on 3.12 and newer due to setuptools not being pre-installed + # in fresh venvs. + # See: https://github.com/python/cpython/issues/95299 + setuptools passenv = PYTEST_ADDOPTS commands = From 514f01ccd70aa70bde1506ca3a65c58068e8f9ac Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 23 Nov 2023 17:37:34 -0500 Subject: [PATCH 5/5] docs: constrain Sphinx's upper bound Signed-off-by: William Woodruff --- docs/requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index ef4b6f49..1a4677e9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,7 @@ doc8>=0.8.0 furo>=2021.10.09 readme-renderer>=17.4 -Sphinx>=4.3.1 +# Remove this upper bound when twine's minimum Python is 3.9+. +# See: https://github.com/sphinx-doc/sphinx/issues/11767 +Sphinx>=6,<7.1 sphinxcontrib-programoutput>=0.17