1.7 KiB
1.7 KiB
Dependency management
Get Pipenv and checkout the Pipenv Command reference
Install new dependencies
https://pipenv.pypa.io/en/latest/commands/#install
pipenv install mypkg
Spawn a shell with correct python paths
pipenv shell
Exit the shell with exit
Dependency maintenance
Update requirements.txt files including transitive dependencies
pipenv update
NOTE: This is not done today and only a suggestion.
pipenv requirements --exclude-markers > requirements.d/all.txt
pipenv requirements --exclude-markers --dev-only > requirements.d/dev.txt
Verify the updated dependencies don't include any security vulnerabilities
pipenv check
Build locally
- Install
build
(see docs for example viapacman -S python-build
on ArchLinux - Afterwards run the command to generate pip packgases in
dist/
:pyproject-build
NOTE: This is also needed before development because the command generates ./src/nsupdate/_version.py
.
Run locally
- Install dependencies
pipenv install --dev
- Generate
src/nsupdate/_version.py
file by runningpyproject-build
- Create database using
pipenv run ./manage.py migrate
- Create a superuser with
pipenv run ./manage.py createsuperuser
- Run the server with
pipenv run ./manage.py runserver
Lint
Run pylint in error-only mode to check any problems: pipenv run pylint src/nsupdate
NOTE: The project does not use pylint for formatting. Disabling the errors-only
mode in .pylintrc
will show a lot of warnings.