Skip to content

Commit 8e95ef7

Browse files
committed
Move fetchers around to make them public
RequestsFetcher should still be public (even if deprecated). * We don't want to import RequestsFetcher in __init__ (because that requires importing requests) * but we do want RequestsFetcher to be importable publicly Move both fetchers out of _internal: that was never the right place for them anyway: they are public modules. Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent d60cf8b commit 8e95ef7

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ exclude_also = [
156156
]
157157
[tool.coverage.run]
158158
branch = true
159-
omit = [ "tests/*", "tuf/ngclient/_internal/requests_fetcher.py" ]
159+
omit = [ "tests/*", "tuf/ngclient/requests_fetcher.py" ]

tuf/ngclient/__init__.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@
44
"""TUF client public API."""
55

66
from tuf.api.metadata import TargetFile
7-
8-
# requests_fetcher is public but comes from _internal for now (because
9-
# sigstore-python 1.0 still uses the module from there). requests_fetcher
10-
# can be moved out of _internal once sigstore-python 1.0 is not relevant.
11-
from tuf.ngclient._internal.urllib3_fetcher import Urllib3Fetcher
127
from tuf.ngclient.config import UpdaterConfig
138
from tuf.ngclient.fetcher import FetcherInterface
149
from tuf.ngclient.updater import Updater
10+
from tuf.ngclient.urllib3_fetcher import Urllib3Fetcher
1511

1612
__all__ = [ # noqa: PLE0604
1713
FetcherInterface.__name__,

tuf/ngclient/_internal/requests_fetcher.py renamed to tuf/ngclient/requests_fetcher.py

-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
library.
66
"""
77

8-
# requests_fetcher is public but comes from _internal for now (because
9-
# sigstore-python 1.0 still uses the module from there). requests_fetcher
10-
# can be moved out of _internal once sigstore-python 1.0 is not relevant.
11-
128
from __future__ import annotations
139

1410
import logging

tuf/ngclient/updater.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949

5050
from tuf.api import exceptions
5151
from tuf.api.metadata import Root, Snapshot, TargetFile, Targets, Timestamp
52-
from tuf.ngclient._internal import trusted_metadata_set, urllib3_fetcher
52+
from tuf.ngclient import urllib3_fetcher
53+
from tuf.ngclient._internal import trusted_metadata_set
5354
from tuf.ngclient.config import EnvelopeType, UpdaterConfig
5455

5556
if TYPE_CHECKING:

0 commit comments

Comments
 (0)