Skip to content

Commit

Permalink
fix root-level files
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Sep 27, 2024
1 parent 5de7be2 commit 0ac1c42
Show file tree
Hide file tree
Showing 17 changed files with 133 additions and 2,263 deletions.
13 changes: 13 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/Pipfile
/Pipfile.lock
/manage.py
/.devcontainer.json
/.github
/.venv
/.vscode
/.gitignore
/codecov.yml
/*.toml
/*.code-*
/*.md
/scripts
12 changes: 6 additions & 6 deletions api/Pipfile → Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ name = "pypi"
# 5. Run `pipenv install --dev` in your terminal.

[packages]
codeforlife = {ref = "v0.8.3", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}
# 🚫 Don't add [packages] below that are inhertited from the CFL package
codeforlife = {ref = "v0.18.14", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}
# 🚫 Don't add [packages] below that are inherited from the CFL package.

[dev-packages]
codeforlife = {ref = "v0.8.3", git = "https://github.com/ocadotechnology/codeforlife-package-python.git", extras = ["dev"]}
# codeforlife = {file = "../../codeforlife-package-python", editable = true, extras = ["dev"]}
# 🚫 Don't add [dev-packages] below that are inhertited from the CFL package.
codeforlife = {ref = "v0.18.14", git = "https://github.com/ocadotechnology/codeforlife-package-python.git", extras = ["dev"]}
# codeforlife = {file = "../codeforlife-package-python", editable = true, extras = ["dev"]}
# 🚫 Don't add [dev-packages] below that are inherited from the CFL package.

[requires]
python_version = "3.8"
python_version = "3.12"
4 changes: 0 additions & 4 deletions api/.gcloudignore

This file was deleted.

2,104 changes: 0 additions & 2,104 deletions api/Pipfile.lock

This file was deleted.

15 changes: 0 additions & 15 deletions api/app.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions api/main.py

This file was deleted.

30 changes: 0 additions & 30 deletions api/pyproject.toml

This file was deleted.

84 changes: 0 additions & 84 deletions api/service/settings.py

This file was deleted.

18 changes: 18 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://cloud.google.com/appengine/docs/standard/reference/app-yaml?tab=python

runtime: REPLACE_IN_PIPELINE
instance_class: F1
service: REPLACE_IN_PIPELINE

inbound_services:
- warmup

env_variables:
DEBUG: "0"
DJANGO_SETTINGS_MODULE: "settings"
SECRET_KEY: "REPLACE_IN_PIPELINE"
SERVICE_NAME: "REPLACE_IN_PIPELINE"
SERVICE_PROTOCOL: "https"
SERVICE_DOMAIN: "codeforlife.education"
SERVICE_PORT: "443"
MAIL_ENABLED: "1"
16 changes: 16 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
© Ocado Group
Created on 11/04/2024 at 16:51:45(+01:00).
The entrypoint to our app.
https://cloud.google.com/appengine/docs/standard/python3/runtime#application_startup
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

app = get_wsgi_application()
3 changes: 2 additions & 1 deletion api/manage.py → manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "service.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
try:
# pylint: disable-next=import-outside-toplevel
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
Expand Down
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.black]
line-length = 80
extend-exclude = ".*/migrations/.*py"

[tool.pytest.ini_options]
env = ["DJANGO_SETTINGS_MODULE=settings", "SERVICE_NAME=sso"]

[tool.mypy]
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
check_untyped_defs = true
disable_error_code = ["dict-item"]
mypy_path = "../codeforlife-package-python"

[tool.django-stubs]
django_settings_module = "settings"

[tool.pylint.main]
init-hook = "import os; os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')"
disable = ["fixme"]

[tool.pylint.format]
max-line-length = 80

[tool.pylint.MASTER]
ignore-paths = [".*/migrations/.*.py"]
load-plugins = "pylint_django"
django-settings-module = "settings"

[tool.isort]
profile = "black"
line_length = 80
skip_glob = ["**/migrations/*.py"]

[tool.coverage.run]
omit = ["*/test_*.py", "*/*_test.py", "main.py", "manage.py"]
16 changes: 0 additions & 16 deletions run

This file was deleted.

6 changes: 6 additions & 0 deletions scripts/hard-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

cd "${BASH_SOURCE%/*}/.."

wget -O - https://raw.githubusercontent.com/ocadotechnology/codeforlife-workspace/main/scripts/backend/hard-install | bash
6 changes: 6 additions & 0 deletions scripts/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

cd "${BASH_SOURCE%/*}/.."

wget -O - https://raw.githubusercontent.com/ocadotechnology/codeforlife-workspace/main/scripts/backend/run | SERVICE_NAME=sso bash
6 changes: 6 additions & 0 deletions scripts/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

cd "${BASH_SOURCE%/*}/.."

wget -O - https://raw.githubusercontent.com/ocadotechnology/codeforlife-workspace/main/scripts/backend/setup | SERVICE_NAME=sso bash
25 changes: 25 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
© Ocado Group
Created on 04/07/2024 at 11:42:00(+01:00).
Django settings for api.
Generated by 'django-admin startproject' using Django 3.2.18.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

from pathlib import Path

# pylint: disable-next=wildcard-import,unused-wildcard-import
from codeforlife.settings import *

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent

DATABASES = get_databases(BASE_DIR)
STATIC_ROOT = get_static_root(BASE_DIR)

0 comments on commit 0ac1c42

Please sign in to comment.