Compare commits
3 commits
77512fc73c
...
e70af2376b
Author | SHA1 | Date | |
---|---|---|---|
|
e70af2376b | ||
|
1d44ea830e | ||
|
f3bdb36ca8 |
3 changed files with 35 additions and 2 deletions
11
.woodpecker/workflow.yaml
Normal file
11
.woodpecker/workflow.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
when:
|
||||
- event: push
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
- name: lint-and-test
|
||||
image: debian
|
||||
commands:
|
||||
- pip install -r requirements/test.txt
|
||||
- ruff check src
|
||||
- python -m pytest
|
|
@ -4,6 +4,15 @@ from configurations import Configuration
|
|||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
class EnableDebug(Configuration):
|
||||
"""
|
||||
Intended as a MIXIN
|
||||
"""
|
||||
|
||||
DEBUG = True
|
||||
INSTALLED_APPS = Configuration.INSTALLED_APPS + ["django_debug_toolbar"]
|
||||
|
||||
|
||||
class Base(Configuration):
|
||||
DEBUG = False
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
|
@ -22,7 +31,7 @@ class Base(Configuration):
|
|||
USE_TZ = True
|
||||
|
||||
|
||||
class Dev(Base):
|
||||
class Dev(EnableDebug, Base):
|
||||
# Dangerous: disable host header validation
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
DATABASES = {
|
||||
|
@ -31,7 +40,6 @@ class Dev(Base):
|
|||
"NAME": "db.sqlite3",
|
||||
},
|
||||
}
|
||||
DEBUG = True
|
||||
INSTALLED_APPS = Base.INSTALLED_APPS + ["django_extensions"]
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -11,6 +12,19 @@ def main():
|
|||
|
||||
from configurations.management import execute_from_command_line
|
||||
|
||||
try:
|
||||
import pip_lock
|
||||
except ModuleNotFoundError:
|
||||
raise ModuleNotFoundError(
|
||||
"Couldn't import pip-lock. Are you on the right virtualenv and up to date?"
|
||||
)
|
||||
|
||||
requirements_path = str(Path(__file__).parent.parent / "requirements/base.txt")
|
||||
pip_lock.check_requirements(
|
||||
requirements_path,
|
||||
post_text="\nRun the following:\n\npython -m pip install -r requirements/base.txt\n",
|
||||
)
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue