From 7f765f363a9b3078e66b9ba4c4db393dead25beb Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Sun, 6 Sep 2020 15:43:51 +0100 Subject: [PATCH] Prepare pypi packaging --- .gitignore | 1 + config.yaml.example | 8 ++++++++ setup.py | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 .gitignore create mode 100644 config.yaml.example create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/config.yaml.example b/config.yaml.example new file mode 100644 index 0000000..79f45de --- /dev/null +++ b/config.yaml.example @@ -0,0 +1,8 @@ +--- +mqtt: + username: brightuser + password: brightpass + topic: SMART/HILD/xxxxxxxx +influx: + server: localhost + port: 8428 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..575b26f --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +from distutils.core import setup +from glob import glob # Needed for the examples below only + +import setuptools + +from energy_usage import VERSION + +setup( + name="energy-usage", + version=VERSION, + description="Records realtime energy usage from a Glowmarkt MQTT feed into influxdb", + author="Ben Roberts", + author_email="me@benroberts.net", + url="https://gitlab.sihnon.net/ben/energy-usage", + + # Distribute all python packages within this repository except tests + packages=setuptools.find_packages(exclude=['tests*']), + + # If necessary, include non-python files stored in your package + package_data={ + 'energy_usage': ['config_default.yaml'], + }, + + # Executable scripts + # Wrappers will be automatically generated using the correct python shebang + # to run the methods indicated + entry_points={ + 'console_scripts': [ + 'energy-usage=energy_usage.main:main', + ] + }, + + # Extra content like lib directories, config files from outside of the package + data_files=[ + ('/etc/energy-usage/config.yaml.example', ['config.yaml.example']), + ], +)