Skip to content

Commit 0cf7767

Browse files
committed
Changed project name from "mvc_flask_dash" to "app"
1 parent c3303c6 commit 0cf7767

Some content is hidden

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

42 files changed

+68
-111
lines changed

docker-compose.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ services:
66
restart: always
77
hostname: postgres
88
environment:
9-
POSTGRES_USER: ${POSTGRES_USER}
10-
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
11-
POSTGRES_DB: ${POSTGRES_DB}
9+
POSTGRES_USER: ${POSTGRES_USER:-postgres}
10+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
11+
POSTGRES_DB: ${POSTGRES_DB:-postgres}
1212
ports:
13-
- "55432:5432"
13+
- "${POSTGRES_PORT:-5432}:5432"
1414

1515
jaeger:
1616
image: quay.io/jaegertracing/all-in-one:latest
1717
environment:
1818
LOG_LEVEL: debug
1919
COLLECTOR_OTLP_ENABLED: 'true'
2020
ports:
21-
- "58686:16686"
21+
- "${JARGER_WEBUI_PORT:-16686}:16686"
22+
- "${OTLP_EXPORTER_PORT:-4317}:4317"
2223

2324
web:
2425
build:
@@ -38,9 +39,9 @@ services:
3839
OTEL_EXPORTER_OTLP_INSECURE: "true"
3940
# Postgres
4041
POSTGRES_HOST: postgres
41-
POSTGRES_USER: ${POSTGRES_USER}
42-
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
43-
POSTGRES_DB: ${POSTGRES_DB}
42+
POSTGRES_USER: ${POSTGRES_USER:-postgres}
43+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
44+
POSTGRES_DB: ${POSTGRES_DB:-postgres}
4445
links:
4546
- jaeger
4647
- postgres
@@ -52,4 +53,3 @@ services:
5253
- ./README.md:/app/README.md
5354
- ./setup.cfg:/app/setup.cfg
5455
- ./VERSION:/app/VERSION
55-

pyproject.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
4-
5-
[tool.pytest.ini_options]
6-
minversion = "6.0"
7-
addopts = "-ra -q"
8-
log_cli = true
9-
log_cli_level = "INFO"
10-
# asyncio_mode = "auto"

pytest.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[pytest]
2+
minversion = 6.0
3+
addopts = -ra -q
4+
log_cli = true
5+
log_cli_level = INFO
6+
# asyncio_mode = "auto"
7+
env_files =
8+
.env

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ Flask-SQLAlchemy
99
flasgger
1010
botocore
1111
psycopg2-binary
12-
botocore
1312
sqlalchemy-cockroachdb
1413
opentelemetry-sdk-extension-aws
1514
opentelemetry-propagator-aws-xray
16-
opentelemetry-exporter-jaeger
1715
opentelemetry-exporter-otlp
1816
opentelemetry-instrumentation-botocore
1917
opentelemetry-instrumentation-psycopg2
2018
opentelemetry-instrumentation-dbapi
2119
opentelemetry-instrumentation-flask
2220
opentelemetry-instrumentation-logging
2321
pytest
24-
gunicorn
22+
pytest-dotenv

setup.cfg

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,13 @@ where = src
6161

6262
[options.entry_points]
6363
console_scripts =
64-
mvc-flask-dash = mvc_flask_dash:app
64+
mvc-flask-dash = app:app
65+
66+
[tool.pytest]
67+
minversion = 6.0
68+
addopts = -ra -q
69+
log_cli = true
70+
log_cli_level = INFO
71+
# asyncio_mode = "auto"
72+
env_files =
73+
.env
File renamed without changes.

src/mvc_flask_dash/app.py renamed to src/app/__main__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
from opentelemetry.instrumentation.flask import FlaskInstrumentor
77

8-
import mvc_flask_dash.config as config
9-
from mvc_flask_dash.database import create_db, get_migrate
10-
from mvc_flask_dash.controllers.postgres import postgres_controllers
11-
from mvc_flask_dash.views.index import index_views
12-
from mvc_flask_dash.views.dashboards.postgres import init_postgres_dashboard
8+
import app.config as config
9+
from app.database import create_db, get_migrate
10+
from app.controllers.postgres import postgres_controllers
11+
from app.views.index import index_views
12+
from app.views.dashboards.postgres import init_postgres_dashboard
1313
# New views must be imported and added to this list
1414
views = [index_views,
1515
postgres_controllers]
@@ -50,7 +50,7 @@ def create_app():
5050

5151
# Enable flask telemetry
5252
from opentelemetry import trace
53-
from mvc_flask_dash.utils import get_openid_user
53+
from app.utils import get_openid_user
5454
def request_hook(span: trace.get_current_span(), environ: app.wsgi_app):
5555
if span and span.is_recording():
5656
span.set_attribute("enduser.id", get_openid_user())

src/mvc_flask_dash/config.py renamed to src/app/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
args, unknown = parser.parse_known_args()
3333

3434
# Initialize logging
35-
from mvc_flask_dash.logging import init_logger
35+
from app.logging import init_logger
3636
init_logger(args)
3737
# Initialize telemetry
38-
from mvc_flask_dash.telemetry import init_tracer
38+
from app.telemetry import init_tracer
3939
init_tracer(args)
4040

4141
from sqlalchemy.engine import URL
File renamed without changes.

src/mvc_flask_dash/controllers/postgres.py renamed to src/app/controllers/postgres.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from flask import Blueprint, render_template
44
from flask.json import jsonify
55
from flasgger import swag_from
6-
from mvc_flask_dash.utils import get_openid_user
6+
from app.utils import get_openid_user
77

88
TEMPLATE = pkg_resources.resource_filename(__name__, '../views/templates/postgres.html.j2')
99

@@ -16,7 +16,7 @@
1616

1717
from flask_restful import Resource
1818

19-
from mvc_flask_dash.models.postgres import Fakenames
19+
from app.models.postgres import Fakenames
2020

2121
class PostgresApis(Resource):
2222
@staticmethod

0 commit comments

Comments
 (0)