Compare commits

..

3 commits

Author SHA1 Message Date
bronsen
e70af2376b [ci] create woodpecker pipline thing
Some checks failed
ci/woodpecker/push/workflow Pipeline failed
It's gonna break anyway
2024-11-21 19:47:14 +01:00
bronsen
1d44ea830e [settings] Make it more complicated, why not 2024-11-21 19:46:35 +01:00
bronsen
f3bdb36ca8 [requirements] have manage.py ensure requirements are up to date 2024-11-21 19:46:09 +01:00
3 changed files with 35 additions and 2 deletions

11
.woodpecker/workflow.yaml Normal file
View 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

View file

@ -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"]

View file

@ -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)