Fix db query for list of geometries since
Add since to geometries endpoint
Make lang code always lower-case
Divide and map. Now. -- the damn project -- helps mappers by dividing some big area into smaller squares that a human can map.
damn_server
provides access to the database via JSON API.
The project is published under AGPLv3 License.
Join the general discussion in the damn-project mailing list. Read the code of conduct and the mailing list etiquette.
Use damn-dev mailing list to send a patch and damn-sec mailing list to report security issues.
This project uses procedural programming paradigm. Please, do not invent new classes.
Write great git commit messages:
When adding feature or hotfix, use Test-driven development (TDD):
tests
directory. Unit test names start with test_...
.python3 -m unittest discover tests
), check that tests fail.You may also need to run integration tests:
api.py
with endpoint, integration.py
with integration test.uvicorn damn_server.api:app --workers 9
.python3 -m unittest tests/integration.py
.Note: Run tests only with no records in the database. All the records from the database are deleted when the tests are finished.
Note: Both tests can be run with PYTHONASYNCIODEBUG=1
before command. It
is recommended to do so, because it shows the Python async debug information.
Note: You can run tests and uvicorn in a virtual environment. You can create a virtual environment with:
python3 -m venv tve
. tve/bin/activate
pip install -r requirements.txt
Note: Coverage report includes the results of the area
, list_of
, new
,
square
, and user
unit tests only.
The damn_server
is API to the database, so you need the database to develop
the damn_server
.
You can install postgresql with postgis extension and use damndb
docker image config files from damn-deploy repository.
Or you can use damndb
docker image from damn-deploy repository:
git clone https://git.sr.ht/~qeef/damn-deploy
cd damn-deploy
sed -i '/POSTGRES_PASSWORD=.*/d' .env
docker-compose up db
Then get the IP address of damndb
:
export DB_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' damndb)
Finally, create virtual environment and run unit tests:
python3 -m venv tve
. tve/bin/activate
pip install -r requirements.txt
PYTHONASYNCIODEBUG=1 python3 -m unittest discover tests
See the Code section to run integrations tests.
The developer's documentation is in docs
directory and generated by the
Sphinx. API documentation is generated autmatically.