From db61a8006c9f876e2ecfbb989e75305ac3762e4b Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Thu, 4 May 2017 12:34:27 +0200 Subject: [PATCH] 0.1.0 --- README.md | 6 ------ luxafor/__init__.py | 1 + setup.py | 51 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 setup.py diff --git a/README.md b/README.md index d70762b..3b7c482 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,6 @@ Helper interface and CLI to interact with [luxafor](https://luxafor.com) product ## Install -``` -pip3 install pyluxafor -``` - -or - ``` git clone git@github.com:fmartingr/pyluxafor.git cd pyluxafor diff --git a/luxafor/__init__.py b/luxafor/__init__.py index e69de29..b794fd4 100644 --- a/luxafor/__init__.py +++ b/luxafor/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.0' diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..39028cc --- /dev/null +++ b/setup.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +import os +import re +from setuptools import setup, find_packages +import sys + +THIS_PATH = os.path.dirname(os.path.abspath(__file__)) +README = open(os.path.join(THIS_PATH, 'README.md')).read() + + +def get_version(package): + """ + Return package version as listed in `__version__` in `init.py`. + """ + init_py = open(os.path.join(package, '__init__.py')).read() + return re.search( + "^__version__ = ['\"]([^'\"]+)['\"]", + init_py, re.MULTILINE).group(1) + + +if sys.argv[-1] == 'publish': + os.system("python setup.py sdist upload") + args = {'version': get_version('luxafor')} + print("You probably want to also tag the version now:") + print(" git tag -a %(version)s -m 'version %(version)s'" % args) + print(" git push --tags") + sys.exit() + + +scripts = { + "console_scripts": [ + "luxa=luxafor.cli:cli", + ] +} + +setup( + name='luxafor', + version=get_version('luxafor'), + description='CLI and libraries to interact with luxafor USB leds', + long_description=README, + author='Felipe Martin', + author_email='me@fmartingr.com', + url='https://github.com/fmartingr/pyluxafor', + packages=find_packages(), + install_requires=( + "click>=6.0,<=6.7.99", + "pyusb==1.0.0", + ), + entry_points=scripts, + classifiers=[], +)