-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
from .mypackage import * | ||
from .cli import cli | ||
|
||
from pkg_resources import get_distribution, DistributionNotFound | ||
try: | ||
VERSION = get_distribution(__name__).version | ||
except DistributionNotFound: | ||
try: | ||
from ._version import version as VERSION | ||
except ImportError: | ||
raise ImportError( | ||
"Failed to find (autogenerated) _version.py. " | ||
"This might be because you are installing from GitHub's tarballs, " | ||
"use the PyPI ones." | ||
) | ||
__version__ = VERSION | ||
# It used to be conventional to define a __version__ attribute. | ||
# However, it is now considered best practice to get version | ||
# information from the package metadata directly, eg by using | ||
# importlib.metadata.version (see below). | ||
# | ||
# If you still want to define __version__, uncomment the following: | ||
# | ||
# from importlib.metadata import version | ||
# __version__ = version(__package__ or __name__) |