1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sun, 2 Jun 2019 21:07:08 +0200
Subject: Adding a setup.py file
---
setup.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 setup.py
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..40b973b
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,60 @@
+import codecs
+import os
+
+from setuptools import setup, find_packages
+from typing import TYPE_CHECKING, Any
+
+long_desc = """
+Raritan Xerus™ Python client library for JSON-RPC interface
+
+This Python library includes the JSON-RPC interface for interacting with the
+PDU models PX2, PX3, PX4, PXC, PXO, Branch Circuit Monitor BCM2 and EMX, Smart
+Rack Controller and also the Raritan Transfer Switch ATS series and is usable with
+Python3.
+
+The interface gives you the possibility to request current live data from an
+PDU and their sensors but also to set up various data like SMTP, NTP, system
+and asset data.
+"""
+
+# https://packaging.python.org/single_source_version/
+base_dir = os.path.abspath(os.path.dirname(__file__))
+about: dict[str, Any] = {}
+with open(os.path.join(base_dir, "pdu-python-api/raritan", "version.py"), "rb") as file:
+ exec(file.read(), about)
+
+# currently not used
+def read(fname):
+ return codecs.open(os.path.join(base_dir, fname), encoding="utf-8").read()
+
+setup(
+ name = "raritan-json-rpc",
+ version = f"{about['__sdk_version__']}.{about['__sdk_subversion__']}",
+ description = about["__description__"],
+ long_description = long_desc,
+ license = about["__license__"],
+ author = about["__author__"],
+ author_email = about["__email__"],
+ classifiers = [
+ about["__status__"],
+ f"License :: OSI Approved :: {about['__license__']}",
+ "Natural Language :: English",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Topic :: Utilities",
+ ],
+ keywords = "Raritan Xerus™ ATS BCM2 EMX PX2 PX3 PX4 PXC PXO JSON-RPC",
+ url = about["__url__"],
+ packages = find_packages("pdu-python-api"),
+ platforms = "any",
+ package_dir = {"": "pdu-python-api"},
+ install_requires = [
+ "uritools",
+ "zeroconf",
+ ])
|