From 97ec0fdcf06954529681f999e96aaeda46624e6e Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Fri, 5 Apr 2024 15:40:38 -0700 Subject: [PATCH 01/12] General cleanup - pypi publishing (#10) --- .devcontainer/Dockerfile | 12 ++ .devcontainer/devcontainer.json | 44 +++++++ .flake8 | 2 + .github/ISSUE_TEMPLATE/bug_report.md | 30 ----- .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/ISSUE_TEMPLATE/feature_request.md | 20 ---- .github/workflows/publish-pypi.yml | 103 +++++++++++++---- .pre-commit-config.yaml | 62 ++-------- CHANGELOG.md | 5 + CODE_OF_CONDUCT.md | 133 ---------------------- CONTRIBUTING.md | 2 +- README.md | 9 +- mkdocs.yml | 15 +-- netbox_healthcheck_plugin/__init__.py | 2 +- pyproject.toml | 74 ++---------- requirements_dev.txt | 10 +- tests/test_netbox_healthcheck_plugin.py | 1 - 17 files changed, 185 insertions(+), 343 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .flake8 delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 CODE_OF_CONDUCT.md diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..9ba2f5a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/devcontainers/python:3 + +RUN python -m pip install --upgrade pip \ + && python -m pip install 'flit>=3.8.0' + +ENV FLIT_ROOT_INSTALL=1 + +COPY pyproject.toml . +RUN touch README.md \ + && mkdir -p src/python_package \ + && python -m flit install --only-deps --deps develop \ + && rm -r pyproject.toml README.md src diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c4cf1ea --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,44 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda +{ + "name": "Python Environment", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "customizations": { + "vscode": { + "extensions": [ + "editorconfig.editorconfig", + "github.vscode-pull-request-github", + "ms-azuretools.vscode-docker", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.pylint", + "ms-python.isort", + "ms-python.flake8", + "ms-python.black-formatter", + "ms-vsliveshare.vsliveshare", + "ryanluker.vscode-coverage-gutters", + "bungcip.better-toml", + "GitHub.copilot" + ], + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "black-formatter.path": [ + "/usr/local/py-utils/bin/black" + ], + "pylint.path": [ + "/usr/local/py-utils/bin/pylint" + ], + "flake8.path": [ + "/usr/local/py-utils/bin/flake8" + ], + "isort.path": [ + "/usr/local/py-utils/bin/isort" + ] + } + } + }, + "onCreateCommand": "pre-commit install-hooks" +} diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..6deafc2 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 668b9aa..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**NetBox version** -What version of NetBox are you currently running? - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index a25ea21..208d244 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,10 +2,10 @@ blank_issues_enabled: false contact_links: - name: 📖 Contributing Policy - url: https://github.com/netbox_community/netbox_healthcheck_plugin/blob/main/CONTRIBUTING.md + url: https://github.com/netbox-community/netbox-healthcheck-plugin/blob/main/CONTRIBUTING.md about: "Please read through our contributing policy before opening an issue or pull request." - name: ❓ Discussion - url: https://github.com/netbox_community/netbox_healthcheck_plugin/discussions + url: https://github.com/netbox-community/netbox-healthcheck-plugin/discussions about: "If you're just looking for help, try starting a discussion instead." - name: 💬 Community Slack url: https://netdev.chat diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 11fc491..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 16b7f20..4207a4e 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,15 +1,11 @@ -# This workflows 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 +# see: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ +name: Publish Python 🐍 distribution 📦 to PyPI -name: Upload Python Package - -on: - release: - types: [created] +on: push jobs: - deploy: - + build: + name: Build distribution 📦 runs-on: ubuntu-latest steps: @@ -17,15 +13,82 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/netbox-healthcheck-plugin + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + name: >- + Sign the Python 🐍 distribution 📦 with Sigstore + and upload them to GitHub Release + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v1.2.3 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + - name: Upload artifact signatures to GitHub Release env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + '${{ github.ref_name }}' dist/** + --repo '${{ github.repository }}' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47d6177..da4e9c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,62 +3,20 @@ ci: autofix_commit_msg: "style: pre-commit fixes" repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 +- repo: https://github.com/psf/black + rev: 24.3.0 hooks: - - id: check-added-large-files - - id: check-case-conflict - - id: check-merge-conflict - - id: check-symlinks - - id: debug-statements - - id: end-of-file-fixer - - id: mixed-line-ending - - id: requirements-txt-fixer - - id: trailing-whitespace + - id: black + args: [--line-length=120] + language_version: python3.11 - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 +- repo: https://github.com/PyCQA/flake8 + rev: 7.0.0 hooks: - - id: black - # It is recommended to specify the latest version of Python - # supported by your project here, or alternatively use - # pre-commit's default_language_version, see - # https://pre-commit.com/#top_level-default_language_version - language_version: python3.11 + - id: flake8 - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - - - repo: https://github.com/pycqa/flake8 - rev: '6.1.0' - hooks: - - id: flake8 - additional_dependencies: [ - 'flake8-bugbear==23.9.16', - 'flake8-pyproject==1.2.3', - ] - - - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 - hooks: - - id: python-check-blanket-noqa - - id: python-check-blanket-type-ignore - - id: python-no-log-warn - - id: python-no-eval - - id: python-use-type-annotations - - id: rst-backticks - - id: rst-directive-colons - - id: rst-inline-touching-normal - - - repo: https://github.com/mgedmin/check-manifest - rev: "0.47" +- repo: https://github.com/mgedmin/check-manifest + rev: "0.49" hooks: - id: check-manifest stages: [manual] - - - repo: https://github.com/PyCQA/bandit - rev: '1.7.5' - hooks: - - id: bandit diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b2548b..590f772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.2 (2024-04-05) + +* General cleanup + ## 0.1.0 (2023-01-18) * First release on PyPI. + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 9c41a18..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,133 +0,0 @@ - -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[ahanson@netboxlabs.com](mailto:ahanson@netboxlabs.com). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c39794..272e5a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ If you are proposing a feature: ## Get Started! -Ready to contribute? Here's how to set up `netbox_healthcheck_plugin` for local development. +Ready to contribute? Here's how to set up `netbox-healthcheck-plugin` for local development. 1. Fork the `netbox-healthcheck-plugin` repo on GitHub. 2. Clone your fork locally diff --git a/README.md b/README.md index 8bcf783..b5238c3 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # NetBox HealthCheck Plugin +NetBox plugin for HealthCheck. + NetBox provides health check monitors that can be queried to make sure that the service is running in good condition. NetBox exposes metrics at the `/healthcheck` HTTP endpoint, e.g. `https://netbox.local/healthcheck`. It allows monitor conditions via HTTP(S), with responses available in HTML and JSON formats. * Free software: Apache-2.0 -* Documentation: https://netbox-community.github.io/netbox-healthcheck-plugin/. +* Documentation: https://netbox-community.github.io/netbox-healthcheck-plugin/ ## Features @@ -16,7 +18,8 @@ The features the plugin provides should be listed here. | NetBox Version | Plugin Version | |----------------|----------------| -| 3.4 - 3.6 | 0.1.0 | +| 3.4 - 3.7 | 0.1.0 | +| 3.4 - 3.7 | 0.1.2 | ## Installing @@ -40,7 +43,7 @@ Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`, ```python PLUGINS = [ - "netbox_healthcheck_plugin", + 'netbox_healthcheck_plugin' ] PLUGINS_CONFIG = { diff --git a/mkdocs.yml b/mkdocs.yml index b3b9e05..9c18618 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ site_name: NetBox HealthCheck Plugin -site_url: https://arthanson.github.io/netbox_healthcheck_plugin -repo_url: https://github.com/arthanson/netbox_healthcheck_plugin -repo_name: arthanson/netbox_healthcheck_plugin +site_url: https://netbox-community.github.io/netbox-healthcheck-plugin +repo_url: https://github.com/netbox-community/netbox-healthcheck-plugin +repo_name: netbox-community/netbox-healthcheck-plugin #strict: true nav: - Home: index.md @@ -20,9 +20,10 @@ theme: - navigation.instant - navigation.tabs.sticky markdown_extensions: + - attr_list - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.critic - pymdownx.caret - pymdownx.mark @@ -48,7 +49,7 @@ plugins: lang: en - mkdocstrings: watch: - - netbox_healthcheck_plugin + - netbox-healthcheck-plugin extra: social: - icon: fontawesome/brands/twitter @@ -60,7 +61,7 @@ extra: link: https://github.com/netbox-community/cookiecutter-netbox-plugin name: Facebook - icon: fontawesome/brands/github - link: https://github.com/arthanson/netbox_healthcheck_plugin + link: https://github.com/netbox-community/netbox_healthcheck_plugin name: Github - icon: material/email link: "mailto:ahanson@netboxlabs.com" diff --git a/netbox_healthcheck_plugin/__init__.py b/netbox_healthcheck_plugin/__init__.py index 89b0c20..547f723 100644 --- a/netbox_healthcheck_plugin/__init__.py +++ b/netbox_healthcheck_plugin/__init__.py @@ -2,7 +2,7 @@ __author__ = """Arthur Hanson""" __email__ = 'ahanson@netboxlabs.com' -__version__ = '0.1.0' +__version__ = '0.1.2' from extras.plugins import PluginConfig diff --git a/pyproject.toml b/pyproject.toml index b62897d..bed6efa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,11 +2,12 @@ # https://www.python.org/dev/peps/pep-0518/ [build-system] -requires = ["setuptools>=63.2.0", "wheel"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "netbox-healthcheck-plugin" +version = "0.1.2" authors = [ {name = "Arthur Hanson", email = "ahanson@netboxlabs.com"}, ] @@ -18,35 +19,22 @@ classifiers=[ 'Intended Audience :: Developers', 'Natural Language :: English', "Programming Language :: Python :: 3 :: Only", - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ] requires-python = ">=3.8.1" -# dynamic = ["version"] -version = "0.1.1" - -dependencies = [ - 'django-health-check >= 3,<4' -] [project.optional-dependencies] test = [ - "bandit[toml]==1.7.5", - "black==23.3.0", + "black==24.3.0", "check-manifest==0.49", - "flake8-bugbear==23.5.9", "flake8", "flake8-pyproject", - "pre-commit==3.3.1", - "pylint==2.17.4", - "pytest-mock<3.10.1", - "pytest-runner", - "pytest==7.3.1", - "pytest-github-actions-annotate-failures", - "shellcheck-py==0.9.0.2" + "pre-commit==3.7.0", + "pytest==8.1.1", ] [project.urls] @@ -54,54 +42,6 @@ Documentation = "https://github.com/netbox-community/netbox-healthcheck-plugin/b Source = "https://github.com/netbox-community/netbox-healthcheck-plugin" Tracker = "https://github.com/netbox-community/netbox-healthcheck-plugin/issues" -[tool.setuptools] -packages = ["netbox_healthcheck_plugin"] - -[tool.setuptools.package-data] -netbox_healthcheck_plugin = ["templates/**"] - -[tool.bandit] -exclude_dirs = ["build","dist","tests","scripts","docs"] -number = 4 -recursive = true -targets = "netbox_healthcheck_plugin" - [tool.black] line-length = 120 -target_version = ['py38', 'py39', 'py310', 'py311'] - -[tool.isort] -profile = "black" - -[tool.pylint] -max-line-length = 120 - -[tool.flake8] -max-line-length = 120 -exclude = [ - ".eggs", - ".venv", - ".tox", - ".mypy_cache", - ".pytest_cache", - ".vscode", - ".github", - ".git", - "dist", - "docs", - "tests", -] -ignore = [ - "E722", - "B001", - "W503", - "E203", - "D100", # These are all for ignoring missing docstring - "D101", - "D102", - "D103", - "D104", - "D105", - "D106", - "F401" # unused import -] +target_version = ['py39', 'py310', 'py311', 'py312'] diff --git a/requirements_dev.txt b/requirements_dev.txt index f5e7766..24f595e 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,6 +1,4 @@ -black==23.9.1 -bump2version==1.0.1 -flake8==6.1.0 -flit==3.9.0 -isort==5.12.0 -pip==22.2.1 +black==24.3.0 +flake8==7.0.0 +pip==24.0 +check-manifest==0.49 diff --git a/tests/test_netbox_healthcheck_plugin.py b/tests/test_netbox_healthcheck_plugin.py index 8cfc3f6..ae60cf5 100644 --- a/tests/test_netbox_healthcheck_plugin.py +++ b/tests/test_netbox_healthcheck_plugin.py @@ -3,4 +3,3 @@ """Tests for `netbox_healthcheck_plugin` package.""" from netbox_healthcheck_plugin import netbox_healthcheck_plugin - From 6c030de61e41aa8952beffbd38d698153106497b Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 09:43:37 -0700 Subject: [PATCH 02/12] fix dependency --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bed6efa..3f790be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,10 @@ classifiers=[ requires-python = ">=3.8.1" +dependencies = [ + 'django-health-check >= 3,<4' +] + [project.optional-dependencies] test = [ "black==24.3.0", From d62356e24cef22327d48bff2037fe46f5632d0c2 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 09:53:04 -0700 Subject: [PATCH 03/12] update actions --- .github/workflows/publish-pypi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 4207a4e..c806a7a 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -23,7 +23,7 @@ jobs: - name: Build a binary wheel and a source tarball run: python3 -m build - name: Store the distribution packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: python-package-distributions path: dist/ @@ -43,7 +43,7 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ @@ -64,7 +64,7 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ From 8f45d3995e1bc625822bdbe96685274fd5d10ace Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 09:58:08 -0700 Subject: [PATCH 04/12] update actions --- .github/workflows/publish-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index c806a7a..fbc61bc 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install pypa/build From fdf20d3c9fd3e2cc651e2c393b4eedecd90a2747 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:03:00 -0700 Subject: [PATCH 05/12] update actions --- .github/workflows/publish-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index fbc61bc..6cb7d67 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -69,7 +69,7 @@ jobs: name: python-package-distributions path: dist/ - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v1.2.3 + uses: sigstore/gh-action-sigstore-python@v2.1.1 with: inputs: >- ./dist/*.tar.gz From 86c2c4b0e5c7ee3dcb4398af1200c084f0f12d1b Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:12:46 -0700 Subject: [PATCH 06/12] v0.1.3 --- .github/workflows/publish-pypi.yml | 45 +-------------------------- CHANGELOG.md | 4 +++ README.md | 1 + netbox_healthcheck_plugin/__init__.py | 2 +- pyproject.toml | 2 +- 5 files changed, 8 insertions(+), 46 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 6cb7d67..6a9e8ea 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v5.1.0 with: python-version: "3.x" - name: Install pypa/build @@ -49,46 +49,3 @@ jobs: path: dist/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - - github-release: - name: >- - Sign the Python 🐍 distribution 📦 with Sigstore - and upload them to GitHub Release - needs: - - publish-to-pypi - runs-on: ubuntu-latest - - permissions: - contents: write # IMPORTANT: mandatory for making GitHub Releases - id-token: write # IMPORTANT: mandatory for sigstore - - steps: - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v2.1.1 - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - name: Create GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - run: >- - gh release create - '${{ github.ref_name }}' - --repo '${{ github.repository }}' - --notes "" - - name: Upload artifact signatures to GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - # Upload to GitHub Release using the `gh` CLI. - # `dist/` contains the built packages, and the - # sigstore-produced signatures and certificates. - run: >- - gh release upload - '${{ github.ref_name }}' dist/** - --repo '${{ github.repository }}' diff --git a/CHANGELOG.md b/CHANGELOG.md index 590f772..9f2e954 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.2 (2024-04-08) + +* Fix django-health-check dependency in pyproject.toml + ## 0.1.2 (2024-04-05) * General cleanup diff --git a/README.md b/README.md index b5238c3..34a4bf3 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ The features the plugin provides should be listed here. |----------------|----------------| | 3.4 - 3.7 | 0.1.0 | | 3.4 - 3.7 | 0.1.2 | +| 3.4 - 3.7 | 0.1.3 | ## Installing diff --git a/netbox_healthcheck_plugin/__init__.py b/netbox_healthcheck_plugin/__init__.py index 547f723..9fcb4f2 100644 --- a/netbox_healthcheck_plugin/__init__.py +++ b/netbox_healthcheck_plugin/__init__.py @@ -2,7 +2,7 @@ __author__ = """Arthur Hanson""" __email__ = 'ahanson@netboxlabs.com' -__version__ = '0.1.2' +__version__ = '0.1.3' from extras.plugins import PluginConfig diff --git a/pyproject.toml b/pyproject.toml index 3f790be..bb3a703 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-healthcheck-plugin" -version = "0.1.2" +version = "0.1.3" authors = [ {name = "Arthur Hanson", email = "ahanson@netboxlabs.com"}, ] From 800d0d32d409921a84652d99fa726aceb71d34c7 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:25:11 -0700 Subject: [PATCH 07/12] fix templates --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bb3a703..fa435ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,3 +49,6 @@ Tracker = "https://github.com/netbox-community/netbox-healthcheck-plugin/issues" [tool.black] line-length = 120 target_version = ['py39', 'py310', 'py311', 'py312'] + +[tool.setuptools.package-data] +netbox_healthcheck_plugin = ["templates/**"] From 04cd2d9b0c2ce77b8f824c6cb9708ae028c46f0c Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:26:11 -0700 Subject: [PATCH 08/12] v0.1.4 --- netbox_healthcheck_plugin/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_healthcheck_plugin/__init__.py b/netbox_healthcheck_plugin/__init__.py index 9fcb4f2..001a41c 100644 --- a/netbox_healthcheck_plugin/__init__.py +++ b/netbox_healthcheck_plugin/__init__.py @@ -2,7 +2,7 @@ __author__ = """Arthur Hanson""" __email__ = 'ahanson@netboxlabs.com' -__version__ = '0.1.3' +__version__ = '0.1.4' from extras.plugins import PluginConfig diff --git a/pyproject.toml b/pyproject.toml index fa435ef..36b8fcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-healthcheck-plugin" -version = "0.1.3" +version = "0.1.4" authors = [ {name = "Arthur Hanson", email = "ahanson@netboxlabs.com"}, ] From aaf116b82e1c2a2889196ff11c13a252f9389621 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:29:05 -0700 Subject: [PATCH 09/12] v0.1.3 --- netbox_healthcheck_plugin/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_healthcheck_plugin/__init__.py b/netbox_healthcheck_plugin/__init__.py index 001a41c..9fcb4f2 100644 --- a/netbox_healthcheck_plugin/__init__.py +++ b/netbox_healthcheck_plugin/__init__.py @@ -2,7 +2,7 @@ __author__ = """Arthur Hanson""" __email__ = 'ahanson@netboxlabs.com' -__version__ = '0.1.4' +__version__ = '0.1.3' from extras.plugins import PluginConfig diff --git a/pyproject.toml b/pyproject.toml index 36b8fcd..fa435ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-healthcheck-plugin" -version = "0.1.4" +version = "0.1.3" authors = [ {name = "Arthur Hanson", email = "ahanson@netboxlabs.com"}, ] From b8ea8efc1496e6e7fa788c6311a00f9a03e7236b Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:49:38 -0700 Subject: [PATCH 10/12] add templates mainifest --- MANIFEST.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index ca948a2..fc5d3a7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,3 +7,5 @@ recursive-exclude * __pycache__ recursive-exclude * *.py[co] recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif + +graft templates From e0b1096d1f69784bc42903e8c5c0b654bee29949 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 10:58:32 -0700 Subject: [PATCH 11/12] v0.1.4 --- netbox_healthcheck_plugin/__init__.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_healthcheck_plugin/__init__.py b/netbox_healthcheck_plugin/__init__.py index 9fcb4f2..001a41c 100644 --- a/netbox_healthcheck_plugin/__init__.py +++ b/netbox_healthcheck_plugin/__init__.py @@ -2,7 +2,7 @@ __author__ = """Arthur Hanson""" __email__ = 'ahanson@netboxlabs.com' -__version__ = '0.1.3' +__version__ = '0.1.4' from extras.plugins import PluginConfig diff --git a/pyproject.toml b/pyproject.toml index fa435ef..36b8fcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-healthcheck-plugin" -version = "0.1.3" +version = "0.1.4" authors = [ {name = "Arthur Hanson", email = "ahanson@netboxlabs.com"}, ] From 4616c2a36942223e4bfd1968138c2d9f12f24644 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 Apr 2024 11:06:07 -0700 Subject: [PATCH 12/12] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34a4bf3..20701b1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ NetBox plugin for HealthCheck. NetBox provides health check monitors that can be queried to make sure that the service is running in good condition. -NetBox exposes metrics at the `/healthcheck` HTTP endpoint, e.g. `https://netbox.local/healthcheck`. It allows monitor conditions via HTTP(S), with responses available in HTML and JSON formats. +NetBox exposes metrics at the `/healthcheck` HTTP endpoint under the plugin, e.g. `https://netbox.local/plugins/netbox_healthcheck_plugin/healthcheck/`. It allows monitor conditions via HTTP(S), with responses available in HTML and JSON formats. * Free software: Apache-2.0 * Documentation: https://netbox-community.github.io/netbox-healthcheck-plugin/