Skip to content

Commit 2345f66

Browse files
change lib to src
1 parent 1a575e3 commit 2345f66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+177
-177
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ RUN apt-get update && \
1414
apt-get purge -y --auto-remove && \
1515
rm -rf /var/lib/apt/lists/*
1616

17-
COPY ./lib /app/lib
17+
COPY ./src /app/src
1818

19-
CMD ["gunicorn", "-c", "lib/settings/gunicorn.py", "-w", "1", "--threads=2", "-k", "uvicorn.workers.UvicornWorker", "lib.api:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "60"]
19+
CMD ["gunicorn", "-c", "src/settings/gunicorn.py", "-w", "1", "--threads=2", "-k", "uvicorn.workers.UvicornWorker", "src.api:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "60"]

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ format: black ruff
22
lint: flake8 pylint
33

44
black:
5-
black ./lib || true
5+
black ./src || true
66
black ./tests || true
77

88
flake8:
9-
flake8 --ignore E501,E402,F401,W503,C0414 ./lib || true
9+
flake8 --ignore E501,E402,F401,W503,C0414 ./src || true
1010
flake8 --ignore E501,E402,F401,W503,C0414 ./tests || true
1111

1212
pylint:
13-
pylint ./lib || true
13+
pylint ./src || true
1414
pylint ./tests || true
1515

1616
ruff:
17-
ruff check --fix ./lib || true
17+
ruff check --fix ./src || true
1818
ruff check --fix ./tests || true
1919

2020
test:
2121
python3 -m pytest .
2222

2323
dev:
24-
python3 -m uvicorn lib:app --reload --port 3000
24+
python3 -m uvicorn src.app --reload --port 3000
2525

2626
clean:
2727
docker stop infinity-api

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ $ touch .env && echo MONGODB_CONNECTION_STRING="$ConnectionString" > .env
2525
- run docker compose: `docker-compose up --build -d`
2626

2727
### Standalone
28-
- Dev: `python3 -m uvicorn lib:app --reload --port 3000`
29-
- Prod: `gunicorn -k uvicorn.workers.UvicornWorker lib:app -b 0.0.0.0:3000`
28+
- Dev: `python3 -m uvicorn src:app --reload --port 3000`
29+
- Prod: `gunicorn -k uvicorn.workers.UvicornWorker src:app -b 0.0.0.0:3000`
3030

3131
## Project structure
3232
```

lib/controllers/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/repositories/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/__init__.py renamed to src/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# lib/__init__.py
1+
# src.__init__.py
22
import logging
33
import sys
44

@@ -25,6 +25,6 @@ def parse_error(error):
2525
return f"{exc_type}: {exc_obj}"
2626

2727

28-
from lib.api import ( # pylint: disable=wrong-import-position,cyclic-import,useless-import-alias
28+
from src.api import ( # pylint: disable=wrong-import-position,cyclic-import,useless-import-alias
2929
app as app,
3030
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# __main__.py
2-
from lib.api import app
2+
from src.api import app
33

44
if __name__ == '__main__':
55
app.run() # pylint: disable=no-member

lib/api.py renamed to src/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
77
from opentelemetry.instrumentation.requests import RequestsInstrumentor
88

9-
from lib import logger, parse_error
10-
from lib.routes import flight, environment, motor, rocket
11-
from lib.utils import RocketPyGZipMiddleware
9+
from src import logger, parse_error
10+
from src.routes import flight, environment, motor, rocket
11+
from src.utils import RocketPyGZipMiddleware
1212

1313
app = FastAPI(
1414
swagger_ui_parameters={

src/controllers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# src.controllers/__init__.py

lib/controllers/environment.py renamed to src/controllers/environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from lib.controllers.interface import (
1+
from src.controllers.interface import (
22
ControllerInterface,
33
controller_exception_handler,
44
)
5-
from lib.views.environment import EnvironmentSimulation
6-
from lib.models.environment import EnvironmentModel
7-
from lib.services.environment import EnvironmentService
5+
from src.views.environment import EnvironmentSimulation
6+
from src.models.environment import EnvironmentModel
7+
from src.services.environment import EnvironmentService
88

99

1010
class EnvironmentController(ControllerInterface):

0 commit comments

Comments
 (0)