Skip to content

Commit

Permalink
gattlib-py: Introduce 'setup.py'
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Aug 5, 2019
1 parent 6ace06d commit 6a770e4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions gattlib-py/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`gattlib-py` is a wrapper for `gattlib` library.
31 changes: 31 additions & 0 deletions gattlib-py/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os
from setuptools import setup, find_packages
import subprocess

# Retrieve version from GIT
git_version_command = subprocess.Popen(['git', 'describe', '--abbrev=7', '--dirty', '--always', '--tags'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = git_version_command.communicate()
git_version = stdout.decode('utf-8').strip()

# Value from travis-ci
if 'TRAVIS_TAG' in os.environ:
git_version = os.environ['TRAVIS_TAG']
elif 'TRAVIS_BUILD_ID' in os.environ:
git_version = os.environ['TRAVIS_BUILD_ID'] + '-' + git_version

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name='gattlib-py',
version=git_version,
author="Olivier Martin",
author_email="olivier@labapart.com",
description="Python wrapper for gattlib library",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/labapart/gattlib/gattlib-py",
packages=find_packages(),
install_requires=['setuptools'],
)

0 comments on commit 6a770e4

Please sign in to comment.