diff --git a/.github/workflows/pipelinit.python.lint.yaml b/.github/workflows/pipelinit.python.lint.yaml index 35c6916..a051933 100644 --- a/.github/workflows/pipelinit.python.lint.yaml +++ b/.github/workflows/pipelinit.python.lint.yaml @@ -1,4 +1,4 @@ -# Generated with pipelinit 0.1.0-rc.3 +# Generated with pipelinit 0.1.0 # https://pipelinit.com/ name: Lint Python on: @@ -15,7 +15,13 @@ jobs: with: python-version: 3.6.10 + - run: pip install -r requirements.txt + + - run: python -m pip install pip black + + - run: black . --check + - run: isort . -c + # Adapts Flake8 to run with the Black formatter, using the '--ignore' flag to skip incompatibilities errors + # Reference: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?highlight=other%20tools#id1 + - run: flake8 --ignore E203,E501,W503 . - - run: python -m pip install pip flake8 black - - run: black . --check - - run: flake8 --ignore E203,E501,W503 . diff --git a/.github/workflows/pipelinit.python.test.yaml b/.github/workflows/pipelinit.python.test.yaml deleted file mode 100644 index a91a8e5..0000000 --- a/.github/workflows/pipelinit.python.test.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Generated with pipelinit 0.1.0-rc.3 -# https://pipelinit.com/ -name: Test Python -on: - pull_request: - paths: - - "**.py" -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.6.10 - - uses: actions/setup-python@v2 - with: - python-version: 3.6.10 - - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Run Tests - run: | - python manage.py test - \ No newline at end of file diff --git a/.github/workflows/pipelinit.shell.lint.yaml b/.github/workflows/pipelinit.shell.lint.yaml new file mode 100644 index 0000000..8ab6c49 --- /dev/null +++ b/.github/workflows/pipelinit.shell.lint.yaml @@ -0,0 +1,15 @@ +# Generated with pipelinit 0.1.0 +# https://pipelinit.com/ +name: Lint Shell +on: + pull_request: + paths: + - "**.sh" + - "**.bash" +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master diff --git a/api/asgi.py b/api/asgi.py index 4214d20..717defc 100644 --- a/api/asgi.py +++ b/api/asgi.py @@ -11,6 +11,6 @@ from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings") application = get_asgi_application() diff --git a/api/settings.py b/api/settings.py index 02f6553..eb4e0f9 100644 --- a/api/settings.py +++ b/api/settings.py @@ -20,7 +20,7 @@ # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure--asajm9zn7epf5@ugos@708ppfu0=x@o$y15sj3$!g+n62m@is' +SECRET_KEY = "django-insecure--asajm9zn7epf5@ugos@708ppfu0=x@o$y15sj3$!g+n62m@is" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -31,52 +31,52 @@ # Application definition INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", ] MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = 'api.urls' +ROOT_URLCONF = "api.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'api.wsgi.application' +WSGI_APPLICATION = "api.wsgi.application" # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", } } @@ -86,16 +86,16 @@ AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] @@ -103,9 +103,9 @@ # Internationalization # https://docs.djangoproject.com/en/3.2/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = "en-us" -TIME_ZONE = 'UTC' +TIME_ZONE = "UTC" USE_I18N = True @@ -117,9 +117,9 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.2/howto/static-files/ -STATIC_URL = '/static/' +STATIC_URL = "/static/" # Default primary key field type # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/api/urls.py b/api/urls.py index bfe4851..71c1511 100644 --- a/api/urls.py +++ b/api/urls.py @@ -17,5 +17,5 @@ from django.urls import path urlpatterns = [ - path('admin/', admin.site.urls), + path("admin/", admin.site.urls), ] diff --git a/api/wsgi.py b/api/wsgi.py index d115c14..1425265 100644 --- a/api/wsgi.py +++ b/api/wsgi.py @@ -11,6 +11,6 @@ from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings") application = get_wsgi_application() diff --git a/manage.py b/manage.py index 8c45ccf..7fbe893 100755 --- a/manage.py +++ b/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings') + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -18,5 +18,5 @@ def main(): execute_from_command_line(sys.argv) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/requirements.txt b/requirements.txt index 495197d..8c85301 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -django==3.2.7 \ No newline at end of file +flake8 +isort diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..6bcb8f2 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Starting test server" + +python manage.py runserver