From 1c435d5c1e3eb831fbab4b2714bc02bb2e0caba5 Mon Sep 17 00:00:00 2001 From: Florian Eitel Date: Sun, 15 Jan 2023 12:47:06 +0100 Subject: [PATCH] Add DEVELOPMENT.md to list common development commands --- DEVELOPMENT.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 DEVELOPMENT.md diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..645e23c --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,27 @@ +# Build + +1. Install `build` for example via `pacman -S python-build` on ArchLinux + +2. Afterwards run the command to generate pip packgases in `dist/`: `pyproject-build` + +This is also needed before development because the command generates `./src/nsupdate/_version.py`. + +# Run tests + +Tests need to run inside Docker because they depend on bind9 config. + +1. Build the docker image using: `docker build -t nsupdate scripts/docker/` once + +2. Then run tests via `docker run --dns 127.0.0.1 -v $PWD:/app nsupdate` + +# Lint + +Run pylint in error-only mode to check any problems: `pipenv run pylint src/nsupdate` + +# Test locally + +1. Create database using `pipenv run python ./manage.py migrate` + +2. Create a superuser with `pipenv run python ./manage.py createsuperuser` + +2. Run the server with `pipenv run python ./manage.py runserver`