Patches should be sent to the [email protected] mailing list or included in a merge request on the aurweb repository.
Before sending patches, you are recommended to run flake8
and isort
.
You can add a git hook to do this by installing python-pre-commit
and running
pre-commit install
.
DISCLAIMER: We realise the code doesn't necessarily follow all the rules. This is an attempt to establish a standard coding style for future development.
- All source modified or added within a patchset must maintain equivalent or increased coverage by providing tests that use the functionality
- Please keep your source within an 80 column width
- Use four space indentation
- Use conventional commits
- DRY: Don't Repeat Yourself
- All code should be tested for good and bad cases (see test/README.md)
Test patches that increase coverage in the codebase are always welcome.
We use autoflake
, isort
, black
and flake8
to enforce coding style in a
PEP-8 compliant way. These tools run in GitLab CI using pre-commit
to verify
that any pushed code changes comply with this.
To enable the pre-commit
git hook, install the pre-commit
package either
with pacman
or pip
and then run pre-commit install --install-hooks
. This
will ensure formatting is done before any code is commited to the git
repository.
There are plugins for editors or IDEs which automate this process. Some example plugins:
- tenfyzhong/autoflake.vim
- fisadev/vim-isort
- psf/black
- nvie/vim-flake8
- prabirshrestha/vim-lsp
- dense-analysis/ale
See setup.cfg
, pyproject.toml
and .pre-commit-config.yaml
for tool
specific configurations.
To get started with local development, an instance of aurweb must be brought up. This can be done using the following sections:
There are a number of services aurweb employs to run the application in its entirety:
- ssh
- cron jobs
- starlette/fastapi asgi server
Project structure:
./aurweb
:aurweb
Python package./templates
: Jinja2 templates./docker
: Docker scripts and configuration files
Using Docker, we can run the entire infrastructure in two steps:
# Build the aurweb:latest image
$ docker-compose build
# Start all services in the background
$ docker-compose up -d nginx
docker-compose
services will generate a locally signed root certificate
at ./data/root_ca.crt
. Users can import this into ca-certificates or their
browser if desired.
Accessible services (on the host):
- https://localhost:8444 (python via nginx)
- localhost:13306 (mariadb)
- localhost:16379 (redis)
Docker services, by default, are setup to be hot reloaded when source code is changed.
For detailed setup instructions have a look at TESTING
The INSTALL file describes steps to install the application on bare-metal systems.