Repository: WhaleJ84/librenms_handler (language: python)

Issue:
specified action to apply only when python file modified



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml
index de81151..56569c7 100644
--- a/.github/workflows/bandit.yml
+++ b/.github/workflows/bandit.yml
@@ -1,10 +1,10 @@
 name: Bandit
+
 'on':
   pull_request:
-  push:
-    branches:
-      - main
-      - ci-test
+    paths:
+      - '**.py'
+
 jobs:
   test:
     name: Bandit
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 4dae43c..801d953 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -12,11 +12,12 @@
 name: "CodeQL"
 
 on:
-  push:
-    branches: [ main ]
   pull_request:
     # The branches below must be a subset of the branches above
-    branches: [ main ]
+    branches:
+      - main
+    paths:
+      - '**.py'
   schedule:
     - cron: '40 9 * * 6'
 
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
index 47c3709..10919a3 100644
--- a/.github/workflows/pylint.yml
+++ b/.github/workflows/pylint.yml
@@ -1,10 +1,10 @@
 name: Pylint
+
 'on':
   pull_request:
-  push:
-    branches:
-      - main
-      - ci-test
+    paths:
+      - '**.py'
+
 jobs:
   test:
     name: Pylint
diff --git a/.pylintrc b/.pylintrc
deleted file mode 100644
index 494c13e..0000000
--- a/.pylintrc
+++ /dev/null
@@ -1,3 +0,0 @@
-[FORMAT]
-max-line-length=120
-min-similarity-lines=5
diff --git a/README.md b/README.md
index 1092faf..918a004 100644
--- a/README.md
+++ b/README.md
@@ -87,13 +87,3 @@ Each function will have its own issue tracked, so you can search to see if imple
 | [Services](https://github.com/WhaleJ84/librenms_handler/projects/11)     | False   |
 | [Switching](https://github.com/WhaleJ84/librenms_handler/projects/7)     | True    |
 | [System](https://github.com/WhaleJ84/librenms_handler/projects/12)       | True    | 
-
-## Collaboration
-
-The project has no complex logic behind it - all you need to do is read the [API docs](https://docs.librenms.org/API/) and follow the existing code structure.
-Sometimes the documentation is not consistent, so providing more information in the docstring is preferred than not explaining arguments.
-
-All code should be formatted by [Black](https://github.com/psf/black) before submission and adhere to [Pylint](https://github.com/PyCQA/pylint) recommendations where reasonable.
-Linting is not absolute; functionality is the priority.
-
-By following these standards, the code should be easy for people from all skill-sets to help out!
diff --git a/pyproject.toml b/pyproject.toml
index 374b58c..572d110 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,3 +4,7 @@ requires = [
     "wheel"
 ]
 build-backend = "setuptools.build_meta"
+
+[tool.pylint.FORMAT]
+max-line-length=120
+min-similarity-lines=5
diff --git a/setup.py b/setup.py
index fb0bb89..3963a3a 100644
--- a/setup.py
+++ b/setup.py
@@ -20,10 +20,10 @@
         "License :: OSI Approved :: MIT License",
     ],
     package_dir={"": "src"},
-    packages=find_packages(where="src"),
+    packages=find_packages(
+        where="src",
+        include="Pipfile"
+    ),
     python_requires=">=3.6",
-    install_requires=[
-        "requests",
-    ]
 )
 


Test patch:
diff --git a/.github/workflows/test-python-publish.yml b/.github/workflows/test-python-publish.yml
new file mode 100644
index 0000000..e28e6cd
--- /dev/null
+++ b/.github/workflows/test-python-publish.yml
@@ -0,0 +1,32 @@
+# This workflow will upload a Python Package using Twine when a release is created
+# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
+
+name: Upload Test Python Package
+
+on:
+  push:
+    tags:
+      - 'v[0-9]+.[0-9]+.[0-9]+-*'
+
+jobs:
+  deploy:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python
+      uses: actions/setup-python@v2
+      with:
+        python-version: '3.x'
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install setuptools 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/*