From f89210d1b3c5678e9f1e14f37e5fe81330101c14 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Tue, 31 Oct 2023 16:54:46 +0000 Subject: [PATCH] Copy setup.py format from netbox-bgp --- setup.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 594cb1a..fcedad7 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,36 @@ +import codecs +import os.path + from setuptools import find_packages, setup + +with open("README.md", "r") as fh: + long_description = fh.read() + + +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + with codecs.open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") + + setup( name="netbox-floorplan-plugin", - version="0.1.1", + version=get_version('netbox_floorplan/version.py'), author="Tony Nealon", author_email="tony@worksystems.co.nz", description="Netbox Plugin to support graphical floorplans", + long_description=long_description, + long_description_content_type="text/markdown", url="https://github.com/netboxlabs/netbox-floorplan-plugin.git", license="LGPLv3+", install_requires=[],