Skip to content

Commit

Permalink
Reorganize repo file structure for python code (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdp authored Mar 14, 2024
1 parent 35e3843 commit f4a4750
Show file tree
Hide file tree
Showing 163 changed files with 556 additions and 1,715 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/webviz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ jobs:

- name: 🕵️ Check auto-generated frontend code is in sync with backend
run: |
docker build -f backend.Dockerfile -t backend:latest .
CONTAINER_ID=$(docker run --detach -p 5000:5000 --env UVICORN_PORT=5000 --env UVICORN_ENTRYPOINT=src.backend.primary.main:app --env WEBVIZ_CLIENT_SECRET=0 --env WEBVIZ_SMDA_SUBSCRIPTION_KEY=0 --env WEBVIZ_SMDA_RESOURCE_SCOPE=0 --env WEBVIZ_VDS_HOST_ADDRESS=0 backend:latest)
sleep 5 # Ensure the backend server is up and running exposing /openapi.json
docker build -f ./backend_py/primary/Dockerfile -t backend:latest .
CONTAINER_ID=$(docker run --detach -p 5000:5000 --env UVICORN_PORT=5000 --env WEBVIZ_CLIENT_SECRET=0 --env WEBVIZ_SMDA_SUBSCRIPTION_KEY=0 --env WEBVIZ_SMDA_RESOURCE_SCOPE=0 --env WEBVIZ_VDS_HOST_ADDRESS=0 backend:latest)
sleep 10 # Ensure the backend server is up and running exposing /openapi.json
npm run generate-api --prefix ./frontend
docker stop $CONTAINER_ID
git diff --exit-code ./frontend/src/api || exit 1
Expand All @@ -91,7 +91,7 @@ jobs:
cache: pip

- name: 📦 Install poetry and dependencies
working-directory: ./backend
working-directory: ./backend_py/primary
run: |
pip install --upgrade pip
pip install poetry
Expand All @@ -100,15 +100,16 @@ jobs:
poetry install --with dev
- name: 🕵️ Check code style & linting
working-directory: ./backend
working-directory: ./backend_py/primary
run: |
black --check src/ tests/
pylint src/ tests/
bandit --recursive src/
mypy src/ tests/
set -x
black --check primary/ tests/
pylint primary/ tests/
bandit --recursive primary/
mypy primary/ tests/
- name: 🤖 Run tests
working-directory: ./backend
working-directory: ./backend_py/primary
env:
WEBVIZ_CLIENT_SECRET: 0
WEBVIZ_SMDA_SUBSCRIPTION_KEY: 0
Expand Down Expand Up @@ -148,4 +149,4 @@ jobs:
- name: 🐳 Verify Docker images build
run: |
docker build -f frontend-prod.Dockerfile .
docker build -f backend.Dockerfile .
docker build -f ./backend_py/primary/Dockerfile .
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ dist
.tern-port

# .vscode
.vscode/
**/.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!backend_py/primary/.vscode/launch.json

# playwright results
playwright-report/
Expand All @@ -122,3 +123,6 @@ playwright-report/

# Ignore Jupyter Notebook checkpoints (hidden directories)
.ipynb_checkpoints/

# Python virtual environments
.venv
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"connect": { "host": "localhost", "port": 5678 },
"pathMappings": [
{
"localRoot": "${workspaceFolder}/backend",
"remoteRoot": "/home/appuser/backend"
"localRoot": "${workspaceFolder}/backend_py/primary",
"remoteRoot": "/home/appuser/backend_py/primary"
}
]
},
Expand Down
15 changes: 0 additions & 15 deletions backend.Dockerfile

This file was deleted.

108 changes: 0 additions & 108 deletions backend/src/backend/primary/main.py

This file was deleted.

149 changes: 0 additions & 149 deletions backend/src/backend/primary/user_session_proxy.py

This file was deleted.

21 changes: 0 additions & 21 deletions backend/src/backend/shared_middleware.py

This file was deleted.

Loading

0 comments on commit f4a4750

Please sign in to comment.