Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
keewenaw
GitHub Repository: keewenaw/ethereum-wallet-cracker
Path: blob/main/test/lib/python3.9/site-packages/setuptools/config/__init__.py
4799 views
1
"""For backward compatibility, expose main functions from
2
``setuptools.config.setupcfg``
3
"""
4
import warnings
5
from functools import wraps
6
from textwrap import dedent
7
from typing import Callable, TypeVar, cast
8
9
from .._deprecation_warning import SetuptoolsDeprecationWarning
10
from . import setupcfg
11
12
Fn = TypeVar("Fn", bound=Callable)
13
14
__all__ = ('parse_configuration', 'read_configuration')
15
16
17
def _deprecation_notice(fn: Fn) -> Fn:
18
@wraps(fn)
19
def _wrapper(*args, **kwargs):
20
msg = f"""\
21
As setuptools moves its configuration towards `pyproject.toml`,
22
`{__name__}.{fn.__name__}` became deprecated.
23
24
For the time being, you can use the `{setupcfg.__name__}` module
25
to access a backward compatible API, but this module is provisional
26
and might be removed in the future.
27
"""
28
warnings.warn(dedent(msg), SetuptoolsDeprecationWarning)
29
return fn(*args, **kwargs)
30
31
return cast(Fn, _wrapper)
32
33
34
read_configuration = _deprecation_notice(setupcfg.read_configuration)
35
parse_configuration = _deprecation_notice(setupcfg.parse_configuration)
36
37