From 34de203fd1259f7ad366a45600e6ca7cec379d93 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Wed, 17 Jan 2024 17:30:10 +0200 Subject: [PATCH] fix: update Credly Badges plugin layout --- credentials/apps/badges/apps.py | 4 +-- .../credly/{credly_badges => }/LICENSE.txt | 0 .../credly/credly_badges/admin.py | 3 ++ .../credly/credly_badges/checks.py | 3 ++ .../credly_badges/exceptions.py} | 0 .../credly/credly_badges/handlers.py | 3 ++ .../credly/credly_badges/models.py | 3 ++ .../credly/credly_badges/toggles.py | 3 ++ .../__init__.py => credly/docs} | 0 .../{credly_badges => }/requirements/base.in | 2 -- .../requirements/constraints.txt | 0 .../distribution/credly_badges/admin.py | 3 -- .../badges/distribution/credly_badges/apps.py | 29 ------------------- .../distribution/credly_badges/checks.py | 3 -- .../distribution/credly_badges/models.py | 3 -- .../credly_badges/settings/base.py | 6 ---- .../credly_badges/settings/production.py | 6 ---- .../credly_badges/settings/test.py | 6 ---- .../distribution/credly_badges/toggles.py | 3 -- .../badges/distribution/credly_badges/urls.py | 4 --- .../apps/badges/{signals.py => handlers.py} | 0 credentials/apps/badges/settings/base.py | 6 ---- .../apps/badges/settings/production.py | 6 ---- credentials/apps/badges/settings/test.py | 6 ---- credentials/apps/badges/toggles.py | 2 +- pyproject.toml | 26 +---------------- requirements/common_constraints.txt | 10 ------- 27 files changed, 19 insertions(+), 121 deletions(-) rename credentials/apps/badges/distribution/credly/{credly_badges => }/LICENSE.txt (100%) create mode 100644 credentials/apps/badges/distribution/credly/credly_badges/admin.py create mode 100644 credentials/apps/badges/distribution/credly/credly_badges/checks.py rename credentials/apps/badges/distribution/{__init__.py => credly/credly_badges/exceptions.py} (100%) create mode 100644 credentials/apps/badges/distribution/credly/credly_badges/handlers.py create mode 100644 credentials/apps/badges/distribution/credly/credly_badges/models.py create mode 100644 credentials/apps/badges/distribution/credly/credly_badges/toggles.py rename credentials/apps/badges/distribution/{credly_badges/__init__.py => credly/docs} (100%) rename credentials/apps/badges/distribution/credly/{credly_badges => }/requirements/base.in (73%) rename credentials/apps/badges/distribution/credly/{credly_badges => }/requirements/constraints.txt (100%) delete mode 100644 credentials/apps/badges/distribution/credly_badges/admin.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/apps.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/checks.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/models.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/settings/base.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/settings/production.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/settings/test.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/toggles.py delete mode 100644 credentials/apps/badges/distribution/credly_badges/urls.py rename credentials/apps/badges/{signals.py => handlers.py} (100%) delete mode 100644 credentials/apps/badges/settings/base.py delete mode 100644 credentials/apps/badges/settings/production.py delete mode 100644 credentials/apps/badges/settings/test.py diff --git a/credentials/apps/badges/apps.py b/credentials/apps/badges/apps.py index b85440653..7debcc7e4 100644 --- a/credentials/apps/badges/apps.py +++ b/credentials/apps/badges/apps.py @@ -12,5 +12,5 @@ def ready(self): """ Performs initial registrations for checks, signals, etc. """ - from . import signals # pylint: disable=unused-import,import-outside-toplevel - from . checks import badges_checks # pylint: disable=unused-import,import-outside-toplevel + from . import handlers # pylint: disable=unused-import,import-outside-toplevel + from .checks import badges_checks # pylint: disable=unused-import,import-outside-toplevel diff --git a/credentials/apps/badges/distribution/credly/credly_badges/LICENSE.txt b/credentials/apps/badges/distribution/credly/LICENSE.txt similarity index 100% rename from credentials/apps/badges/distribution/credly/credly_badges/LICENSE.txt rename to credentials/apps/badges/distribution/credly/LICENSE.txt diff --git a/credentials/apps/badges/distribution/credly/credly_badges/admin.py b/credentials/apps/badges/distribution/credly/credly_badges/admin.py new file mode 100644 index 000000000..c1e48c437 --- /dev/null +++ b/credentials/apps/badges/distribution/credly/credly_badges/admin.py @@ -0,0 +1,3 @@ +""" +Credly Badges admin configuration. +""" diff --git a/credentials/apps/badges/distribution/credly/credly_badges/checks.py b/credentials/apps/badges/distribution/credly/credly_badges/checks.py new file mode 100644 index 000000000..b9f1da572 --- /dev/null +++ b/credentials/apps/badges/distribution/credly/credly_badges/checks.py @@ -0,0 +1,3 @@ +""" +Credly Badges checks. +""" diff --git a/credentials/apps/badges/distribution/__init__.py b/credentials/apps/badges/distribution/credly/credly_badges/exceptions.py similarity index 100% rename from credentials/apps/badges/distribution/__init__.py rename to credentials/apps/badges/distribution/credly/credly_badges/exceptions.py diff --git a/credentials/apps/badges/distribution/credly/credly_badges/handlers.py b/credentials/apps/badges/distribution/credly/credly_badges/handlers.py new file mode 100644 index 000000000..c2176e911 --- /dev/null +++ b/credentials/apps/badges/distribution/credly/credly_badges/handlers.py @@ -0,0 +1,3 @@ +""" +Credly Badges signal handlers. +""" diff --git a/credentials/apps/badges/distribution/credly/credly_badges/models.py b/credentials/apps/badges/distribution/credly/credly_badges/models.py new file mode 100644 index 000000000..7171c1784 --- /dev/null +++ b/credentials/apps/badges/distribution/credly/credly_badges/models.py @@ -0,0 +1,3 @@ +""" +Credly Badges DB models. +""" diff --git a/credentials/apps/badges/distribution/credly/credly_badges/toggles.py b/credentials/apps/badges/distribution/credly/credly_badges/toggles.py new file mode 100644 index 000000000..541c24375 --- /dev/null +++ b/credentials/apps/badges/distribution/credly/credly_badges/toggles.py @@ -0,0 +1,3 @@ +""" +Credly Badges app toggles. +""" diff --git a/credentials/apps/badges/distribution/credly_badges/__init__.py b/credentials/apps/badges/distribution/credly/docs similarity index 100% rename from credentials/apps/badges/distribution/credly_badges/__init__.py rename to credentials/apps/badges/distribution/credly/docs diff --git a/credentials/apps/badges/distribution/credly/credly_badges/requirements/base.in b/credentials/apps/badges/distribution/credly/requirements/base.in similarity index 73% rename from credentials/apps/badges/distribution/credly/credly_badges/requirements/base.in rename to credentials/apps/badges/distribution/credly/requirements/base.in index 537d3a3c0..fb93b059b 100644 --- a/credentials/apps/badges/distribution/credly/credly_badges/requirements/base.in +++ b/credentials/apps/badges/distribution/credly/requirements/base.in @@ -1,4 +1,2 @@ # Main requirements of the plugin application. -c constraints.txt - -credentials.apps.badges \ No newline at end of file diff --git a/credentials/apps/badges/distribution/credly/credly_badges/requirements/constraints.txt b/credentials/apps/badges/distribution/credly/requirements/constraints.txt similarity index 100% rename from credentials/apps/badges/distribution/credly/credly_badges/requirements/constraints.txt rename to credentials/apps/badges/distribution/credly/requirements/constraints.txt diff --git a/credentials/apps/badges/distribution/credly_badges/admin.py b/credentials/apps/badges/distribution/credly_badges/admin.py deleted file mode 100644 index 8d9902d42..000000000 --- a/credentials/apps/badges/distribution/credly_badges/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Admin section configuration for credly badges. -""" diff --git a/credentials/apps/badges/distribution/credly_badges/apps.py b/credentials/apps/badges/distribution/credly_badges/apps.py deleted file mode 100644 index a32b04b47..000000000 --- a/credentials/apps/badges/distribution/credly_badges/apps.py +++ /dev/null @@ -1,29 +0,0 @@ -from django.apps import AppConfig -from credentials.apps.plugins.constants import ( - PluginURLs, - PluginSettings, - SettingsType, - PROJECT_TYPE, -) - - -class CredlyBadgesConfig(AppConfig): - name = "credentials.apps.badges.distribution.credly_badges" - verbose_name = "Credly badges" - - plugin_app = { - PluginURLs.CONFIG: { - PROJECT_TYPE: { - PluginURLs.NAMESPACE: 'credly_badges', - PluginURLs.REGEX: 'credly-badges/', - PluginURLs.RELATIVE_PATH: 'urls', - } - }, - PluginSettings.CONFIG: { - PROJECT_TYPE: { - SettingsType.BASE: {PluginSettings.RELATIVE_PATH: 'settings.base'}, - SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: 'settings.production'}, - SettingsType.TEST: {PluginSettings.RELATIVE_PATH: 'settings.test'}, - }, - } - } diff --git a/credentials/apps/badges/distribution/credly_badges/checks.py b/credentials/apps/badges/distribution/credly_badges/checks.py deleted file mode 100644 index 6c52e5c76..000000000 --- a/credentials/apps/badges/distribution/credly_badges/checks.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Credly badges checks -""" diff --git a/credentials/apps/badges/distribution/credly_badges/models.py b/credentials/apps/badges/distribution/credly_badges/models.py deleted file mode 100644 index 637327813..000000000 --- a/credentials/apps/badges/distribution/credly_badges/models.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Credly badges DB models. -""" diff --git a/credentials/apps/badges/distribution/credly_badges/settings/base.py b/credentials/apps/badges/distribution/credly_badges/settings/base.py deleted file mode 100644 index 2dba1c583..000000000 --- a/credentials/apps/badges/distribution/credly_badges/settings/base.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Credly badges base settings. -""" - -def plugin_settings(settings): # pylint: disable=unused-argument - pass diff --git a/credentials/apps/badges/distribution/credly_badges/settings/production.py b/credentials/apps/badges/distribution/credly_badges/settings/production.py deleted file mode 100644 index 53a716219..000000000 --- a/credentials/apps/badges/distribution/credly_badges/settings/production.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Credly badges production settings. -""" - -def plugin_settings(settings): # pylint: disable=unused-argument - pass diff --git a/credentials/apps/badges/distribution/credly_badges/settings/test.py b/credentials/apps/badges/distribution/credly_badges/settings/test.py deleted file mode 100644 index 2655a2c4a..000000000 --- a/credentials/apps/badges/distribution/credly_badges/settings/test.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Credly badges test settings. -""" - -def plugin_settings(settings): # pylint: disable=unused-argument - pass diff --git a/credentials/apps/badges/distribution/credly_badges/toggles.py b/credentials/apps/badges/distribution/credly_badges/toggles.py deleted file mode 100644 index 99462a9e1..000000000 --- a/credentials/apps/badges/distribution/credly_badges/toggles.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Toggles for credly badges app. -""" \ No newline at end of file diff --git a/credentials/apps/badges/distribution/credly_badges/urls.py b/credentials/apps/badges/distribution/credly_badges/urls.py deleted file mode 100644 index 27f8d37f7..000000000 --- a/credentials/apps/badges/distribution/credly_badges/urls.py +++ /dev/null @@ -1,4 +0,0 @@ -""" -URLs for credly badges. -""" -urlpatterns = [] diff --git a/credentials/apps/badges/signals.py b/credentials/apps/badges/handlers.py similarity index 100% rename from credentials/apps/badges/signals.py rename to credentials/apps/badges/handlers.py diff --git a/credentials/apps/badges/settings/base.py b/credentials/apps/badges/settings/base.py deleted file mode 100644 index 0b1a5982e..000000000 --- a/credentials/apps/badges/settings/base.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Badges base settings. -""" - -def plugin_settings(settings): # pylint: disable=unused-argument - pass diff --git a/credentials/apps/badges/settings/production.py b/credentials/apps/badges/settings/production.py deleted file mode 100644 index 1f2087330..000000000 --- a/credentials/apps/badges/settings/production.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Badges production settings. -""" - -def plugin_settings(settings): # pylint: disable=unused-argument - pass diff --git a/credentials/apps/badges/settings/test.py b/credentials/apps/badges/settings/test.py deleted file mode 100644 index f6bc2ae05..000000000 --- a/credentials/apps/badges/settings/test.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Badges test settings. -""" - -def plugin_settings(settings): # pylint: disable=unused-argument - pass diff --git a/credentials/apps/badges/toggles.py b/credentials/apps/badges/toggles.py index 260468041..81204c2cd 100644 --- a/credentials/apps/badges/toggles.py +++ b/credentials/apps/badges/toggles.py @@ -1,5 +1,5 @@ """ -Toggles for badges app. +Badges app toggles. """ from edx_toggles.toggles import SettingToggle diff --git a/pyproject.toml b/pyproject.toml index 7d5aa12cd..f5e35f8e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,28 +10,4 @@ known_first_party = ["credentials"] lines_after_imports = 2 combine_as_imports = true skip = ["migrations", "settings"] -include_trailing_comma = true - -[project] -# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ -name = "credentials" -license = { file = "LICENSE" } -classifiers = [ - "Development Status :: 3 - Alpha", - "License :: OSI Approved :: GNU Affero General Public License v3", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Framework :: Django :: 3", -] -dynamic = ["version", "dependencies", "optional-dependencies"] - -[tool.setuptools] -packages = ["credentials"] - -[tool.setuptools.dynamic] -dependencies = { file = "requirements/all.txt" } - -[project.entry-points."credentials.djangoapp"] -badges = "credentials.apps.badges.apps:BadgesConfig" \ No newline at end of file +include_trailing_comma = true \ No newline at end of file diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 98a621135..b9130dfa8 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -3,16 +3,6 @@ # See BOM-2721 for more details. # Below is the copied and edited version of common_constraints -# This is a temporary solution to override the real common_constraints.txt -# In edx-lint, until the pyjwt constraint in edx-lint has been removed. -# See BOM-2721 for more details. -# Below is the copied and edited version of common_constraints - -# This is a temporary solution to override the real common_constraints.txt -# In edx-lint, until the pyjwt constraint in edx-lint has been removed. -# See BOM-2721 for more details. -# Below is the copied and edited version of common_constraints - # A central location for most common version constraints # (across edx repos) for pip-installation. #