Installation¶
Install Package¶
Clone the repository and install dependencies using conda, then install the package in editable mode with pip:
git clone https://github.com/gantian127/flood_app
cd flood_app
conda install --file=requirements.txt -c conda-forge
pip install -e .
Configure API Key¶
Before deploying, set the API key in flood_app/settings.py.
Generate a new key with:
import secrets
secrets.token_hex(32)
Start the Server¶
start-app --port=80 --host=0.0.0.0
Look at the line containing Serving on to see what host and port the server is running on. Alternatively, you can use the –host and –port options to specify a specific host and port (–help for help).
Development Tools¶
Nox is used to automate testing, linting, and building the documentation. Install it with:
pip install nox
Available sessions:
Command |
Description |
Python versions |
|---|---|---|
|
Run the test suite with coverage report |
3.11, 3.12, 3.13 |
|
Run ruff linter and formatter check |
default |
|
Build the Sphinx HTML documentation |
default |
To run all sessions:
nox
To run a specific session:
nox -s test
nox -s lint
nox -s docs
To run tests against a specific Python version:
nox -s test-3.12