Skip to content

Commit

Permalink
Add makefile for repo automation
Browse files Browse the repository at this point in the history
  • Loading branch information
enpaul committed Nov 2, 2023
1 parent c916a88 commit 722268c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# netbox-qicklinks makefile

.PHONY: help
# Put it first so that "make" without argument is like "make help"
# Adapted from:
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## List Makefile targets
$(info Makefile documentation)
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'

clean-py:
rm --recursive --force ./dist
rm --recursive --force ./build
rm --recursive --force ./*.egg-info
rm --recursive --force ./**/__pycache__/

clean: clean-py; ## Clean temp build/cache files and directories

wheel: ## Build Python binary distribution wheel package
poetry build --format wheel

source: ## Build Python source distribution package
poetry build --format sdist

test: ## Run the project testsuite(s)
poetry run pre-commit run --all-files

dev: ## Create the local dev environment
poetry install --sync --with dev
poetry run pre-commit install

publish: test wheel source ## Build and upload to pypi (requires $PYPI_API_KEY be set)
@poetry publish --username __token__ --password $(PYPI_API_KEY)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ are tracked on [Github](https://github.com/enpaul/netbox-quicklinks/releases),
and [open a pull request](https://github.com/enpaul/netbox-quicklinks/compare).

Developing this project requires [Python 3.11+](https://www.python.org/downloads/) and
[Poetry 1.5](https://python-poetry.org/docs/#installation) or later.
[Poetry 1.5](https://python-poetry.org/docs/#installation) or later. GNU Make can
optionally be used to quickly setup a local development environment using `make dev`, but
this is not required. See `make help` for other available targets.

In addition, developers will require a development installation of Netbox. See setup
instructions
Expand Down

0 comments on commit 722268c

Please sign in to comment.