Skip to content

Commit 4e88f34

Browse files
Merge pull request #88 from MobileRoboticsSkoltech/feature/version
Feature/version - adding __version__ attribute.
2 parents b09eabb + 8994409 commit 4e88f34

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
try:
2424
from . import mrob
2525

26+
from pkg_resources import get_distribution
27+
28+
__version__ = get_distribution('mrob').version
29+
2630
for module in dir(mrob):
2731
n = len(module) - 1
2832
if not (module[:2] == '__' and module[n:n-2:-1] == '__') and module.count('.') == 0:

setup.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
[metadata]
2424
name = mrob
2525
home-page = https://github.com/MobileRoboticsSkoltech/mrob
26+
author = Gonzalo Ferrer
27+
author_email = G.Ferrer@skoltech.ru
28+
url = https://github.com/MobileRoboticsSkoltech/mrob
29+
download_url = https://github.com/MobileRoboticsSkoltech/mrob
30+
description = The Skoltech Mobile Robotics library (mrob) is a framework for implementing robotics research and projects.
31+
platforms = any
2632
maintainer = Gonzalo Ferrer
2733
maintainer_email = G.Ferrer@skoltech.ru
2834
long-description = file: README.md

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ def get_tag(self):
5555
except ImportError:
5656
bdist_wheel = None
5757

58-
5958
setuptools.setup(
60-
version_config=True,
59+
version_config={
60+
"dev_template": "{tag}.{branch}.post{ccount}+git.{sha}",
61+
"dirty_template": "{tag}.{branch}.post{ccount}+git.{sha}.dirty",
62+
},
63+
setup_requires=['setuptools-git-versioning'],
6164
cmdclass={'bdist_wheel': bdist_wheel}
6265
)

0 commit comments

Comments
 (0)