diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8db776e..23adde8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ concurrency: env: FORCE_COLOR: "1" TOX_TESTENV_PASSENV: "FORCE_COLOR" - MIN_PYTHON_VERSION: "3.6" + MIN_PYTHON_VERSION: "3.7" DEFAULT_PYTHON_VERSION: "3.9" jobs: @@ -33,7 +33,6 @@ jobs: strategy: matrix: python-version: - - "3.6" - "3.7" - "3.8" - "3.9" diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 83c0eeca..981657e0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,7 +15,7 @@ formats: python: # Mininum supported Python version - version: "3.6" + version: "3.7" # Install twine first, because RTD uses `--upgrade-strategy eager`, # which installs the latest version of docutils via readme_renderer. # However, Sphinx 4.2.0 requires docutils>=0.14,<0.18. diff --git a/changelog/869.feature.rst b/changelog/869.feature.rst new file mode 100644 index 00000000..2c165214 --- /dev/null +++ b/changelog/869.feature.rst @@ -0,0 +1 @@ +Drop support for Python 3.6. diff --git a/docs/conf.py b/docs/conf.py index 1f00d233..f5d6e25b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -286,7 +286,7 @@ # TODO: Try to add these to intersphinx_mapping nitpick_ignore_regex = [ - (r"py:.*", r"(pkginfo|IO).*"), + (r"py:.*", r"pkginfo.*"), ] # -- Options for apidoc output ------------------------------------------------ diff --git a/setup.cfg b/setup.cfg index 578a846d..19cfe643 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,6 @@ classifiers = Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -34,7 +33,7 @@ classifiers = packages = twine twine.commands -python_requires = >=3.6 +python_requires = >=3.7 install_requires= pkginfo >= 1.8.1 readme-renderer >= 21.0 diff --git a/tox.ini b/tox.ini index 12ec03ec..65cba7d2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.3 -envlist = lint,types,py{36,37,38,39,310},integration,docs +envlist = lint,types,py{37,38,39,310},integration,docs isolated_build = True [testenv] diff --git a/twine/settings.py b/twine/settings.py index 7ea5d4b1..d93e59b5 100644 --- a/twine/settings.py +++ b/twine/settings.py @@ -11,11 +11,13 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and +from __future__ import annotations + # limitations under the License. import argparse import contextlib import logging -from typing import Any, ContextManager, Optional, cast +from typing import Any, Optional, cast from twine import auth from twine import exceptions @@ -136,7 +138,7 @@ def password(self) -> Optional[str]: # Workaround for https://github.com/python/mypy/issues/5858 return cast(Optional[str], self.auth.password) - def _allow_noninteractive(self) -> ContextManager[None]: + def _allow_noninteractive(self) -> contextlib.AbstractContextManager[None]: """Bypass NonInteractive error when client cert is present.""" suppressed = (exceptions.NonInteractive,) if self.client_cert else () return contextlib.suppress(*suppressed)