Skip to content

Commit

Permalink
Remove deprecated alphaconf.application (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak authored Oct 27, 2022
1 parent 52ab0a0 commit adf8aaa
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions alphaconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,6 @@
#######################################
# APPLICATION CONTEXT

# DEPRECATED: reomove application
_application: ContextVar[Application] = ContextVar('application')


class DeprecatedWrapper(object):
def __init__(self, obj):
self._wrapped_obj = obj

def set_internal(self, app):
return self._wrapped_obj.set(app)

def __getattribute__(self, name):
import warnings

if name in ('set_internal', '__init__', '_wrapped_obj'):
return object.__getattribute__(self, name)
warnings.warn('alphaconf.application will be removed', DeprecationWarning)
return getattr(self._wrapped_obj, name)


application = DeprecatedWrapper(_application)
# END OF DEPRECATION
"""The current configuration"""
configuration: ContextVar[DictConfig] = ContextVar('configuration', default=OmegaConf.create())
"""Additional helpers for the application"""
Expand Down Expand Up @@ -213,7 +191,6 @@ def set_application(app: Application, merge: bool = False):
:param app: The application
:param merge: Wether to merge the current configuration with the application (default false)
"""
application.set_internal(app)
config = app.configuration
if merge:
# merging 2 DictConfig objects
Expand Down

0 comments on commit adf8aaa

Please sign in to comment.