Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 PRs #45

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PORT_PREFIX=${PORT_PREFIX}
CONTAINER_PREFIX=${USER}

GOOGLE_SHEETS_CLIENT_SECRET=${GOOGLE_SHEETS_CLIENT_SECRET}
57 changes: 57 additions & 0 deletions .devcontainer/python-3.10/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "python-3.10",
"dockerComposeFile": [
"./docker-compose.yml"
],
"service": "python-3.10",
"forwardPorts": [],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/google-sheets",
"remoteEnv": {},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": true
},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {}
},
"updateContentCommand": "bash .devcontainer/setup.sh",
"postCreateCommand": [],
"customizations": {
"vscode": {
"settings": {
"python.linting.enabled": true,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"[python]": {
"editor.defaultFormatter": "ms-python.vscode-pylance"
},
"editor.rulers": [
80
]
},
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-python.vscode-pylance"
]
}
}
}
30 changes: 30 additions & 0 deletions .devcontainer/python-3.10/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
python-3.10: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.10
container_name: $USER-python-3.10-google-sheets
volumes:
- ../../:/workspaces/google-sheets:cached
command: sleep infinity
environment:
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets
env_file:
- ../devcontainer.env
networks:
- google-sheets-network
postgres-google-sheets: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-py39-google-sheets
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: google-sheets
ports:
- "${PORT_PREFIX}5432:5432"
networks:
- google-sheets-network

networks:
google-sheets-network:
name: "${USER}-google-sheets-network"
57 changes: 57 additions & 0 deletions .devcontainer/python-3.11/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "python-3.11",
"dockerComposeFile": [
"./docker-compose.yml"
],
"service": "python-3.11",
"forwardPorts": [],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/google-sheets",
"remoteEnv": {},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": true
},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {}
},
"updateContentCommand": "bash .devcontainer/setup.sh",
"postCreateCommand": [],
"customizations": {
"vscode": {
"settings": {
"python.linting.enabled": true,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"[python]": {
"editor.defaultFormatter": "ms-python.vscode-pylance"
},
"editor.rulers": [
80
]
},
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-python.vscode-pylance"
]
}
}
}
30 changes: 30 additions & 0 deletions .devcontainer/python-3.11/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
python-3.11: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.11
container_name: $USER-python-3.11-google-sheets
volumes:
- ../../:/workspaces/google-sheets:cached
command: sleep infinity
environment:
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets
env_file:
- ../devcontainer.env
networks:
- google-sheets-network
postgres-google-sheets: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-py39-google-sheets
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: google-sheets
ports:
- "${PORT_PREFIX}5432:5432"
networks:
- google-sheets-network

networks:
google-sheets-network:
name: "${USER}-google-sheets-network"
57 changes: 57 additions & 0 deletions .devcontainer/python-3.12/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "python-3.12",
"dockerComposeFile": [
"./docker-compose.yml"
],
"service": "python-3.12",
"forwardPorts": [],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/google-sheets",
"remoteEnv": {},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": true
},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {}
},
"updateContentCommand": "bash .devcontainer/setup.sh",
"postCreateCommand": [],
"customizations": {
"vscode": {
"settings": {
"python.linting.enabled": true,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"[python]": {
"editor.defaultFormatter": "ms-python.vscode-pylance"
},
"editor.rulers": [
80
]
},
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-python.vscode-pylance"
]
}
}
}
30 changes: 30 additions & 0 deletions .devcontainer/python-3.12/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
python-3.12: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.12
container_name: $USER-python-3.12-google-sheets
volumes:
- ../../:/workspaces/google-sheets:cached
command: sleep infinity
environment:
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets
env_file:
- ../devcontainer.env
networks:
- google-sheets-network
postgres-google-sheets: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-py39-google-sheets
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: google-sheets
ports:
- "${PORT_PREFIX}5432:5432"
networks:
- google-sheets-network

networks:
google-sheets-network:
name: "${USER}-google-sheets-network"
57 changes: 57 additions & 0 deletions .devcontainer/python-3.9/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "python-3.9",
"dockerComposeFile": [
"./docker-compose.yml"
],
"service": "python-3.9",
"forwardPorts": [],
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspaces/google-sheets",
"remoteEnv": {},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": true
},
"ghcr.io/devcontainers/features/git-lfs:1": {},
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {}
},
"updateContentCommand": "bash .devcontainer/setup.sh",
"postCreateCommand": [],
"customizations": {
"vscode": {
"settings": {
"python.linting.enabled": true,
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"[python]": {
"editor.defaultFormatter": "ms-python.vscode-pylance"
},
"editor.rulers": [
80
]
},
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-python.vscode-pylance"
]
}
}
}
30 changes: 30 additions & 0 deletions .devcontainer/python-3.9/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

services:
python-3.9: # nosemgrep
image: mcr.microsoft.com/devcontainers/python:3.9
container_name: $USER-python-3.9-google-sheets
volumes:
- ../../:/workspaces/google-sheets:cached
command: sleep infinity
environment:
- DATABASE_URL=postgresql://admin:password@${USER}-postgres-py39-google-sheets:5432/google-sheets
env_file:
- ../devcontainer.env
networks:
- google-sheets-network
postgres-google-sheets: # nosemgrep
image: postgres:latest
container_name: $USER-postgres-py39-google-sheets
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password # pragma: allowlist secret
POSTGRES_DB: google-sheets
ports:
- "${PORT_PREFIX}5432:5432"
networks:
- google-sheets-network

networks:
google-sheets-network:
name: "${USER}-google-sheets-network"
26 changes: 26 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# update pip
pip install --upgrade pip

# install dev packages
pip install -e ".[dev]"

# install pre-commit hook if not installed already
pre-commit install

prisma migrate deploy
prisma generate

echo '{
"web": {
"client_id": "1027914582771-g0bcsn4fhd6a59pp3d4n1ntjc03r1k9s.apps.googleusercontent.com",
"project_id": "captn-sheets-dev",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "'${GOOGLE_SHEETS_CLIENT_SECRET}'",
"redirect_uris": [
"http://localhost:8000/login/callback"
]

}
}' > client_secret.json
Loading
Loading