File: __init__.py

package info (click to toggle)
django-pipeline 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 916 kB
  • sloc: python: 3,198; makefile: 119; javascript: 59
file content (28 lines) | stat: -rw-r--r-- 754 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
PackageNotFoundError = None
DistributionNotFound = None
try:
    from importlib.metadata import PackageNotFoundError
    from importlib.metadata import version as get_version
except ImportError:
    get_version = None
    PackageNotFoundError = None
if get_version is None:
    try:
        from pkg_resources import DistributionNotFound, get_distribution

        def get_version(x):
            return get_distribution(x).version

    except ImportError:
        get_version = None
        DistributionNotFound = None
        get_distribution = None

__version__ = None
if get_version is not None:
    try:
        __version__ = get_version("django-pipeline")
    except PackageNotFoundError:
        pass
    except DistributionNotFound:
        pass