Skip to content

Commit

Permalink
Merge pull request #38 from maykinmedia/feature/update-OAF
Browse files Browse the repository at this point in the history
Feature/update oaf
  • Loading branch information
Coperh authored Jan 3, 2025
2 parents 4d297dd + 675e670 commit fac8e93
Show file tree
Hide file tree
Showing 9 changed files with 602 additions and 229 deletions.
40 changes: 17 additions & 23 deletions bin/compile_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
#!/bin/bash

#!/bin/sh
#
# Compile the dependencies for production, CI and development.
#
# Usage, in the root of the project:
#
# ./bin/compile_dependencies.sh
#
# Any extra flags/arguments passed to this wrapper script are passed down to pip-compile.
# Any extra flags/arguments passed to this wrapper script are passed down to uv pip compile.
# E.g. to update a package:
#
# ./bin/compile_dependencies.sh --upgrade-package django

set -ex

command -v uv || (echo "uv not found on PATH. Install it https://astral.sh/uv" >&2 && exit 1)

cwd="${PWD}"
toplevel=$(git rev-parse --show-toplevel)

cd $toplevel
cd "${toplevel}"

export CUSTOM_COMPILE_COMMAND="./bin/compile_dependencies.sh"
export UV_CUSTOM_COMPILE_COMMAND="./bin/compile_dependencies.sh"

# Base (& prod) deps
pip-compile \
--no-emit-index-url \
--allow-unsafe \
uv pip compile \
--output-file requirements/base.txt \
"$@" \
requirements/base.in

# Dependencies for ci
pip-compile \
--no-emit-index-url \
--allow-unsafe \
# Dependencies for testing
uv pip compile \
--output-file requirements/ci.txt \
"$@" \
requirements/base.txt \
requirements/test-tools.in \
requirements/ci.in

# Dev depedencies
pip-compile \
--no-emit-index-url \
--allow-unsafe \
requirements/test-tools.in

# Dev depedencies - exact same set as CI + some extra tooling
uv pip compile \
--output-file requirements/dev.txt \
"$@" \
requirements/base.txt \
requirements/test-tools.in \
requirements/dev.in

cd "${cwd}"
4 changes: 3 additions & 1 deletion docs/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ Optional
* ``EMAIL_HOST_PASSWORD``: password to connect to the mail server. Defaults to: ``(empty string)``.
* ``EMAIL_USE_TLS``: whether to use TLS or not to connect to the mail server. Should be True if you're changing the ``EMAIL_PORT`` to 487. Defaults to: ``False``.
* ``DEFAULT_FROM_EMAIL``: The default email address from which emails are sent. Defaults to: ``[email protected]``.
* ``LOG_STDOUT``: whether to log to stdout or not. Defaults to: ``False``.
* ``LOG_STDOUT``: whether to log to stdout or not. Defaults to: ``True``.
* ``LOG_LEVEL``: control the verbosity of logging output. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``WARNING``.
* ``LOG_QUERIES``: enable (query) logging at the database backend level. Note that you must also set ``DEBUG=1``, which should be done very sparingly!. Defaults to: ``False``.
* ``LOG_REQUESTS``: enable logging of the outgoing requests. Defaults to: ``False``.
* ``CELERY_LOGLEVEL``: control the verbosity of logging output for celery, independent of ``LOG_LEVEL``. Available values are ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO`` and ``DEBUG``. Defaults to: ``INFO``.
* ``SESSION_COOKIE_AGE``: For how long, in seconds, the session cookie will be valid. Defaults to: ``1209600``.
* ``SESSION_COOKIE_SAMESITE``: The value of the SameSite flag on the session cookie. This flag prevents the cookie from being sent in cross-site requests thus preventing CSRF attacks and making some methods of stealing session cookie impossible.Currently interferes with OIDC. Keep the value set at Lax if used. Defaults to: ``Lax``.
* ``CSRF_COOKIE_SAMESITE``: The value of the SameSite flag on the CSRF cookie. This flag prevents the cookie from being sent in cross-site requests. Defaults to: ``Strict``.
* ``ENVIRONMENT``: An identifier for the environment, displayed in the admin depending on the settings module used and included in the error monitoring (see ``SENTRY_DSN``). The default is set according to ``DJANGO_SETTINGS_MODULE``.
Expand Down
19 changes: 9 additions & 10 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# This file was autogenerated by uv via the following command:
# ./bin/compile_dependencies.sh
#
amqp==5.2.0
# via kombu
ape-pie==0.2.0
Expand Down Expand Up @@ -95,6 +91,7 @@ django==4.2.15
# django-relativedelta
# django-rest-framework-condition
# django-sendfile2
# django-sessionprofile
# django-setup-configuration
# django-simple-certmanager
# django-solo
Expand Down Expand Up @@ -127,7 +124,7 @@ django-filter==24.2
# open-api-framework
django-formtools==2.5.1
# via django-two-factor-auth
django-import-export[xlsx]==4.1.1
django-import-export==4.1.1
# via -r requirements/base.in
django-jsonform==2.22.0
# via
Expand All @@ -153,6 +150,8 @@ django-rest-framework-condition==0.1.1
# via commonground-api-common
django-sendfile2==0.7.1
# via django-privates
django-sessionprofile==3.0.0
# via open-api-framework
django-setup-configuration==0.3.0
# via open-api-framework
django-simple-certmanager==2.3.0
Expand All @@ -164,7 +163,7 @@ django-solo==2.3.0
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-two-factor-auth[phonenumberslite,webauthn]==1.16.0
django-two-factor-auth==1.16.0
# via maykin-2fa
djangorestframework==3.15.2
# via
Expand All @@ -186,7 +185,7 @@ djangorestframework-inclusions==1.2.0
# via open-api-framework
drf-nested-routers==0.94.1
# via commonground-api-common
drf-spectacular[sidecar]==0.27.2
drf-spectacular==0.27.2
# via open-api-framework
drf-spectacular-sidecar==2024.7.1
# via drf-spectacular
Expand Down Expand Up @@ -240,7 +239,7 @@ mozilla-django-oidc-db==0.19.0
# via open-api-framework
notifications-api-common==0.3.1
# via commonground-api-common
open-api-framework==0.8.1
open-api-framework==0.9.1
# via -r requirements/base.in
openpyxl==3.1.5
# via tablib
Expand Down Expand Up @@ -322,7 +321,7 @@ six==1.16.0
# python-dateutil
sqlparse==0.5.1
# via django
tablib[xlsx]==3.5.0
tablib==3.5.0
# via django-import-export
tornado==6.4.1
# via flower
Expand Down
2 changes: 0 additions & 2 deletions requirements/ci.in

This file was deleted.

Loading

0 comments on commit fac8e93

Please sign in to comment.