diff --git a/Containerfile b/Containerfile index af1b3ba..8a46d67 100644 --- a/Containerfile +++ b/Containerfile @@ -26,6 +26,6 @@ COPY --from=builder /app/__pypackages__/3.11/lib pkgs/ COPY src/ src/ -CMD ["python", "-m", "uvicorn", "dragonfly_reporter.app:app", "--host", "0.0.0.0"] +CMD ["python", "-m", "uvicorn", "reporter.app:app", "--host", "0.0.0.0"] EXPOSE 8000 diff --git a/src/dragonfly_reporter/__main__.py b/src/dragonfly_reporter/__main__.py deleted file mode 100644 index ca4d428..0000000 --- a/src/dragonfly_reporter/__main__.py +++ /dev/null @@ -1,5 +0,0 @@ -import uvicorn - -from dragonfly_reporter.app import app - -uvicorn.run(app) diff --git a/src/dragonfly_reporter/__init__.py b/src/reporter/__init__.py similarity index 100% rename from src/dragonfly_reporter/__init__.py rename to src/reporter/__init__.py diff --git a/src/reporter/__main__.py b/src/reporter/__main__.py new file mode 100644 index 0000000..cb01fb3 --- /dev/null +++ b/src/reporter/__main__.py @@ -0,0 +1,5 @@ +import uvicorn + +from reporter.app import app + +uvicorn.run(app) diff --git a/src/dragonfly_reporter/app.py b/src/reporter/app.py similarity index 74% rename from src/dragonfly_reporter/app.py rename to src/reporter/app.py index def7a17..89e00bf 100644 --- a/src/dragonfly_reporter/app.py +++ b/src/reporter/app.py @@ -1,8 +1,8 @@ from fastapi import FastAPI -from dragonfly_reporter.http_client import HTTPClientDependency -from dragonfly_reporter.models import Observation -from dragonfly_reporter.observations import send_observation +from reporter.http_client import HTTPClientDependency +from reporter.models import Observation +from reporter.observations import send_observation app = FastAPI() diff --git a/src/dragonfly_reporter/constants.py b/src/reporter/constants.py similarity index 100% rename from src/dragonfly_reporter/constants.py rename to src/reporter/constants.py diff --git a/src/dragonfly_reporter/dependencies/__init__.py b/src/reporter/dependencies/__init__.py similarity index 100% rename from src/dragonfly_reporter/dependencies/__init__.py rename to src/reporter/dependencies/__init__.py diff --git a/src/dragonfly_reporter/dependencies/microsoft_graph_dependencies.py b/src/reporter/dependencies/microsoft_graph_dependencies.py similarity index 90% rename from src/dragonfly_reporter/dependencies/microsoft_graph_dependencies.py rename to src/reporter/dependencies/microsoft_graph_dependencies.py index 0012ae1..307cfaf 100644 --- a/src/dragonfly_reporter/dependencies/microsoft_graph_dependencies.py +++ b/src/reporter/dependencies/microsoft_graph_dependencies.py @@ -3,7 +3,7 @@ from azure.identity.aio import ClientSecretCredential from msgraph import GraphServiceClient -from dragonfly_reporter.constants import Microsoft +from reporter.constants import Microsoft def build_graph_client() -> GraphServiceClient: diff --git a/src/dragonfly_reporter/http_client.py b/src/reporter/http_client.py similarity index 94% rename from src/dragonfly_reporter/http_client.py rename to src/reporter/http_client.py index 572277c..591dd45 100644 --- a/src/dragonfly_reporter/http_client.py +++ b/src/reporter/http_client.py @@ -5,7 +5,7 @@ import httpx from fastapi import Depends -from dragonfly_reporter.constants import PyPI +from reporter.constants import PyPI class BearerAuthentication(httpx.Auth): diff --git a/src/dragonfly_reporter/mailer.py b/src/reporter/mailer.py similarity index 93% rename from src/dragonfly_reporter/mailer.py rename to src/reporter/mailer.py index 4e6626d..b716eca 100644 --- a/src/dragonfly_reporter/mailer.py +++ b/src/reporter/mailer.py @@ -13,7 +13,7 @@ SendMailPostRequestBody, ) -from dragonfly_reporter.constants import Mail +from reporter.constants import Mail logger = getLogger(__name__) @@ -53,5 +53,5 @@ async def send_mail( if attachments is not None: message.attachments = attachments - request_body = SendMailPostRequestBody(message=message) + request_body = SendMailPostRequestBody(message=message) await graph_client.users.by_user_id(Mail.sender).send_mail.post(request_body) diff --git a/src/dragonfly_reporter/models.py b/src/reporter/models.py similarity index 100% rename from src/dragonfly_reporter/models.py rename to src/reporter/models.py diff --git a/src/dragonfly_reporter/observations.py b/src/reporter/observations.py similarity index 87% rename from src/dragonfly_reporter/observations.py rename to src/reporter/observations.py index 5e47f48..42a18a8 100644 --- a/src/dragonfly_reporter/observations.py +++ b/src/reporter/observations.py @@ -3,7 +3,7 @@ import httpx from fastapi.encoders import jsonable_encoder -from dragonfly_reporter.models import Observation +from reporter.models import Observation async def send_observation( diff --git a/tests/conftest.py b/tests/conftest.py index 0abdbb6..de3ca2f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,8 +3,8 @@ import httpx import pytest -from dragonfly_reporter.app import app -from dragonfly_reporter.http_client import http_client +from reporter.app import app +from reporter.http_client import http_client @pytest.fixture(scope="session") diff --git a/tests/test_report.py b/tests/test_report.py index 9de72f1..cd4e69f 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -2,7 +2,7 @@ from fastapi.testclient import TestClient -from dragonfly_reporter.app import app +from reporter.app import app test_client = TestClient(app)