From 21e512a2c460367860193f8ebc6f17653d100b34 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Tue, 31 Oct 2023 16:45:12 +0000 Subject: [PATCH 1/4] Update setup.py; fullname and repo url --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 21a4639..594cb1a 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ from setuptools import find_packages, setup setup( - name="netbox_floorplan", + name="netbox-floorplan-plugin", version="0.1.1", author="Tony Nealon", author_email="tony@worksystems.co.nz", description="Netbox Plugin to support graphical floorplans", - url="https://github.com/tbotnz/netbox_floorplan.git", + url="https://github.com/netboxlabs/netbox-floorplan-plugin.git", license="LGPLv3+", install_requires=[], packages=find_packages(), From 9baad4e3b1cec8563ce8c4abfbc712f523e049d8 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Tue, 31 Oct 2023 16:53:09 +0000 Subject: [PATCH 2/4] Create version.py --- netbox_floorplan/version.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 netbox_floorplan/version.py diff --git a/netbox_floorplan/version.py b/netbox_floorplan/version.py new file mode 100644 index 0000000..493f741 --- /dev/null +++ b/netbox_floorplan/version.py @@ -0,0 +1 @@ +__version__ = "0.3.0" From f89210d1b3c5678e9f1e14f37e5fe81330101c14 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Tue, 31 Oct 2023 16:54:46 +0000 Subject: [PATCH 3/4] 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=[], From 048976d70dc1e15f24ce14cb45a16b08c12e82f5 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Tue, 31 Oct 2023 16:56:04 +0000 Subject: [PATCH 4/4] Copy pub-pypi.yml from netbox-bgp --- .github/workflows/pub-pypi.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pub-pypi.yml diff --git a/.github/workflows/pub-pypi.yml b/.github/workflows/pub-pypi.yml new file mode 100644 index 0000000..2b57e7c --- /dev/null +++ b/.github/workflows/pub-pypi.yml @@ -0,0 +1,35 @@ +name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI + +on: + release: + types: [published] + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}