Skip to content

Commit ea78045

Browse files
committed
Make id a full dependency
1 parent 09198e0 commit ea78045

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dependencies = [
4242
"rfc3986 >= 1.4.0",
4343
"rich >= 12.0.0",
4444
"packaging",
45+
"id",
4546
]
4647
dynamic = ["version"]
4748

@@ -62,7 +63,6 @@ register = "twine.commands.register:main"
6263

6364
[project.optional-dependencies]
6465
keyring = ["keyring >= 15.1"]
65-
trusted-publishing = ["id"]
6666

6767
[project.scripts]
6868
twine = "twine.__main__:main"

twine/auth.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from urllib.parse import urlparse
66

77
import requests
8+
from id import detect_credential # type: ignore
89

910
# keyring has an indirect dependency on PyCA cryptography, which has no
1011
# pre-built wheels for ppc64le and s390x, see #1158.
@@ -16,11 +17,6 @@
1617
except ModuleNotFoundError: # pragma: no cover
1718
keyring = None
1819

19-
try:
20-
from id import detect_credential # type: ignore
21-
except ModuleNotFoundError: # pragma: no cover
22-
detect_credential = None
23-
2420
from twine import exceptions
2521
from twine import utils
2622

@@ -69,7 +65,6 @@ def password(self) -> Optional[str]:
6965
self.is_pypi()
7066
and self.username == "__token__"
7167
and self.input.password is None
72-
and detect_credential is not None
7368
):
7469
logger.info(
7570
"Trying to use trusted publishing (no token was explicitly provided)"

0 commit comments

Comments
 (0)