Skip to content

Commit

Permalink
Merge pull request #1029 from woodruffw-forks/ww/fix-mypy
Browse files Browse the repository at this point in the history
settings: remove old mypy workarounds
  • Loading branch information
sigmavirus24 committed Nov 24, 2023
2 parents 96674db + 514f01c commit e6f45da
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ 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]
packages =
twine
twine.commands
python_requires = >=3.7
python_requires = >=3.8
install_requires=
pkginfo >= 1.8.1
readme-renderer >= 35.0
Expand Down
8 changes: 6 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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 =
Expand Down
6 changes: 2 additions & 4 deletions twine/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit e6f45da

Please sign in to comment.