diff --git a/.env.example b/.env.example index 463104b..a0aaf35 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ # --- Project Settings # --- App settings -LITESTAR_APP=src.app:app +LITESTAR_APP=app:app SECRET_KEY=ThisIsNotAProductionSecretKey ENVIRONMENT=dev diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dd188f1..9d77c3f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: - name: Test with coverage if: inputs.coverage - run: pdm run pytest tests --cov=src --cov-report=xml + run: pdm run pytest tests --cov=app --cov-report=xml - uses: actions/upload-artifact@v3 if: inputs.coverage diff --git a/Makefile b/Makefile index 20e1d79..d2d38b8 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ test: ## Run the tests $(PDM_RUN_BIN) pytest tests coverage: ## Run the tests and generate coverage report - $(PDM_RUN_BIN) pytest tests --cov=src + $(PDM_RUN_BIN) pytest tests --cov=app $(PDM_RUN_BIN) coverage html $(PDM_RUN_BIN) coverage xml @@ -84,7 +84,7 @@ docs-clean: ## Dump the existing built docs rm -rf docs/_build docs-serve: docs-clean ## Serve the docs locally - $(PDM_RUN_BIN) $(SPHINXAUTOBUILD) docs docs/_build/ -j auto --watch src --watch docs --watch tests --watch CONTRIBUTING.rst --port 8002 + $(PDM_RUN_BIN) $(SPHINXAUTOBUILD) docs docs/_build/ -j auto --watch app --watch docs --watch tests --watch CONTRIBUTING.rst --port 8002 docs: docs-clean ## Dump the existing built docs and rebuild them $(PDM_RUN_BIN) $(SPHINXBUILD) docs docs/_build/ -E -a -j auto --keep-going diff --git a/pyproject.toml b/pyproject.toml index e1300fb..4c4eddf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,7 +136,7 @@ ignore = [ "RUF012", # Ruff-specific rule - annotated with classvar ] line-length = 120 -src = ["src", "tests"] +src = ["app", "tests"] target-version = "py311" [tool.ruff.pydocstyle] @@ -151,7 +151,7 @@ classmethod-decorators = [ ] [tool.ruff.isort] -known-first-party = ["src", "tests"] +known-first-party = ["app", "tests"] [tool.ruff.per-file-ignores] "tests/**/*.*" = [ diff --git a/railway.json b/railway.json index 3de47ef..7b464b6 100644 --- a/railway.json +++ b/railway.json @@ -4,6 +4,6 @@ "builder": "NIXPACKS" }, "deploy": { - "startCommand": "litestar --app src.app:app run -H 0.0.0.0 -p $PORT" + "startCommand": "litestar --app app:app run -H 0.0.0.0 -p $PORT" } } diff --git a/sonar-project.properties b/sonar-project.properties index 7769813..a7facc4 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,5 +6,5 @@ sonar.exclusions=docs/**/*, tests/**/* sonar.python.coverage.reportPaths=coverage.xml sonar.python.version=3.11, 3.12 sonar.sourceEncoding=UTF-8 -sonar.sources=src +sonar.sources=app sonar.test.inclusions=tests/test_*.py diff --git a/tests/test_app.py b/tests/test_app.py index a1154a8..afd2654 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,6 +1,6 @@ from litestar.testing import TestClient -from src.app import app +from app.app import app def test_sync() -> None: