mirror of https://github.com/jab/bidict.git
add __version__ attribute
This commit is contained in:
parent
e6dd75525a
commit
a9e36a30b3
|
@ -1,7 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
Main package which pulls in all bidirectional dict types
|
||||
and utilities for working with one-to-one mappings.
|
||||
Efficient, Pythonic bidirectional map implementation
|
||||
and related functionality.
|
||||
|
||||
.. :copyright: (c) 2015 Joshua Bronson.
|
||||
.. :license: ISCL. See LICENSE for details.
|
||||
|
||||
"""
|
||||
|
||||
from ._common import BidirectionalMapping, CollapseException
|
||||
from ._bidict import bidict
|
||||
from ._collapsing import collapsingbidict
|
||||
|
@ -19,3 +26,10 @@ __all__ = (
|
|||
'pairs',
|
||||
'inverted',
|
||||
)
|
||||
|
||||
try:
|
||||
from pkg_resources import resource_string
|
||||
__version__ = resource_string(__name__, 'VERSION').decode('ascii').strip()
|
||||
except Exception as e:
|
||||
from warnings import warn
|
||||
warn('Failed to read/set version: %r' % e)
|
||||
|
|
2
setup.py
2
setup.py
|
@ -6,7 +6,7 @@ try:
|
|||
with open('bidict/VERSION', encoding='utf8') as f:
|
||||
version = f.read().strip()
|
||||
except Exception as e:
|
||||
version = '999999'
|
||||
version = '0.0.0'
|
||||
warn('Could not open bidict/VERSION, using bogus version (%s): %r' %
|
||||
(version, e))
|
||||
try:
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
import bidict
|
||||
|
||||
def test_version():
|
||||
assert bidict.__version__
|
Loading…
Reference in New Issue