From a6d92b9211a782f5f33879432b9a4fa125ee9c86 Mon Sep 17 00:00:00 2001 From: arodindev Date: Sun, 4 Aug 2024 15:24:38 +0200 Subject: [PATCH] refactor(folder): removed src folder --- .pre-commit-config.yaml | 2 +- bin/run.py | 2 +- docker/.dockerignore | 1 + docker/Dockerfile | 2 +- tests/conftest.py | 2 +- tests/test_api.py | 2 +- {src/todoapp => todoapp}/__init__.py | 0 {src/todoapp => todoapp}/api.py | 0 {src/todoapp => todoapp}/config/__init__.py | 0 {src/todoapp => todoapp}/config/core.py | 0 {src/todoapp => todoapp}/database.py | 0 {src/todoapp => todoapp}/logging_settings.py | 0 {src/todoapp => todoapp}/main.py | 0 {src/todoapp => todoapp}/schemas/__init__.py | 0 {src/todoapp => todoapp}/schemas/health.py | 0 {src/todoapp => todoapp}/schemas/task.py | 0 {src/todoapp => todoapp}/templates/index.html | 0 tox.ini | 6 +++--- 18 files changed, 9 insertions(+), 8 deletions(-) rename {src/todoapp => todoapp}/__init__.py (100%) rename {src/todoapp => todoapp}/api.py (100%) rename {src/todoapp => todoapp}/config/__init__.py (100%) rename {src/todoapp => todoapp}/config/core.py (100%) rename {src/todoapp => todoapp}/database.py (100%) rename {src/todoapp => todoapp}/logging_settings.py (100%) rename {src/todoapp => todoapp}/main.py (100%) rename {src/todoapp => todoapp}/schemas/__init__.py (100%) rename {src/todoapp => todoapp}/schemas/health.py (100%) rename {src/todoapp => todoapp}/schemas/task.py (100%) rename {src/todoapp => todoapp}/templates/index.html (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9306dcd..f54c0e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: rev: v0.991 hooks: - id: mypy - files: ^(src/) + files: ^(todoapp/) args: [--ignore-missing-imports] additional_dependencies: - "pydantic>=1.10.4" diff --git a/bin/run.py b/bin/run.py index 5fe6b9d..0d8b895 100644 --- a/bin/run.py +++ b/bin/run.py @@ -4,7 +4,7 @@ def main(): logger.warning("Running in development mode. Do not run like this in production.") - uvicorn.run("src.todoapp.main:app", host="0.0.0.0", port=8001, log_level="debug") + uvicorn.run("todoapp.main:app", host="0.0.0.0", port=8001, log_level="debug") if __name__ == "__main__": diff --git a/docker/.dockerignore b/docker/.dockerignore index 0290f93..c75e09d 100644 --- a/docker/.dockerignore +++ b/docker/.dockerignore @@ -1,5 +1,6 @@ __pycache__ Dockerfile +docker-compose.yaml tests/ */env* */venv* diff --git a/docker/Dockerfile b/docker/Dockerfile index f92661a..7b53ac3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,6 +30,6 @@ COPY --from=base /tmp/requirements.txt /todoapp/requirements.txt RUN pip install --no-cache-dir --upgrade -r /todoapp/requirements.txt -COPY ./src /todoapp +COPY ./todoapp /todoapp CMD ["uvicorn", "todoapp.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index fb26c53..554e6d9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import pytest from fastapi.testclient import TestClient -from src.todoapp.main import app +from todoapp.main import app @pytest.fixture() diff --git a/tests/test_api.py b/tests/test_api.py index 8615e77..a34d7bb 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,4 +1,4 @@ -from src.todoapp.config.core import settings +from todoapp.config.core import settings def test_health(test_app) -> None: diff --git a/src/todoapp/__init__.py b/todoapp/__init__.py similarity index 100% rename from src/todoapp/__init__.py rename to todoapp/__init__.py diff --git a/src/todoapp/api.py b/todoapp/api.py similarity index 100% rename from src/todoapp/api.py rename to todoapp/api.py diff --git a/src/todoapp/config/__init__.py b/todoapp/config/__init__.py similarity index 100% rename from src/todoapp/config/__init__.py rename to todoapp/config/__init__.py diff --git a/src/todoapp/config/core.py b/todoapp/config/core.py similarity index 100% rename from src/todoapp/config/core.py rename to todoapp/config/core.py diff --git a/src/todoapp/database.py b/todoapp/database.py similarity index 100% rename from src/todoapp/database.py rename to todoapp/database.py diff --git a/src/todoapp/logging_settings.py b/todoapp/logging_settings.py similarity index 100% rename from src/todoapp/logging_settings.py rename to todoapp/logging_settings.py diff --git a/src/todoapp/main.py b/todoapp/main.py similarity index 100% rename from src/todoapp/main.py rename to todoapp/main.py diff --git a/src/todoapp/schemas/__init__.py b/todoapp/schemas/__init__.py similarity index 100% rename from src/todoapp/schemas/__init__.py rename to todoapp/schemas/__init__.py diff --git a/src/todoapp/schemas/health.py b/todoapp/schemas/health.py similarity index 100% rename from src/todoapp/schemas/health.py rename to todoapp/schemas/health.py diff --git a/src/todoapp/schemas/task.py b/todoapp/schemas/task.py similarity index 100% rename from src/todoapp/schemas/task.py rename to todoapp/schemas/task.py diff --git a/src/todoapp/templates/index.html b/todoapp/templates/index.html similarity index 100% rename from src/todoapp/templates/index.html rename to todoapp/templates/index.html diff --git a/tox.ini b/tox.ini index f02a2e2..9f4aa3b 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,6 @@ setenv = commands_pre = poetry install -v --no-interaction --no-root --only dev commands = - poetry run isort src - poetry run ruff check src --fix - poetry run ruff format src \ No newline at end of file + poetry run isort todoapp + poetry run ruff check todoapp --fix + poetry run ruff format todoapp \ No newline at end of file