Skip to content

Commit

Permalink
➖ Remove unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Feb 12, 2024
1 parent 552b21e commit b01be7f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 93 deletions.
7 changes: 0 additions & 7 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Core python libraries
Pillow # handle images
psycopg2 # database driver
pytz # handle timezones
python-dotenv # environment variables for secrets
python-decouple # processing of envvar configs
jsonschema
Expand All @@ -10,20 +8,15 @@ jsonschema
django
django-admin-index
django-axes
django-choices
django-hijack
django-jsonsuit
django-redis
django-rosetta
django-sniplates
maykin-django-two-factor-auth
maykin-django-two-factor-auth[phonenumbers]
mozilla-django-oidc-db
sharing-configs

# API libraries
djangorestframework
# django-extra-fields
django-filter
drf-nested-routers
drf-spectacular
Expand Down
19 changes: 1 addition & 18 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ django==3.2.20
# django-choices
# django-filter
# django-formtools
# django-hijack
# django-jsonform
# django-jsonsuit
# django-otp
Expand All @@ -76,9 +75,7 @@ django==3.2.20
# django-redis
# django-relativedelta
# django-rest-framework-condition
# django-rosetta
# django-simple-certmanager
# django-sniplates
# django-solo
# djangorestframework
# drf-nested-routers
Expand All @@ -95,17 +92,13 @@ django-admin-index==3.0.0
django-axes==5.41.1
# via -r requirements/base.in
django-choices==1.7.2
# via
# -r requirements/base.in
# commonground-api-common
# via commonground-api-common
django-filter==23.2
# via
# -r requirements/base.in
# commonground-api-common
django-formtools==2.4.1
# via maykin-django-two-factor-auth
django-hijack==3.3.0
# via -r requirements/base.in
django-ipware==6.0.3
# via django-axes
django-jsonform==2.21.5
Expand All @@ -126,14 +119,10 @@ django-relativedelta==2.0.0
# via zgw-consumers
django-rest-framework-condition==0.1.1
# via commonground-api-common
django-rosetta==0.9.9
# via -r requirements/base.in
django-sendfile2==0.7.0
# via django-privates
django-simple-certmanager==1.3.0
# via zgw-consumers
django-sniplates==0.7.1
# via -r requirements/base.in
django-solo==2.0.0
# via
# commonground-api-common
Expand Down Expand Up @@ -212,10 +201,6 @@ packaging==23.1
# via drf-yasg
phonenumbers==8.13.11
# via maykin-django-two-factor-auth
pillow==9.5.0
# via -r requirements/base.in
polib==1.2.0
# via django-rosetta
prompt-toolkit==3.0.38
# via click-repl
psycopg2==2.9.6
Expand Down Expand Up @@ -245,7 +230,6 @@ python-ipware==2.0.1
# via django-ipware
pytz==2023.3
# via
# -r requirements/base.in
# celery
# django
# drf-yasg
Expand All @@ -263,7 +247,6 @@ requests==2.31.0
# via
# commonground-api-common
# coreapi
# django-rosetta
# gemma-zds-client
# mozilla-django-oidc
# requests-mock
Expand Down
16 changes: 0 additions & 16 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ django==3.2.20
# django-choices
# django-filter
# django-formtools
# django-hijack
# django-jenkins
# django-jsonform
# django-jsonsuit
Expand All @@ -111,10 +110,8 @@ django==3.2.20
# django-redis
# django-relativedelta
# django-rest-framework-condition
# django-rosetta
# django-sendfile2
# django-simple-certmanager
# django-sniplates
# django-solo
# djangorestframework
# drf-nested-routers
Expand Down Expand Up @@ -142,8 +139,6 @@ django-formtools==2.4.1
# via
# -r requirements/base.txt
# maykin-django-two-factor-auth
django-hijack==3.3.0
# via -r requirements/base.txt
django-ipware==6.0.3
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -182,8 +177,6 @@ django-rest-framework-condition==0.1.1
# via
# -r requirements/base.txt
# commonground-api-common
django-rosetta==0.9.9
# via -r requirements/base.txt
django-sendfile2==0.7.0
# via
# -r requirements/base.txt
Expand All @@ -192,8 +185,6 @@ django-simple-certmanager==1.3.0
# via
# -r requirements/base.txt
# zgw-consumers
django-sniplates==0.7.1
# via -r requirements/base.txt
django-solo==2.0.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -319,12 +310,6 @@ phonenumbers==8.13.11
# via
# -r requirements/base.txt
# maykin-django-two-factor-auth
pillow==9.5.0
# via -r requirements/base.txt
polib==1.2.0
# via
# -r requirements/base.txt
# django-rosetta
prompt-toolkit==3.0.38
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -392,7 +377,6 @@ requests==2.31.0
# -r requirements/base.txt
# commonground-api-common
# coreapi
# django-rosetta
# gemma-zds-client
# mozilla-django-oidc
# requests-mock
Expand Down
16 changes: 0 additions & 16 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ django==3.2.20
# django-extensions
# django-filter
# django-formtools
# django-hijack
# django-jenkins
# django-jsonform
# django-jsonsuit
Expand All @@ -131,10 +130,8 @@ django==3.2.20
# django-redis
# django-relativedelta
# django-rest-framework-condition
# django-rosetta
# django-sendfile2
# django-simple-certmanager
# django-sniplates
# django-solo
# djangorestframework
# drf-nested-routers
Expand Down Expand Up @@ -166,8 +163,6 @@ django-formtools==2.4.1
# via
# -r requirements/ci.txt
# maykin-django-two-factor-auth
django-hijack==3.3.0
# via -r requirements/ci.txt
django-ipware==6.0.3
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -206,8 +201,6 @@ django-rest-framework-condition==0.1.1
# via
# -r requirements/ci.txt
# commonground-api-common
django-rosetta==0.9.9
# via -r requirements/ci.txt
django-sendfile2==0.7.0
# via
# -r requirements/ci.txt
Expand All @@ -216,8 +209,6 @@ django-simple-certmanager==1.3.0
# via
# -r requirements/ci.txt
# zgw-consumers
django-sniplates==0.7.1
# via -r requirements/ci.txt
django-solo==2.0.0
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -365,16 +356,10 @@ phonenumbers==8.13.11
# via
# -r requirements/ci.txt
# maykin-django-two-factor-auth
pillow==9.5.0
# via -r requirements/ci.txt
pip-tools==6.13.0
# via -r requirements/dev.in
platformdirs==3.5.1
# via black
polib==1.2.0
# via
# -r requirements/ci.txt
# django-rosetta
prompt-toolkit==3.0.38
# via
# -r requirements/ci.txt
Expand Down Expand Up @@ -450,7 +435,6 @@ requests==2.31.0
# -r requirements/ci.txt
# commonground-api-common
# coreapi
# django-rosetta
# gemma-zds-client
# mozilla-django-oidc
# requests-mock
Expand Down
14 changes: 0 additions & 14 deletions src/objecttypes/conf/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os

# Django-hijack (and Django-hijack-admin)
from django.urls import reverse_lazy

from sentry_sdk.integrations import django, redis
Expand Down Expand Up @@ -69,9 +68,6 @@
# External applications.
"axes",
"jsonsuit.apps.JSONSuitConfig",
"sniplates",
"hijack",
"hijack.contrib.admin",
"mozilla_django_oidc",
"mozilla_django_oidc_db",
"django_jsonform",
Expand Down Expand Up @@ -104,7 +100,6 @@
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"axes.middleware.AxesMiddleware",
"hijack.middleware.HijackUserMiddleware",
"django_otp.middleware.OTPMiddleware",
]

Expand Down Expand Up @@ -359,15 +354,6 @@
"REMOTE_ADDR",
)

# Django-Hijack
HIJACK_LOGIN_REDIRECT_URL = "/"
HIJACK_LOGOUT_REDIRECT_URL = reverse_lazy("admin:accounts_user_changelist")
# The Admin mixin is used because we use a custom User-model.
HIJACK_REGISTER_ADMIN = False
# This is a CSRF-security risk.
# See: http://django-hijack.readthedocs.io/en/latest/configuration/#allowing-get-method-for-hijack-views
HIJACK_ALLOW_GET_REQUESTS = True

# Sentry SDK
SENTRY_DSN = config("SENTRY_DSN", None)

Expand Down
39 changes: 18 additions & 21 deletions src/objecttypes/core/constants.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _

from djchoices import ChoiceItem, DjangoChoices

class ObjectVersionStatus(models.TextChoices):
published = "published", _("Published")
draft = "draft", _("Draft")
deprecated = "deprecated", _("Deprecated")

class ObjectVersionStatus(DjangoChoices):
published = ChoiceItem("published", _("Published"))
draft = ChoiceItem("draft", _("Draft"))
deprecated = ChoiceItem("deprecated", _("Deprecated"))

class DataClassificationChoices(models.TextChoices):
open = "open", _("Open")
intern = "intern", _("Intern")
confidential = "confidential", _("Confidential")
strictly_confidential = "strictly_confidential", _("Strictly confidential")

class DataClassificationChoices(DjangoChoices):
open = ChoiceItem("open", _("Open"))
intern = ChoiceItem("intern", _("Intern"))
confidential = ChoiceItem("confidential", _("Confidential"))
strictly_confidential = ChoiceItem(
"strictly_confidential", _("Strictly confidential")
)


class UpdateFrequencyChoices(DjangoChoices):
real_time = ChoiceItem("real_time", _("Real-time"))
hourly = ChoiceItem("hourly", _("Hourly"))
daily = ChoiceItem("daily", _("Daily"))
weekly = ChoiceItem("weekly", _("Weekly"))
monthly = ChoiceItem("monthly", _("Monthly"))
yearly = ChoiceItem("yearly", _("Yearly"))
unknown = ChoiceItem("unknown", _("Unknown"))
class UpdateFrequencyChoices(models.TextChoices):
real_time = "real_time", _("Real-time")
hourly = "hourly", _("Hourly")
daily = "daily", _("Daily")
weekly = "weekly", _("Weekly")
monthly = "monthly", _("Monthly")
yearly = "yearly", _("Yearly")
unknown = "unknown", _("Unknown")
1 change: 0 additions & 1 deletion src/objecttypes/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
auth_views.PasswordResetDoneView.as_view(),
name="password_reset_done",
),
path("admin/hijack/", include("hijack.urls")),
path("admin/", admin.site.urls),
path(
"reset/<uidb64>/<token>/",
Expand Down

0 comments on commit b01be7f

Please sign in to comment.