summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-08-28 17:49:29 -0500
committerJordan Cook <jordan.cook.git@proton.me>2023-03-01 17:37:05 -0600
commitf8a5333378b318757212d67d69c287fb7cc51bbf (patch)
tree0a592b93e428b1f36c4caf6ab949976ef6614745
parent812301ab85a3b54387dcebd7d65407ace2589b9f (diff)
downloadrequests-cache-explicit-exports.tar.gz
WIP: Add explicit top-level exports via __all__explicit-exports
-rw-r--r--requests_cache/__init__.py47
-rw-r--r--requests_cache/patcher.py2
2 files changed, 49 insertions, 0 deletions
diff --git a/requests_cache/__init__.py b/requests_cache/__init__.py
index 96f751b..829b099 100644
--- a/requests_cache/__init__.py
+++ b/requests_cache/__init__.py
@@ -11,3 +11,50 @@ from .patcher import *
from .policy import *
from .serializers import *
from .session import *
+
+__all__ = [
+ # Constants
+ 'ALL_METHODS',
+ 'BACKEND_CLASSES',
+ 'DO_NOT_CACHE',
+ 'NEVER_EXPIRE',
+ 'EXPIRE_IMMEDIATELY',
+ 'SERIALIZERS',
+ # Main classes
+ 'CachedHTTPResponse',
+ 'CachedRequest',
+ 'CachedResponse',
+ 'CachedSession',
+ 'CacheMixin',
+ # Backends
+ 'BaseCache',
+ 'DynamoCache',
+ 'FileCache',
+ 'GridFSCache',
+ 'MongoCache',
+ 'RedisCache',
+ 'SQLiteCache',
+ # Serializers
+ 'SerializerPipeline',
+ 'Stage',
+ 'CattrStage',
+ 'init_serializer',
+ 'bson_serializer',
+ 'json_serializer',
+ 'pickle_serializer',
+ 'safe_pickle_serializer',
+ 'yaml_serializer',
+ # Patching/wrapper functions
+ 'clear',
+ 'disabled',
+ 'enabled',
+ 'get_cache',
+ 'install_cache',
+ 'is_installed',
+ 'remove_expired_responses',
+ # Types & utility functions
+ 'AnyRequest',
+ 'AnyResponse',
+ 'CacheActions',
+ 'create_key',
+]
diff --git a/requests_cache/patcher.py b/requests_cache/patcher.py
index 406ee45..d217bbb 100644
--- a/requests_cache/patcher.py
+++ b/requests_cache/patcher.py
@@ -7,6 +7,8 @@
:functions-only:
:nosignatures:
"""
+from __future__ import annotations
+
from contextlib import contextmanager
from logging import getLogger
from typing import Optional, Type