diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00ef204..27ce08f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,24 +28,25 @@ jobs: env DJANGO_ENV=production python manage.py collectstatic --noinput -v2 - name: Run checks and tests env: - PYTHONWARNINGS: error,ignore::DeprecationWarning:django.utils.version,ignore::DeprecationWarning:django.http.request,ignore::DeprecationWarning:willow.image,ignore::DeprecationWarning:l18n.translation,ignore:::wagtail.core.signals,ignore:::wagtail.documents.models,ignore:::wagtail.admin.signals,ignore:::wagtail.core.models,ignore:::wagtailtrans.urls.translations,ignore:::wagtailtrans.wagtail_hooks - DATABASE_URL: postgresql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres + # https://github.com/open-contracting/digitalbuying/issues/2 + PYTHONWARNINGS: ignore + DATABASE_URL: mysql://root:root@127.0.0.1:${{ job.services.mysql.ports[3306] }}/mysql shell: bash run: | ./manage.py migrate - ./manage.py makemigrations --check --dry-run + ./manage.py makemigrations --check --dry-run base case_studies guidelines modules navigation sponsors streams ./manage.py check --fail-level WARNING - coverage run --source ictcg manage.py test + coverage run --source ictcg,base,case_studies,guidelines,modules,navigation,sponsors,streams manage.py test - uses: coverallsapp/github-action@v2 services: - postgres: - image: postgres:15 + mysql: + image: mysql:8.0 env: - POSTGRES_PASSWORD: postgres + MYSQL_ROOT_PASSWORD: root options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=5 ports: - - 5432/tcp + - 3306/tcp diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5809303..0e2ebfa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,3 +28,7 @@ repos: rev: v16.12.0 hooks: - id: stylelint + additional_dependencies: + - stylelint@16.12.0 + - stylelint-config-standard@36.0.1 + - stylelint-config-standard-scss@14.0.0 diff --git a/README.rst b/README.rst index fc7d274..9ba1c4b 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Setup .. code:: bash - createdb digitalbuyingguide + mysql -u root -e "create database digitalbuying" npm install pip install -r requirements.txt ./manage.py migrate diff --git a/case_studies/apps.py b/case_studies/apps.py new file mode 100644 index 0000000..88f625d --- /dev/null +++ b/case_studies/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ModulesConfig(AppConfig): + name = "case_studies" + default_auto_field = "django.db.models.AutoField" diff --git a/ictcg/settings.py b/ictcg/settings.py index e5b1fc9..d9a6efe 100644 --- a/ictcg/settings.py +++ b/ictcg/settings.py @@ -64,8 +64,6 @@ # https://docs.wagtail.org/en/stable/reference/contrib/legacy_richtext.html "wagtail.contrib.legacy.richtext", "wagtail.core", - # https://docs.wagtail.org/en/v2.14.2/reference/contrib/postgres_search.html#postgres-search - "wagtail.contrib.postgres_search", # https://docs.wagtail.org/en/stable/reference/contrib/settings.html "wagtail.contrib.settings", # https://docs.wagtail.org/en/v5.2.7/reference/contrib/modeladmin/index.html @@ -129,7 +127,7 @@ # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { - "default": dj_database_url.config(default="postgresql:///digitalbuyingguide?application_name=digitalbuyingguide"), + "default": dj_database_url.config(default="mysql://root@127.0.0.1/digitalbuying"), } @@ -287,12 +285,6 @@ # https://docs.wagtail.org/en/stable/releases/3.0.html#other-features BASE_URL = "https://digitalbuying.open-contracting.org" -WAGTAILSEARCH_BACKENDS = { - "default": { - "BACKEND": "wagtail.contrib.postgres_search.backend", - }, -} - # https://wagtailtrans.readthedocs.io/en/latest/settings.html WAGTAILTRANS_HIDE_TRANSLATION_TREES = True diff --git a/modules/apps.py b/modules/apps.py index 2cb9266..c01b01d 100644 --- a/modules/apps.py +++ b/modules/apps.py @@ -3,3 +3,4 @@ class ModulesConfig(AppConfig): name = "modules" + default_auto_field = "django.db.models.AutoField" diff --git a/navigation/apps.py b/navigation/apps.py new file mode 100644 index 0000000..5ae51e3 --- /dev/null +++ b/navigation/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ModulesConfig(AppConfig): + name = "navigation" + default_auto_field = "django.db.models.AutoField" diff --git a/requirements.in b/requirements.in index e4535e9..7be89a0 100644 --- a/requirements.in +++ b/requirements.in @@ -2,8 +2,8 @@ dj-database-url django django-modelcluster django-taggit -psycopg2 +mysqlclient redis[hiredis] sentry-sdk -wagtail==2.11.9 +wagtail<2.16 git+https://github.com/carrotandcompany/wagtailtrans@master#egg=wagtailtrans diff --git a/requirements.txt b/requirements.txt index eeab3e7..33efd99 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ charset-normalizer==3.4.1 # via requests dj-database-url==0.5.0 # via -r requirements.in -django==3.1.14 +django==3.2.25 # via # -r requirements.in # django-filter @@ -48,12 +48,12 @@ idna==3.10 # via requests l18n==2021.3 # via wagtail +mysqlclient==2.2.7 + # via -r requirements.in openpyxl==3.1.5 # via tablib pillow==9.5.0 # via wagtail -psycopg2==2.9.10 - # via -r requirements.in pytz==2024.2 # via # django @@ -75,13 +75,13 @@ sqlparse==0.5.3 # via django tablib==3.6.1 # via wagtail -unidecode==1.3.8 +telepath==0.3.1 # via wagtail urllib3==1.26.20 # via # requests # sentry-sdk -wagtail==2.11.9 +wagtail==2.15.6 # via # -r requirements.in # wagtailtrans diff --git a/requirements_dev.in b/requirements_dev.in index 65c5558..13e2a80 100644 --- a/requirements_dev.in +++ b/requirements_dev.in @@ -1,3 +1,2 @@ -r requirements.txt coverage -psycopg2-binary diff --git a/requirements_dev.txt b/requirements_dev.txt index 48192e8..7bd05e5 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -25,7 +25,7 @@ coverage==7.6.10 # via -r requirements_dev.in dj-database-url==0.5.0 # via -r requirements.txt -django==3.1.14 +django==3.2.25 # via # -r requirements.txt # django-filter @@ -75,6 +75,8 @@ l18n==2021.3 # via # -r requirements.txt # wagtail +mysqlclient==2.2.7 + # via -r requirements.txt openpyxl==3.1.5 # via # -r requirements.txt @@ -83,10 +85,6 @@ pillow==9.5.0 # via # -r requirements.txt # wagtail -psycopg2==2.9.10 - # via -r requirements.txt -psycopg2-binary==2.9.10 - # via -r requirements_dev.in pytz==2024.2 # via # -r requirements.txt @@ -118,7 +116,7 @@ tablib==3.6.1 # via # -r requirements.txt # wagtail -unidecode==1.3.8 +telepath==0.3.1 # via # -r requirements.txt # wagtail @@ -127,7 +125,7 @@ urllib3==1.26.20 # -r requirements.txt # requests # sentry-sdk -wagtail==2.11.9 +wagtail==2.15.6 # via # -r requirements.txt # wagtailtrans diff --git a/sponsors/apps.py b/sponsors/apps.py index bec0db4..9a8c476 100644 --- a/sponsors/apps.py +++ b/sponsors/apps.py @@ -3,3 +3,4 @@ class SponsorsConfig(AppConfig): name = "sponsors" + default_auto_field = "django.db.models.AutoField"