Repository: WhaleJ84/librenms_handler (language: python)

Issue:
problem with pip3 install
This works:

``pip3 install librenms-handler==0.4.0 --user``

But the latest version has an issue. Where python 3.6.8 won't load the pip3 module.


Discussion / hints:
Is there any output you can provide so I can try to replicate on my end?
Also, after providing error output, could you try `pip3 install --index-url https://test.pypi.org/simple/ --no-deps librenms-handler`? You should get v0.4.2 - let me know if that works.

Fix patch:
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
index 1a03a7b..11a130f 100644
--- a/.github/workflows/python-publish.yml
+++ b/.github/workflows/python-publish.yml
@@ -20,12 +20,12 @@ jobs:
         python-version: '3.x'
     - name: Install dependencies
       run: |
-        python -m pip install --upgrade pip
-        pip install setuptools wheel twine
+        python3 -m pip install --upgrade pip
+        python3 -m pip install build wheel twine
     - name: Build and publish
       env:
         TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
         TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
       run: |
-        python setup.py sdist bdist_wheel
-        twine upload dist/*
+        python3 -m build
+        python3 -m twine upload dist/*
diff --git a/pyproject.toml b/pyproject.toml
index e89202a..a794e3c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,6 +5,27 @@ requires = [
 ]
 build-backend = "setuptools.build_meta"
 
+[project]
+name = "librenms-handler"
+version = "0.4.2"
+authors = [
+    { name="James Whale", email="james@james-whale.com" },
+]
+description = "A Python library to interact with the LibreNMS API (v0)"
+readme = "README.md"
+requires-python = ">=3.6"
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "License :: OSI Approved :: MIT License",
+]
+dependencies = [
+    "requests"
+]
+
+[project.urls]
+"Homepage" = "https://github.com/WhaleJ84/librenms_handler"
+"Bug Tracker" = "https://github.com/WhaleJ84/librenms_handler/issues"
+
 [tool.pylint.FORMAT]
 max-line-length=120
 min-similarity-lines=5
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 0400b37..0000000
--- a/setup.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from setuptools import find_packages, setup
-
-with open("README.md", "r", encoding="utf-8") as fh:
-    long_description = fh.read()
-
-setup(
-    name="librenms-handler",
-    version="0.4.1",
-    author="James Whale",
-    author_email="james@james-whale.com",
-    description="A Python library to interact with the LibreNMS API (v0)",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    url="https://github.com/WhaleJ84/librenms_handler",
-    project_urls={
-        "Bug Tracker": "https://github.com/WhaleJ84/librenms_handler/issues",
-    },
-    classifiers=[
-        "Programming Language :: Python :: 3",
-        "License :: OSI Approved :: MIT License",
-    ],
-    package_dir={"": "src"},
-    packages=find_packages(
-        where="src",
-        include="Pipfile"
-    ),
-    python_requires=">=3.6",
-)
-


Test patch:
diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml
index e28e6cd..66ec281 100644
--- a/.github/workflows/test-python-publish.yml
+++ b/.github/workflows/test-python-publish.yml
@@ -6,7 +6,7 @@ name: Upload Test Python Package
 on:
   push:
     tags:
-      - 'v[0-9]+.[0-9]+.[0-9]+-*'
+      - 'v[0-9]+.[0-9]+.[0-9]+.*'
 
 jobs:
   deploy:
@@ -21,12 +21,12 @@ jobs:
         python-version: '3.x'
     - name: Install dependencies
       run: |
-        python -m pip install --upgrade pip
-        pip install setuptools wheel twine
+        python3 -m pip install --upgrade pip
+        python3 -m pip install build wheel twine
     - name: Build and publish
       env:
         TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
         TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
       run: |
-        python setup.py sdist bdist_wheel
-        twine upload --repository testpypi dist/*
+        python3 -m build
+        python3 -m twine upload --repository testpypi dist/*