From 73c5f540a39fba1c644011ced4402477d6775982 Mon Sep 17 00:00:00 2001 From: Vincent Simonin Date: Thu, 28 May 2026 14:47:32 +0200 Subject: [PATCH] :wrench: Declare dev dependencies in pyproject.toml Group requests-mock, coverage and pylint under [project.optional-dependencies] dev so the project can be set up with a single `pip install -e ".[dev]"`. Update pr_ci.yml to use this instead of ad-hoc pip installs. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/pr_ci.yml | 5 +---- pyproject.toml | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index e81880c..994fbce 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -51,8 +51,7 @@ jobs: - name: Install netbox_docker_plugin Dependencies working-directory: netbox-docker-plugin run: | - pip install . - pip install requests_mock + pip install -e ".[dev]" - name: Install netbox Dependencies working-directory: netbox run: | @@ -61,12 +60,10 @@ jobs: pip install -r requirements.txt -U - name: Run Pylint run: | - pip install pylint pylint --rcfile $(pwd)/netbox-docker-plugin/.pylintrc --init-hook 'import os; import sys; sys.path.append(os.getcwd() + "/netbox/netbox")' $(pwd)/netbox-docker-plugin/netbox_docker_plugin/ - name: Run tests with coverage and edit coverage report working-directory: netbox run: | - python3 -m pip install coverage coverage run --include='*/netbox_docker_plugin/*' netbox/manage.py test netbox_docker_plugin.tests -v 2 coverage report -m coverage xml -o coverage.xml diff --git a/pyproject.toml b/pyproject.toml index 9b50a24..fac40ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,12 @@ classifiers = [ "Programming Language :: Python :: 3", ] keywords = ["netbox", "netbox-plugin", "docker"] +[project.optional-dependencies] +dev = [ + "requests-mock", + "coverage", + "pylint", +] [project.urls] "Homepage" = "https://github.com/SaaShup/netbox-docker-plugin"