From fe382783c0f32e7af364461e8b5fbf62ddddccf0 Mon Sep 17 00:00:00 2001 From: chapeau Date: Fri, 8 Mar 2024 10:05:24 +0100 Subject: [PATCH 1/4] Update dockerfile structure --- Dockerfile | 22 +++++++++++++++++++--- docker-compose.yml | 4 +++- docker/docker-entrypoint.sh | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index de4a1757..90770e49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,25 @@ -FROM python:3.9-bullseye +FROM python:3.9-bullseye AS base ENV PYTHONUNBUFFERED=1 RUN pip install poetry WORKDIR /code -RUN apt-get update && apt-get install -y --no-install-recommends gettext-base libpq-dev +RUN apt-get update && apt-get install -y --no-install-recommends gettext-base libpq-dev graphviz COPY pyproject.toml poetry.lock /code/ RUN poetry install --with dev --extras "postgresql" COPY . /code/ -CMD ./docker/docker-entrypoint.sh \ No newline at end of file +CMD ./docker/docker-entrypoint.sh + +FROM base AS ldap +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y --no-install-recommends libldap-dev slapd libsasl2-dev + +FROM base AS mysql +RUN poetry install --with dev --extras "mysql" + +FROM base AS postgres +RUN poetry install --with dev --extras "postgresql" + +FROM ldap AS mysql-ldap +RUN poetry install --with dev --extras "mysql ldap" + +FROM ldap AS postgres-ldap +RUN poetry install --with dev --extras "postgresql ldap" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f9ea6440..e27b711d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,9 @@ services: - POSTGRES_PASSWORD=postgres re2o: - build: . + build: + context: . + target: postgres volumes: - .:/code ports: diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 3b0a395d..e80a8a5e 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -12,6 +12,9 @@ if [ "$AUTOMIGRATE" != "skip" ]; then poetry run python manage.py migrate --noinput fi +poetry run python manage.py collectstatic +poetry run python manage.py compilemessages + cat < Date: Fri, 8 Mar 2024 10:21:00 +0100 Subject: [PATCH 2/4] Change how the dev docker uses local_settings and activate tests in CI --- .gitlab-ci.yml | 40 ++- dev-requirements.txt | 26 +- docker-compose.yml | 3 +- docker/docker-entrypoint.sh | 2 - ldap-requirements.txt | 15 +- mysql-requirements.txt | 15 +- poetry.lock | 275 ++++++++++++------ postgresql-requirements.txt | 15 +- preferences/views.py | 2 +- pyproject.toml | 5 + re2o/context_processors.py | 2 +- re2o/settings.py | 11 +- .../settings_local_dev.py | 28 +- re2o/urls.py | 2 +- re2o/views.py | 2 +- requirements.txt | 15 +- update_req.sh | 10 + 17 files changed, 316 insertions(+), 152 deletions(-) rename docker/settings_local.template.py => re2o/settings_local_dev.py (77%) create mode 100755 update_req.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe6b3eb5..be80af5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,34 @@ --- -image: debian:bullseye +variables: + DOCKER_TLS_CERTDIR: "/certs" + stages: - lint + - build + +build: + image: docker:24.0.5 + services: + - docker:24.0.5-dind + stage: build + variables: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + SUPERUSER_LOGIN: admin + SUPERUSER_PASS: admin + SUPERUSER_EMAIL: admin@example.net + ENV: dev + script: + # - docker build -t re2o . --target=postgres + - cp -n cotisations/templates/cotisations/invoice.html templates/default_invoice.html + - cp -n cotisations/templates/cotisations/voucher.html templates/default_voucher.html + - docker compose run --build re2o poetry run python manage.py test lint: + image: python:3 stage: lint - variables: - LANG: 'en_US.UTF-8' - LC_ALL: 'en_US.UTF-8' - LANGUAGE: 'en_US.UTF-8' script: - - apt-get -qq update - - DEBIAN_FRONTEND=noninteractive apt-get -qq install -y locales python3-django python3-pylint-django - - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 - - pylint --load-plugins pylint_django cotisations machines re2o logs topologie preferences search users || if [ $? -ne 1 ]; then exit 0; else exit 1; fi - - - - + - pip install poetry + - poetry install --extras "lint" + - poetry run pylint --load-plugins pylint_django cotisations machines re2o logs topologie preferences search users || if [ $? -ne 1 ]; then exit 0; else exit 1; fi diff --git a/dev-requirements.txt b/dev-requirements.txt index 1f3be05f..89da7573 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -182,7 +182,7 @@ charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4.0" \ click==8.1.7 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de -colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "win32" or python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows" \ +colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows") \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 coverage==5.5 ; python_version >= "3.8" and python_version < "4" \ @@ -314,9 +314,9 @@ idna==3.6 ; python_version >= "3.8" and python_version < "4.0" \ imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ --hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a -importlib-resources==6.1.2 ; python_version >= "3.8" and python_version < "3.9" \ - --hash=sha256:308abf8474e2dba5f867d279237cd4076482c3de7104a40b41426370e891549b \ - --hash=sha256:9a0a862501dc38b68adebc82970140c9e4209fc99601782925178f8386339938 +importlib-resources==6.1.3 ; python_version >= "3.8" and python_version < "3.9" \ + --hash=sha256:4c0269e3580fe2634d364b39b38b961540a7738c02cb984e98add8b4221d793d \ + --hash=sha256:56fb4525197b78544a3354ea27793952ab93f935bb4bf746b846bb1015020f2b jinja2==3.1.3 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \ --hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90 @@ -559,12 +559,12 @@ pygments==2.17.2 ; python_version >= "3.8" and python_version < "4.0" \ pyhanko-certvalidator==0.26.3 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:47fba8e9dbf846d766f2e0a453572dd4b25b2f1397847a31fe892c8eb00391f5 \ --hash=sha256:e386c87e202ff1caacf5fd941da6c3509e79db54dbd7b43c6550ceebe5e67077 -pyhanko==0.21.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0a4de2c26a55c85ee6da79fc995a7fc6a61b7520270f03251caf8977ba27ccb8 \ - --hash=sha256:e5609fb8a0b8d60168999cffaa382f0361066cb429204ad2b76e84e6e7f5eb93 -pypdf==4.0.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:3316d9ddfcff5df67ae3cdfe8b945c432aa43e7f970bae7c2a4ab4fe129cd937 \ - --hash=sha256:a62daa2a24d5a608ba1b6284dde185317ce3644f89b9ebe5314d0c5d1c9f257d +pyhanko==0.22.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:7a8d50889440c435ba5e41f46c633518effa218dc76e2f88869c9e8a731b7234 \ + --hash=sha256:af2350222d011995668f462ac03378854c4d56bb684910fe9065e634dd7a6908 +pypdf==4.1.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:01c3257ec908676efd60a4537e525b89d48e0852bc92b4e0aa4cc646feda17cc \ + --hash=sha256:16cac912a05200099cef3f347c4c7e0aaf0a6d027603b8f9a973c0ea500dff89 pypng==0.20220715.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:4a43e969b8f5aaafb2a415536c1a8ec7e341cd6a3f957fd5b5f32a4cfeed902c \ --hash=sha256:739c433ba96f078315de54c0db975aee537cbc3e1d0ae4ed9aab0ca1e427e2c1 @@ -574,6 +574,9 @@ python-bidi==0.4.2 ; python_version >= "3.8" and python_version < "4.0" \ python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 +python-decouple==3.8 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f \ + --hash=sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66 pytz==2024.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 \ --hash=sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319 @@ -875,6 +878,9 @@ uritools==4.0.2 ; python_version >= "3.8" and python_version < "4.0" \ urllib3==2.2.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \ --hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19 +volatildap==1.5.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:3d9c9cc39cfed706b9a3da3bc3a2f369987807e4d4eaaddf313a994cf8a77f3c \ + --hash=sha256:732dfc459dd49c75e9e13e1c7bf96cb33a835d4ee7c9716205fae3fcaee6b9e5 webencodings==0.5.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \ --hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923 diff --git a/docker-compose.yml b/docker-compose.yml index e27b711d..deb29c0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,4 +30,5 @@ services: - POSTGRES_PASSWORD=postgres - SUPERUSER_LOGIN=admin - SUPERUSER_PASS=admin - - SUPERUSER_EMAIL=admin@example.net \ No newline at end of file + - SUPERUSER_EMAIL=admin@example.net + - ENV=dev \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index e80a8a5e..5a098bbf 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,8 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -cat docker/settings_local.template.py | envsubst > re2o/settings_local.py - cp -n cotisations/templates/cotisations/invoice.html templates/default_invoice.html cp -n cotisations/templates/cotisations/voucher.html templates/default_voucher.html diff --git a/ldap-requirements.txt b/ldap-requirements.txt index 3224c042..626f9aad 100644 --- a/ldap-requirements.txt +++ b/ldap-requirements.txt @@ -416,12 +416,12 @@ pycryptodome==3.20.0 ; python_version >= "3.8" and python_version < "4.0" \ pyhanko-certvalidator==0.26.3 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:47fba8e9dbf846d766f2e0a453572dd4b25b2f1397847a31fe892c8eb00391f5 \ --hash=sha256:e386c87e202ff1caacf5fd941da6c3509e79db54dbd7b43c6550ceebe5e67077 -pyhanko==0.21.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0a4de2c26a55c85ee6da79fc995a7fc6a61b7520270f03251caf8977ba27ccb8 \ - --hash=sha256:e5609fb8a0b8d60168999cffaa382f0361066cb429204ad2b76e84e6e7f5eb93 -pypdf==4.0.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:3316d9ddfcff5df67ae3cdfe8b945c432aa43e7f970bae7c2a4ab4fe129cd937 \ - --hash=sha256:a62daa2a24d5a608ba1b6284dde185317ce3644f89b9ebe5314d0c5d1c9f257d +pyhanko==0.22.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:7a8d50889440c435ba5e41f46c633518effa218dc76e2f88869c9e8a731b7234 \ + --hash=sha256:af2350222d011995668f462ac03378854c4d56bb684910fe9065e634dd7a6908 +pypdf==4.1.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:01c3257ec908676efd60a4537e525b89d48e0852bc92b4e0aa4cc646feda17cc \ + --hash=sha256:16cac912a05200099cef3f347c4c7e0aaf0a6d027603b8f9a973c0ea500dff89 pypng==0.20220715.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:4a43e969b8f5aaafb2a415536c1a8ec7e341cd6a3f957fd5b5f32a4cfeed902c \ --hash=sha256:739c433ba96f078315de54c0db975aee537cbc3e1d0ae4ed9aab0ca1e427e2c1 @@ -431,6 +431,9 @@ python-bidi==0.4.2 ; python_version >= "3.8" and python_version < "4.0" \ python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 +python-decouple==3.8 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f \ + --hash=sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66 python-ldap==3.4.4 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:7edb0accec4e037797705f3a05cbf36a9fde50d08c8f67f2aef99a2628fab828 pytz==2024.1 ; python_version >= "3.8" and python_version < "4.0" \ diff --git a/mysql-requirements.txt b/mysql-requirements.txt index c7e17e3a..20fec501 100644 --- a/mysql-requirements.txt +++ b/mysql-requirements.txt @@ -417,12 +417,12 @@ pycryptodome==3.20.0 ; python_version >= "3.8" and python_version < "4.0" \ pyhanko-certvalidator==0.26.3 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:47fba8e9dbf846d766f2e0a453572dd4b25b2f1397847a31fe892c8eb00391f5 \ --hash=sha256:e386c87e202ff1caacf5fd941da6c3509e79db54dbd7b43c6550ceebe5e67077 -pyhanko==0.21.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0a4de2c26a55c85ee6da79fc995a7fc6a61b7520270f03251caf8977ba27ccb8 \ - --hash=sha256:e5609fb8a0b8d60168999cffaa382f0361066cb429204ad2b76e84e6e7f5eb93 -pypdf==4.0.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:3316d9ddfcff5df67ae3cdfe8b945c432aa43e7f970bae7c2a4ab4fe129cd937 \ - --hash=sha256:a62daa2a24d5a608ba1b6284dde185317ce3644f89b9ebe5314d0c5d1c9f257d +pyhanko==0.22.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:7a8d50889440c435ba5e41f46c633518effa218dc76e2f88869c9e8a731b7234 \ + --hash=sha256:af2350222d011995668f462ac03378854c4d56bb684910fe9065e634dd7a6908 +pypdf==4.1.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:01c3257ec908676efd60a4537e525b89d48e0852bc92b4e0aa4cc646feda17cc \ + --hash=sha256:16cac912a05200099cef3f347c4c7e0aaf0a6d027603b8f9a973c0ea500dff89 pypng==0.20220715.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:4a43e969b8f5aaafb2a415536c1a8ec7e341cd6a3f957fd5b5f32a4cfeed902c \ --hash=sha256:739c433ba96f078315de54c0db975aee537cbc3e1d0ae4ed9aab0ca1e427e2c1 @@ -432,6 +432,9 @@ python-bidi==0.4.2 ; python_version >= "3.8" and python_version < "4.0" \ python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 +python-decouple==3.8 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f \ + --hash=sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66 pytz==2024.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 \ --hash=sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319 diff --git a/poetry.lock b/poetry.lock index c0dfd97a..f0704164 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "alabaster" version = "0.7.13" description = "A configurable sidebar-enabled Sphinx theme" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -16,7 +15,6 @@ files = [ name = "appdirs" version = "1.4.4" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = "*" files = [ @@ -28,7 +26,6 @@ files = [ name = "arabic-reshaper" version = "3.0.0" description = "Reconstruct Arabic sentences to be used in applications that do not support Arabic" -category = "main" optional = false python-versions = "*" files = [ @@ -43,7 +40,6 @@ with-fonttools = ["fonttools (>=4.0)"] name = "asn1crypto" version = "1.5.1" description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" -category = "main" optional = false python-versions = "*" files = [ @@ -51,11 +47,24 @@ files = [ {file = "asn1crypto-1.5.1.tar.gz", hash = "sha256:13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c805306ccb9c"}, ] +[[package]] +name = "astroid" +version = "3.1.0" +description = "An abstract syntax tree for Python with inference support." +optional = true +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.1.0-py3-none-any.whl", hash = "sha256:951798f922990137ac090c53af473db7ab4e70c770e6d7fae0cec59f74411819"}, + {file = "astroid-3.1.0.tar.gz", hash = "sha256:ac248253bfa4bd924a0de213707e7ebeeb3138abeb48d798784ead1e56d419d4"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + [[package]] name = "babel" version = "2.14.0" description = "Internationalization utilities" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -73,7 +82,6 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] name = "backports-zoneinfo" version = "0.2.1" description = "Backport of the standard library zoneinfo module" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -102,7 +110,6 @@ tzdata = ["tzdata"] name = "black" version = "20.8b1" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -127,7 +134,6 @@ d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] name = "certifi" version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -139,7 +145,6 @@ files = [ name = "cffi" version = "1.16.0" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -204,7 +209,6 @@ pycparser = "*" name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -304,7 +308,6 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -319,7 +322,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -331,7 +333,6 @@ files = [ name = "coverage" version = "5.5" description = "Code coverage measurement for Python" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" files = [ @@ -396,7 +397,6 @@ toml = ["toml"] name = "cryptography" version = "42.0.5" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -451,7 +451,6 @@ test-randomorder = ["pytest-randomly"] name = "cssselect2" version = "0.7.0" description = "CSS selectors for Python ElementTree" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -467,11 +466,25 @@ webencodings = "*" doc = ["sphinx", "sphinx_rtd_theme"] test = ["flake8", "isort", "pytest"] +[[package]] +name = "dill" +version = "0.3.8" +description = "serialize all of Python" +optional = true +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, + {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + [[package]] name = "django" version = "2.2.18" description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -491,7 +504,6 @@ bcrypt = ["bcrypt"] name = "django-autocomplete-light" version = "3.9.4" description = "Fresh autocompletes for Django" -category = "main" optional = false python-versions = "*" files = [ @@ -511,7 +523,6 @@ tags = ["django-taggit"] name = "django-bootstrap3" version = "14.3.0" description = "Bootstrap 3 support for Django projects" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -526,7 +537,6 @@ Django = ">=2.2" name = "django-ldapdb" version = "1.5.1" description = "A LDAP database backend for Django" -category = "main" optional = true python-versions = ">=3.6" files = [ @@ -545,7 +555,6 @@ dev = ["check-manifest", "factory-boy", "flake8", "isort (>=5.0.0)", "tox", "vol name = "django-macaddress" version = "1.8.0" description = "MAC address model and form fields for Django apps." -category = "main" optional = false python-versions = "*" files = [ @@ -560,7 +569,6 @@ netaddr = "*" name = "django-rest-framework" version = "0.1.0" description = "alias." -category = "main" optional = false python-versions = "*" files = [ @@ -574,7 +582,6 @@ djangorestframework = "*" name = "django-reversion" version = "3.0.9" description = "An extension to the Django web framework that provides version control for model instances." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -589,7 +596,6 @@ django = ">=1.11" name = "djangorestframework" version = "3.13.1" description = "Web APIs for Django, made easy." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -605,7 +611,6 @@ pytz = "*" name = "docstr-coverage" version = "2.3.1" description = "Utility for examining python source files to ensure proper documentation. Lists missing docstrings, and calculates overall docstring coverage percentage rating." -category = "dev" optional = false python-versions = "*" files = [ @@ -627,7 +632,6 @@ test = ["pytest (==6.2.5)", "pytest-mock (==3.4.0)"] name = "docutils" version = "0.16" description = "Docutils -- Python Documentation Utilities" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -639,7 +643,6 @@ files = [ name = "gitdb" version = "4.0.11" description = "Git Object Database" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -654,7 +657,6 @@ smmap = ">=3.0.1,<6" name = "gitpython" version = "3.1.42" description = "GitPython is a Python library used to interact with Git repositories" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -672,7 +674,6 @@ test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre name = "html5lib" version = "1.1" description = "HTML parser based on the WHATWG HTML specification" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -694,7 +695,6 @@ lxml = ["lxml"] name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -706,7 +706,6 @@ files = [ name = "imagesize" version = "1.4.1" description = "Getting image size from png/jpeg/jpeg2000/gif file" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -718,7 +717,6 @@ files = [ name = "importlib-resources" version = "6.1.3" description = "Read resources from Python packages" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -733,11 +731,24 @@ zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] testing = ["jaraco.collections", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)"] +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = true +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + [[package]] name = "jinja2" version = "3.1.3" description = "A very fast and expressive template engine." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -755,7 +766,6 @@ i18n = ["Babel (>=2.7)"] name = "lxml" version = "5.1.0" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -849,7 +859,6 @@ source = ["Cython (>=3.0.7)"] name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -915,11 +924,21 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = true +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -931,7 +950,6 @@ files = [ name = "mysqlclient" version = "2.2.4" description = "Python interface to MySQL" -category = "main" optional = true python-versions = ">=3.8" files = [ @@ -950,7 +968,6 @@ files = [ name = "netaddr" version = "1.2.1" description = "A network address manipulation library for Python" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -965,7 +982,6 @@ nicer-shell = ["ipython"] name = "oscrypto" version = "1.3.0" description = "TLS (SSL) sockets, key generation, encryption, decryption, signing, verification and KDFs using the OS crypto libraries. Does not require a compiler, and relies on the OS for patching. Works on Windows, OS X and Linux/BSD." -category = "main" optional = false python-versions = "*" files = [ @@ -980,7 +996,6 @@ asn1crypto = ">=1.5.1" name = "packaging" version = "23.2" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -992,7 +1007,6 @@ files = [ name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1004,7 +1018,6 @@ files = [ name = "pillow" version = "8.4.0" description = "Python Imaging Library (Fork)" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1051,11 +1064,25 @@ files = [ {file = "Pillow-8.4.0.tar.gz", hash = "sha256:b8e2f83c56e141920c39464b852de3719dfbfb6e3c99a2d8da0edf4fb33176ed"}, ] +[[package]] +name = "platformdirs" +version = "4.2.0" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = true +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, + {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, +] + +[package.extras] +docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] + [[package]] name = "psycopg2" version = "2.8.6" description = "psycopg2 - Python-PostgreSQL Database Adapter" -category = "main" optional = true python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" files = [ @@ -1080,7 +1107,6 @@ files = [ name = "pyasn1" version = "0.5.1" description = "Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208)" -category = "main" optional = true python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ @@ -1092,7 +1118,6 @@ files = [ name = "pyasn1-modules" version = "0.3.0" description = "A collection of ASN.1-based protocols modules" -category = "main" optional = true python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ @@ -1107,7 +1132,6 @@ pyasn1 = ">=0.4.6,<0.6.0" name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1119,7 +1143,6 @@ files = [ name = "pycryptodome" version = "3.20.0" description = "Cryptographic library for Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -1161,7 +1184,6 @@ files = [ name = "pygments" version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1177,7 +1199,6 @@ windows-terminal = ["colorama (>=0.4.6)"] name = "pyhanko" version = "0.22.0" description = "Tools for stamping and signing PDF files" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1206,14 +1227,13 @@ mypy = ["pyHanko[async-http,etsi,extra-pubkey-algs,image-support,opentype,pkcs11 opentype = ["fonttools (>=4.33.3)", "uharfbuzz (>=0.25.0,<0.40.0)"] pkcs11 = ["python-pkcs11 (>=0.7.0,<0.8.0)"] testing = ["certomancer-csc-dummy (==0.2.3)", "pyHanko[async-http,extra-pubkey-algs,image-support,opentype,pkcs11,testing-basic,xmp]", "pyHanko[etsi]", "pytest-aiohttp (>=1.0.4,<1.1.0)"] -testing-basic = ["backports.zoneinfo[tzdata]", "certomancer (>=0.11.0,<0.12.0)", "freezegun (>=1.1.0)", "pytest (>=6.1.1)", "pytest-asyncio (==0.23.5)", "pytest-cov (>=4.0,<4.2)", "requests-mock (>=1.8.0)"] +testing-basic = ["backports.zoneinfo[tzdata]", "certomancer (==0.11.*)", "freezegun (>=1.1.0)", "pytest (>=6.1.1)", "pytest-asyncio (==0.23.5)", "pytest-cov (>=4.0,<4.2)", "requests-mock (>=1.8.0)"] xmp = ["defusedxml (>=0.7.1,<0.8.0)"] [[package]] name = "pyhanko-certvalidator" version = "0.26.3" description = "Validates X.509 certificates and paths; forked from wbond/certvalidator" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1233,11 +1253,72 @@ async-http = ["aiohttp (>=3.8,<3.10)"] mypy = ["pyhanko-certvalidator[testing]", "types-requests"] testing = ["aiohttp (>=3.8,<3.10)", "freezegun (>=1.1.0)", "pyhanko-certvalidator[async-http]", "pytest (>=6.1.1)", "pytest-aiohttp (>=1.0.4,<1.1.0)", "pytest-cov (>=4.0,<4.2)"] +[[package]] +name = "pylint" +version = "3.1.0" +description = "python code static checker" +optional = true +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.1.0-py3-none-any.whl", hash = "sha256:507a5b60953874766d8a366e8e8c7af63e058b26345cfcb5f91f89d987fd6b74"}, + {file = "pylint-3.1.0.tar.gz", hash = "sha256:6a69beb4a6f63debebaab0a3477ecd0f559aa726af4954fc948c51f7a2549e23"}, +] + +[package.dependencies] +astroid = ">=3.1.0,<=3.2.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, +] +isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + +[[package]] +name = "pylint-django" +version = "2.5.5" +description = "A Pylint plugin to help Pylint understand the Django web framework" +optional = true +python-versions = ">=3.7,<4.0" +files = [ + {file = "pylint_django-2.5.5-py3-none-any.whl", hash = "sha256:5abd5c2228e0e5e2a4cb6d0b4fc1d1cef1e773d0be911412f4dd4fc1a1a440b7"}, + {file = "pylint_django-2.5.5.tar.gz", hash = "sha256:2f339e4bf55776958283395c5139c37700c91bd5ef1d8251ef6ac88b5abbba9b"}, +] + +[package.dependencies] +pylint = ">=2.0,<4" +pylint-plugin-utils = ">=0.8" + +[package.extras] +with-django = ["Django (>=2.2)"] + +[[package]] +name = "pylint-plugin-utils" +version = "0.8.2" +description = "Utilities and helpers for writing Pylint plugins" +optional = true +python-versions = ">=3.7,<4.0" +files = [ + {file = "pylint_plugin_utils-0.8.2-py3-none-any.whl", hash = "sha256:ae11664737aa2effbf26f973a9e0b6779ab7106ec0adc5fe104b0907ca04e507"}, + {file = "pylint_plugin_utils-0.8.2.tar.gz", hash = "sha256:d3cebf68a38ba3fba23a873809155562571386d4c1b03e5b4c4cc26c3eee93e4"}, +] + +[package.dependencies] +pylint = ">=1.7" + [[package]] name = "pypdf" version = "4.1.0" description = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1259,7 +1340,6 @@ image = ["Pillow (>=8.0.0)"] name = "pypng" version = "0.20220715.0" description = "Pure Python library for saving and loading PNG images" -category = "main" optional = false python-versions = "*" files = [ @@ -1271,7 +1351,6 @@ files = [ name = "python-bidi" version = "0.4.2" description = "Pure python implementation of the BiDi layout algorithm" -category = "main" optional = false python-versions = "*" files = [ @@ -1286,7 +1365,6 @@ six = "*" name = "python-dateutil" version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -1297,11 +1375,21 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "python-decouple" +version = "3.8" +description = "Strict separation of settings from code." +optional = false +python-versions = "*" +files = [ + {file = "python-decouple-3.8.tar.gz", hash = "sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f"}, + {file = "python_decouple-3.8-py3-none-any.whl", hash = "sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66"}, +] + [[package]] name = "python-ldap" version = "3.4.4" description = "Python modules for implementing LDAP clients" -category = "main" optional = true python-versions = ">=3.6" files = [ @@ -1316,7 +1404,6 @@ pyasn1_modules = ">=0.1.5" name = "pytz" version = "2024.1" description = "World timezone definitions, modern and historical" -category = "main" optional = false python-versions = "*" files = [ @@ -1328,7 +1415,6 @@ files = [ name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1389,7 +1475,6 @@ files = [ name = "qrcode" version = "7.4.2" description = "QR Code image generator" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1413,7 +1498,6 @@ test = ["coverage", "pytest"] name = "regex" version = "2023.12.25" description = "Alternative regular expression module, to replace re." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1516,7 +1600,6 @@ files = [ name = "reportlab" version = "3.6.9" description = "The Reportlab Toolkit" -category = "main" optional = false python-versions = ">=3.7, <4" files = [ @@ -1568,7 +1651,6 @@ rlpycairo = ["rlPyCairo (>=0.0.5)"] name = "requests" version = "2.31.0" description = "Python HTTP for Humans." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1590,7 +1672,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "rope" version = "0.18.0" description = "a python refactoring library..." -category = "dev" optional = false python-versions = "*" files = [ @@ -1604,7 +1685,6 @@ dev = ["pytest"] name = "setuptools" version = "69.1.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1621,7 +1701,6 @@ testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jar name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1633,7 +1712,6 @@ files = [ name = "smmap" version = "5.0.1" description = "A pure Python implementation of a sliding window memory map manager" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1645,7 +1723,6 @@ files = [ name = "snowballstemmer" version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -category = "dev" optional = false python-versions = "*" files = [ @@ -1657,7 +1734,6 @@ files = [ name = "sphinx" version = "3.5.4" description = "Python documentation generator" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1693,7 +1769,6 @@ test = ["cython", "html5lib", "pytest", "pytest-cov", "typed-ast"] name = "sphinx-rtd-theme" version = "0.5.2" description = "Read the Docs theme for Sphinx" -category = "dev" optional = false python-versions = "*" files = [ @@ -1712,7 +1787,6 @@ dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client"] name = "sphinxcontrib-applehelp" version = "1.0.4" description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1728,7 +1802,6 @@ test = ["pytest"] name = "sphinxcontrib-devhelp" version = "1.0.2" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1744,7 +1817,6 @@ test = ["pytest"] name = "sphinxcontrib-htmlhelp" version = "2.0.1" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1760,7 +1832,6 @@ test = ["html5lib", "pytest"] name = "sphinxcontrib-jsmath" version = "1.0.1" description = "A sphinx extension which renders display math in HTML via JavaScript" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1775,7 +1846,6 @@ test = ["flake8", "mypy", "pytest"] name = "sphinxcontrib-qthelp" version = "1.0.3" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1791,7 +1861,6 @@ test = ["pytest"] name = "sphinxcontrib-serializinghtml" version = "1.1.5" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -1807,7 +1876,6 @@ test = ["pytest"] name = "sqlparse" version = "0.4.4" description = "A non-validating SQL parser." -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -1824,7 +1892,6 @@ test = ["pytest", "pytest-cov"] name = "svglib" version = "1.5.1" description = "A pure-Python library for reading and converting SVG" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1841,7 +1908,6 @@ tinycss2 = ">=0.6.0" name = "tinycss2" version = "1.2.1" description = "A tiny CSS parser" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1860,7 +1926,6 @@ test = ["flake8", "isort", "pytest"] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1868,11 +1933,32 @@ files = [ {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = true +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "tomlkit" +version = "0.12.4" +description = "Style preserving TOML library" +optional = true +python-versions = ">=3.7" +files = [ + {file = "tomlkit-0.12.4-py3-none-any.whl", hash = "sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b"}, + {file = "tomlkit-0.12.4.tar.gz", hash = "sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3"}, +] + [[package]] name = "tqdm" version = "4.63.1" description = "Fast, Extensible Progress Meter" -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ @@ -1892,7 +1978,6 @@ telegram = ["requests"] name = "typed-ast" version = "1.5.5" description = "a fork of Python 2 and 3 ast modules with type comment support" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1943,7 +2028,6 @@ files = [ name = "typing-extensions" version = "4.10.0" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1955,7 +2039,6 @@ files = [ name = "tzdata" version = "2024.1" description = "Provider of IANA time zone data" -category = "main" optional = false python-versions = ">=2" files = [ @@ -1967,7 +2050,6 @@ files = [ name = "tzlocal" version = "5.2" description = "tzinfo object for the local timezone" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1986,7 +2068,6 @@ devenv = ["check-manifest", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3) name = "uritools" version = "4.0.2" description = "URI parsing, classification and composition" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1998,7 +2079,6 @@ files = [ name = "urllib3" version = "2.2.1" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -2012,11 +2092,27 @@ h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "volatildap" +version = "1.5.0" +description = "Temporary slapd launcher for testing purposes" +optional = false +python-versions = ">=3.5" +files = [ + {file = "volatildap-1.5.0-py2.py3-none-any.whl", hash = "sha256:732dfc459dd49c75e9e13e1c7bf96cb33a835d4ee7c9716205fae3fcaee6b9e5"}, + {file = "volatildap-1.5.0.tar.gz", hash = "sha256:3d9c9cc39cfed706b9a3da3bc3a2f369987807e4d4eaaddf313a994cf8a77f3c"}, +] + +[package.dependencies] +requests = "*" + +[package.extras] +dev = ["check-manifest", "flake8", "isort (>=5.0.0)", "psutil", "tox", "wheel", "zest.releaser[recommended]"] + [[package]] name = "webencodings" version = "0.5.1" description = "Character encoding aliases for legacy web content" -category = "main" optional = false python-versions = "*" files = [ @@ -2028,7 +2124,6 @@ files = [ name = "xhtml2pdf" version = "0.2.11" description = "PDF generator using HTML and CSS" -category = "main" optional = false python-versions = "*" files = [ @@ -2050,7 +2145,6 @@ svglib = ">=1.2.1" name = "zipp" version = "3.17.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -2064,10 +2158,11 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [extras] ldap = ["django-ldapdb"] +lint = ["pylint", "pylint-django"] mysql = ["mysqlclient"] postgresql = ["psycopg2"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4.0" -content-hash = "6877ec0733c92969c4d1dd66609e41ffde9c8022203c8adc816ae376690175f7" +content-hash = "35c7fcf4285d44bb7287cb8d9573f327beec53c61979faae77a8c077c2560930" diff --git a/postgresql-requirements.txt b/postgresql-requirements.txt index 36218019..651bfcf9 100644 --- a/postgresql-requirements.txt +++ b/postgresql-requirements.txt @@ -423,12 +423,12 @@ pycryptodome==3.20.0 ; python_version >= "3.8" and python_version < "4.0" \ pyhanko-certvalidator==0.26.3 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:47fba8e9dbf846d766f2e0a453572dd4b25b2f1397847a31fe892c8eb00391f5 \ --hash=sha256:e386c87e202ff1caacf5fd941da6c3509e79db54dbd7b43c6550ceebe5e67077 -pyhanko==0.21.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0a4de2c26a55c85ee6da79fc995a7fc6a61b7520270f03251caf8977ba27ccb8 \ - --hash=sha256:e5609fb8a0b8d60168999cffaa382f0361066cb429204ad2b76e84e6e7f5eb93 -pypdf==4.0.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:3316d9ddfcff5df67ae3cdfe8b945c432aa43e7f970bae7c2a4ab4fe129cd937 \ - --hash=sha256:a62daa2a24d5a608ba1b6284dde185317ce3644f89b9ebe5314d0c5d1c9f257d +pyhanko==0.22.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:7a8d50889440c435ba5e41f46c633518effa218dc76e2f88869c9e8a731b7234 \ + --hash=sha256:af2350222d011995668f462ac03378854c4d56bb684910fe9065e634dd7a6908 +pypdf==4.1.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:01c3257ec908676efd60a4537e525b89d48e0852bc92b4e0aa4cc646feda17cc \ + --hash=sha256:16cac912a05200099cef3f347c4c7e0aaf0a6d027603b8f9a973c0ea500dff89 pypng==0.20220715.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:4a43e969b8f5aaafb2a415536c1a8ec7e341cd6a3f957fd5b5f32a4cfeed902c \ --hash=sha256:739c433ba96f078315de54c0db975aee537cbc3e1d0ae4ed9aab0ca1e427e2c1 @@ -438,6 +438,9 @@ python-bidi==0.4.2 ; python_version >= "3.8" and python_version < "4.0" \ python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 +python-decouple==3.8 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f \ + --hash=sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66 pytz==2024.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 \ --hash=sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319 diff --git a/preferences/views.py b/preferences/views.py index 36b8a5f5..9c887144 100644 --- a/preferences/views.py +++ b/preferences/views.py @@ -43,7 +43,7 @@ from reversion import revisions as reversion from re2o.acl import (acl_error_message, can_create, can_delete, can_delete_set, can_edit, can_view_all) -from re2o.settings_local import OPTIONNAL_APPS_RE2O +from re2o.settings import OPTIONNAL_APPS_RE2O from re2o.views import form from . import forms, models diff --git a/pyproject.toml b/pyproject.toml index 5cd12a04..285e8d32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,11 +59,15 @@ mysqlclient = {version = "^2.0.3", optional=true} psycopg2 = {version = ">=2.8,<2.9", optional=true} django-ldapdb = {version = "^1.5.1", optional=true} xhtml2pdf = "^0.2.6" +pylint-django = {version = "^2.5.5", optional=true} +pylint = {version = "^3.1.0", optional=true} +python-decouple = "^3.8" [tool.poetry.extras] mysql = ["mysqlclient"] postgresql = ["psycopg2"] ldap = ["django-ldapdb"] +lint = ["pylint", "pylint-django"] [tool.poetry.dev-dependencies] Sphinx = "^3.4.3" @@ -72,3 +76,4 @@ black = "^20.8b1" rope = "^0.18.0" coverage = "^5.4" docstr-coverage = "^2.0.0" +volatildap = "^1.5.0" diff --git a/re2o/context_processors.py b/re2o/context_processors.py index 88471819..06915367 100644 --- a/re2o/context_processors.py +++ b/re2o/context_processors.py @@ -32,7 +32,7 @@ from django.http import HttpRequest from django.utils.translation import get_language from preferences.models import GeneralOption, OptionalMachine -from re2o.settings_local import OPTIONNAL_APPS_RE2O +from re2o.settings import OPTIONNAL_APPS_RE2O def context_user(request): diff --git a/re2o/settings.py b/re2o/settings.py index cf2b9c3e..948d1229 100644 --- a/re2o/settings.py +++ b/re2o/settings.py @@ -36,14 +36,21 @@ https://docs.djangoproject.com/en/1.8/ref/settings/ from __future__ import unicode_literals import os +import importlib +from decouple import config +from django.utils.translation import ugettext_lazy as _ from .settings_default import * +env = config('ENV', default='prod') + try: - from .settings_local import * + if env == "dev": + from .settings_local_dev import * + else: + from .settings_local import * except ImportError: pass -from django.utils.translation import ugettext_lazy as _ # The root directory for the project # Build paths inside the project like this: os.path.join(BASE_DIR, ...) diff --git a/docker/settings_local.template.py b/re2o/settings_local_dev.py similarity index 77% rename from docker/settings_local.template.py rename to re2o/settings_local_dev.py index 42585d63..8b1eb5f6 100644 --- a/docker/settings_local.template.py +++ b/re2o/settings_local_dev.py @@ -6,6 +6,7 @@ # Copyright © 2017 Gabriel Détraz # Copyright © 2017 Lara Kermarec # Copyright © 2017 Augustin Lemesle +# Copyright © 2024 Caroline Canebier # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,11 +21,13 @@ # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -"""re2o.settings_local +"""re2o.settings_local_dev The file with all the available options for a locale configuration of re2o +This file is prefield with default values for the tests and for developement """ from __future__ import unicode_literals +from decouple import config # A secret key used by the server. SECRET_KEY = "=0u1d+gi6r06+r4gmrtdg6dhsi0mc7v39a37di4m5cfqt2aro2" @@ -50,9 +53,9 @@ TIME_ZONE = "Europe/Paris" DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'NAME': '${POSTGRES_DB}', - 'USER': '${POSTGRES_USER}', - 'PASSWORD': '${POSTGRES_PASSWORD}', + 'NAME': config('POSTGRES_DB'), + 'USER': config('POSTGRES_USER'), + 'PASSWORD': config('POSTGRES_PASSWORD'), 'HOST': 'db', } } @@ -95,10 +98,23 @@ GID_RANGES = {"posix": [501, 600]} DEFAULT_GID = 500 # Some optionnal Re2o Apps -OPTIONNAL_APPS_RE2O = () +OPTIONNAL_APPS_RE2O = ( + 'api', # Is needed to use the API, for example for DHCP, DNS or Radius integration + # 'ldap_sync', # Is needed to manage a LDAP server. Tests are currently broken + 'radius', # Adds a few API routes for Radius use, need API to be activated too +) # Some Django apps you want to add in you local project OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + () # Some optinnal link for the navbar in a tuple (link,icon class,text,position (left or right)) -NAVBAR_LINKS = () \ No newline at end of file +NAVBAR_LINKS = () + +# LDAP = { +# "base_user_dn": "cn=users,dc=ldap,,dc=example,dc=net", +# "base_userservice_dn": "ou=service-users,dc=ldap,dc=example,dc=net", +# "base_usergroup_dn": "ou=posix,ou=groups,dc=ldap,,dc=example,dc=net", +# "base_userservicegroup_dn": "ou=services,ou=groups,dc=ldap,,dc=example,dc=net", +# "user_gid": 500, +# } +# LOCAL_ROUTERS = ['ldapdb.router.Router'] diff --git a/re2o/urls.py b/re2o/urls.py index 82ecb855..7097e3c6 100644 --- a/re2o/urls.py +++ b/re2o/urls.py @@ -29,7 +29,7 @@ from django.urls import include, path from django.utils.translation import ugettext_lazy as _ from django.views.generic import RedirectView -from .settings_local import OPTIONNAL_APPS_RE2O +from .settings import OPTIONNAL_APPS_RE2O from .views import about_page, contact_page, handler404, handler500, index # Admin site configuration diff --git a/re2o/views.py b/re2o/views.py index 8853b9d4..2a3906e5 100644 --- a/re2o/views.py +++ b/re2o/views.py @@ -39,7 +39,7 @@ from django.utils.translation import ugettext as _ from preferences.models import (AssoOption, GeneralOption, HomeOption, MailContact, Mandate, Service) -from re2o.settings_local import OPTIONNAL_APPS_RE2O +from re2o.settings import OPTIONNAL_APPS_RE2O from .contributors import CONTRIBUTORS diff --git a/requirements.txt b/requirements.txt index bef87b8f..f1157374 100644 --- a/requirements.txt +++ b/requirements.txt @@ -407,12 +407,12 @@ pycryptodome==3.20.0 ; python_version >= "3.8" and python_version < "4.0" \ pyhanko-certvalidator==0.26.3 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:47fba8e9dbf846d766f2e0a453572dd4b25b2f1397847a31fe892c8eb00391f5 \ --hash=sha256:e386c87e202ff1caacf5fd941da6c3509e79db54dbd7b43c6550ceebe5e67077 -pyhanko==0.21.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0a4de2c26a55c85ee6da79fc995a7fc6a61b7520270f03251caf8977ba27ccb8 \ - --hash=sha256:e5609fb8a0b8d60168999cffaa382f0361066cb429204ad2b76e84e6e7f5eb93 -pypdf==4.0.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:3316d9ddfcff5df67ae3cdfe8b945c432aa43e7f970bae7c2a4ab4fe129cd937 \ - --hash=sha256:a62daa2a24d5a608ba1b6284dde185317ce3644f89b9ebe5314d0c5d1c9f257d +pyhanko==0.22.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:7a8d50889440c435ba5e41f46c633518effa218dc76e2f88869c9e8a731b7234 \ + --hash=sha256:af2350222d011995668f462ac03378854c4d56bb684910fe9065e634dd7a6908 +pypdf==4.1.0 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:01c3257ec908676efd60a4537e525b89d48e0852bc92b4e0aa4cc646feda17cc \ + --hash=sha256:16cac912a05200099cef3f347c4c7e0aaf0a6d027603b8f9a973c0ea500dff89 pypng==0.20220715.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:4a43e969b8f5aaafb2a415536c1a8ec7e341cd6a3f957fd5b5f32a4cfeed902c \ --hash=sha256:739c433ba96f078315de54c0db975aee537cbc3e1d0ae4ed9aab0ca1e427e2c1 @@ -422,6 +422,9 @@ python-bidi==0.4.2 ; python_version >= "3.8" and python_version < "4.0" \ python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 +python-decouple==3.8 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:ba6e2657d4f376ecc46f77a3a615e058d93ba5e465c01bbe57289bfb7cce680f \ + --hash=sha256:d0d45340815b25f4de59c974b855bb38d03151d81b037d9e3f463b0c9f8cbd66 pytz==2024.1 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812 \ --hash=sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319 diff --git a/update_req.sh b/update_req.sh new file mode 100755 index 00000000..1e564bea --- /dev/null +++ b/update_req.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Updates all requirements.txt files from poetry +# Will have to be run on each update until 3.0 release + +poetry export -f requirements.txt --output requirements.txt +poetry export -f requirements.txt --output dev-requirements.txt --dev +poetry export -f requirements.txt --output ldap-requirements.txt --extras ldap +poetry export -f requirements.txt --output postgresql-requirements.txt --extras postgresql +poetry export -f requirements.txt --output mysql-requirements.txt --extras mysql \ No newline at end of file From 26b3d9a5b06a1f5df732d98439cf71326694e4d7 Mon Sep 17 00:00:00 2001 From: chapeau Date: Fri, 8 Mar 2024 10:37:55 +0100 Subject: [PATCH 3/4] typo --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 90770e49..f4db5a56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ RUN pip install poetry WORKDIR /code RUN apt-get update && apt-get install -y --no-install-recommends gettext-base libpq-dev graphviz COPY pyproject.toml poetry.lock /code/ -RUN poetry install --with dev --extras "postgresql" COPY . /code/ CMD ./docker/docker-entrypoint.sh From 7f36f4eb3f5fdd85b74d893c61166898e5f5c634 Mon Sep 17 00:00:00 2001 From: faercol Date: Fri, 8 Mar 2024 09:43:45 +0000 Subject: [PATCH 4/4] typo --- re2o/settings_local_dev.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re2o/settings_local_dev.py b/re2o/settings_local_dev.py index 8b1eb5f6..0f259afc 100644 --- a/re2o/settings_local_dev.py +++ b/re2o/settings_local_dev.py @@ -23,7 +23,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. """re2o.settings_local_dev The file with all the available options for a locale configuration of re2o -This file is prefield with default values for the tests and for developement +This file is prefilled with default values for the tests and for development """ from __future__ import unicode_literals