Skip to content

Commit 6a770e4

Browse files
committed
gattlib-py: Introduce 'setup.py'
1 parent 6ace06d commit 6a770e4

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

gattlib-py/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`gattlib-py` is a wrapper for `gattlib` library.

gattlib-py/setup.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import os
2+
from setuptools import setup, find_packages
3+
import subprocess
4+
5+
# Retrieve version from GIT
6+
git_version_command = subprocess.Popen(['git', 'describe', '--abbrev=7', '--dirty', '--always', '--tags'],
7+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
8+
stdout, stderr = git_version_command.communicate()
9+
git_version = stdout.decode('utf-8').strip()
10+
11+
# Value from travis-ci
12+
if 'TRAVIS_TAG' in os.environ:
13+
git_version = os.environ['TRAVIS_TAG']
14+
elif 'TRAVIS_BUILD_ID' in os.environ:
15+
git_version = os.environ['TRAVIS_BUILD_ID'] + '-' + git_version
16+
17+
with open("README.md", "r") as fh:
18+
long_description = fh.read()
19+
20+
setup(
21+
name='gattlib-py',
22+
version=git_version,
23+
author="Olivier Martin",
24+
author_email="olivier@labapart.com",
25+
description="Python wrapper for gattlib library",
26+
long_description=long_description,
27+
long_description_content_type="text/markdown",
28+
url="https://github.com/labapart/gattlib/gattlib-py",
29+
packages=find_packages(),
30+
install_requires=['setuptools'],
31+
)

0 commit comments

Comments
 (0)