You've already forked ansible-netbox-inventory
test: unit tests for config, filters, client and inventory building
pytest suite with mocked NetBox API responses, plus a makefile driving venv setup, tests, linting and formatting.
This commit is contained in:
35
makefile
Normal file
35
makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2026 Bryan Joshua Pedini
|
||||
.PHONY: help dev-environment test lint lint-fix format clean
|
||||
|
||||
VENV ?= .venv
|
||||
PYTHON ?= $(VENV)/bin/python
|
||||
|
||||
help:
|
||||
@echo "Available targets:"
|
||||
@echo " dev-environment create the virtualenv and install dev dependencies"
|
||||
@echo " test run the unit test suite"
|
||||
@echo " lint run ruff checks"
|
||||
@echo " lint-fix run ruff checks and fix what is auto-fixable"
|
||||
@echo " format run the ruff formatter"
|
||||
@echo " clean remove the virtualenv and caches"
|
||||
|
||||
dev-environment:
|
||||
python3 -m venv $(VENV)
|
||||
$(PYTHON) -m pip install --upgrade pip
|
||||
$(PYTHON) -m pip install requests PyYAML pytest responses ruff
|
||||
|
||||
test:
|
||||
$(PYTHON) -m pytest
|
||||
|
||||
lint:
|
||||
$(PYTHON) -m ruff check .
|
||||
|
||||
lint-fix:
|
||||
$(PYTHON) -m ruff check --fix .
|
||||
|
||||
format:
|
||||
$(PYTHON) -m ruff format .
|
||||
|
||||
clean:
|
||||
rm -rf $(VENV) .pytest_cache .ruff_cache __pycache__ tests/__pycache__
|
||||
Reference in New Issue
Block a user