Skip to content

Commit 8ec35d3

Browse files
change main.py to __main__.py
1 parent aa5aacc commit 8ec35d3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

backend/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async def client(db_session: AsyncSession) -> AsyncIterator[AsyncClient]:
8383
"""
8484
Async HTTP client with DB session override
8585
"""
86-
from src.main import app
86+
from src.__main__ import app
8787

8888
async def override_get_db():
8989
yield db_session
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
ⒸAngelaMos | 2025
3-
main.py
3+
__main__.py
44
"""
55
import uvicorn
66

@@ -12,7 +12,7 @@
1212

1313
if __name__ == "__main__":
1414
uvicorn.run(
15-
"src.main:app",
15+
"src.__main__:app",
1616
host = settings.HOST,
1717
port = settings.PORT,
1818
reload = settings.RELOAD,

infra/docker/fastapi.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ RUN --mount=type=cache,target=/root/.cache/uv \
3030

3131
EXPOSE 8000
3232

33-
CMD ["sh", "-c", "uv run alembic upgrade head && uv run uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload"]
33+
CMD ["sh", "-c", "uv run alembic upgrade head && uv run uvicorn src.__main__:app --host 0.0.0.0 --port 8000 --reload"]

infra/docker/fastapi.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ EXPOSE 8000
5555
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
5656
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
5757

58-
CMD ["sh", "-c", "alembic upgrade head && gunicorn src.main:app --worker-class uvicorn.workers.UvicornWorker --workers 4 --bind 0.0.0.0:8000 --max-requests 1000 --max-requests-jitter 100 --access-logfile - --error-logfile -"]
58+
CMD ["sh", "-c", "alembic upgrade head && gunicorn src.__main__:app --worker-class uvicorn.workers.UvicornWorker --workers 4 --bind 0.0.0.0:8000 --max-requests 1000 --max-requests-jitter 100 --access-logfile - --error-logfile -"]

0 commit comments

Comments
 (0)