Update README/CONTRIBUTING Closes #180 (#204)

* Update README/CONTRIBUTING Closes #180

 * Remove duplicated files in docs/develop and copy them from project
   root to there on documentation generation.

* Makefile: Use fastapi to start server, set port to 8503
This commit is contained in:
Dominique Lasserre
2024-11-17 15:27:43 +01:00
committed by GitHub
parent b3914ab16b
commit edfe309a26
6 changed files with 72 additions and 212 deletions

View File

@@ -16,7 +16,7 @@ help:
@echo " docker-build - Rebuild docker image"
@echo " docs - Generate HTML documentation (in build/docs/html/)."
@echo " read-docs - Read HTML documentation in your browser."
@echo " run - Run FastAPI server in the virtual environment (needs install before)."
@echo " run - Run FastAPI production server in the virtual environment."
@echo " run-dev - Run FastAPI development server in the virtual environment (automatically reloads)."
@echo " dist - Create distribution (in dist/)."
@echo " clean - Remove generated documentation, distribution and virtual environment."
@@ -51,6 +51,12 @@ dist: pip
# Target to generate HTML documentation
docs: pip-dev
cp README.md docs/develop/getting_started.md
# remove top level header and coresponding description
sed -i '/^##[^#]/,$$!d' docs/develop/getting_started.md
sed -i "1i\# Getting Started\n" docs/develop/getting_started.md
cp CONTRIBUTING.md docs/develop
sed -i "s/README.md/getting_started.md/g" docs/develop/CONTRIBUTING.md
.venv/bin/sphinx-build -M html docs build/docs
@echo "Documentation generated to build/docs/html/."
@@ -69,11 +75,11 @@ clean:
run:
@echo "Starting FastAPI server, please wait..."
.venv/bin/python -m akkudoktoreos.server.fastapi_server
.venv/bin/fastapi run --port 8503 src/akkudoktoreos/server/fastapi_server.py
run-dev:
@echo "Starting FastAPI development server, please wait..."
.venv/bin/fastapi dev src/akkudoktoreos/server/fastapi_server.py
.venv/bin/fastapi dev --port 8503 src/akkudoktoreos/server/fastapi_server.py
# Target to setup tests.
test-setup: pip-dev
@@ -91,7 +97,7 @@ test-full:
# Target to format code.
format:
pre-commit run --all-files
.venv/bin/pre-commit run --all-files
# Run entire setup on docker
docker-run: