ol-openedx-git-auto-export 0.3.1__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ol-openedx-git-auto-export-0.3.1/ol_openedx_git_auto_export.egg-info → ol-openedx-git-auto-export-0.4.0}/PKG-INFO +1 -1
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/backend_shim.py +9 -2
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/app.py +2 -2
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/settings/common.py +2 -2
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/settings/production.py +2 -2
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/signals.py +16 -7
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/tasks.py +7 -9
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0/ol_openedx_git_auto_export.egg-info}/PKG-INFO +1 -1
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export.egg-info/requires.txt +1 -1
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/setup.py +2 -2
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/MANIFEST.in +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/__init__.py +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/__init__.py +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/constants.py +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export/settings/__init__.py +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export.egg-info/SOURCES.txt +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export.egg-info/dependency_links.txt +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export.egg-info/entry_points.txt +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export.egg-info/namespace_packages.txt +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/ol_openedx_git_auto_export.egg-info/top_level.txt +0 -0
- {ol-openedx-git-auto-export-0.3.1 → ol-openedx-git-auto-export-0.4.0}/setup.cfg +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
# DO NOT EDIT THIS FILE -- AUTOGENERATED BY PANTS
|
|
3
3
|
|
|
4
|
+
import errno
|
|
4
5
|
import os
|
|
5
6
|
import setuptools.build_meta
|
|
6
7
|
|
|
7
8
|
backend = setuptools.build_meta.__legacy__
|
|
8
9
|
|
|
9
|
-
dist_dir = "dist"
|
|
10
|
+
dist_dir = "dist/"
|
|
10
11
|
build_wheel = True
|
|
11
12
|
build_sdist = True
|
|
12
13
|
wheel_config_settings = {
|
|
@@ -14,7 +15,13 @@ wheel_config_settings = {
|
|
|
14
15
|
sdist_config_settings = {
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
os.makedirs(
|
|
18
|
+
# Python 2.7 doesn't have the exist_ok arg on os.makedirs().
|
|
19
|
+
try:
|
|
20
|
+
os.makedirs(dist_dir)
|
|
21
|
+
except OSError as e:
|
|
22
|
+
if e.errno != errno.EEXIST:
|
|
23
|
+
raise
|
|
24
|
+
|
|
18
25
|
wheel_path = backend.build_wheel(dist_dir, wheel_config_settings) if build_wheel else None
|
|
19
26
|
sdist_path = backend.build_sdist(dist_dir, sdist_config_settings) if build_sdist else None
|
|
20
27
|
|
|
@@ -28,8 +28,8 @@ class GitAutoExportConfig(AppConfig):
|
|
|
28
28
|
PluginSignals.RECEIVERS: [
|
|
29
29
|
{
|
|
30
30
|
PluginSignals.RECEIVER_FUNC_NAME: "listen_for_course_publish",
|
|
31
|
-
PluginSignals.SIGNAL_PATH: "xmodule.modulestore.django.COURSE_PUBLISHED",
|
|
32
|
-
PluginSignals.DISPATCH_UID: "ol_openedx_git_auto_export.signals.listen_for_course_publish",
|
|
31
|
+
PluginSignals.SIGNAL_PATH: "xmodule.modulestore.django.COURSE_PUBLISHED", # noqa: E501
|
|
32
|
+
PluginSignals.DISPATCH_UID: "ol_openedx_git_auto_export.signals.listen_for_course_publish", # noqa: E501
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
},
|
|
@@ -4,6 +4,6 @@ from ol_openedx_git_auto_export.constants import ENABLE_GIT_AUTO_EXPORT
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def plugin_settings(settings):
|
|
7
|
-
"""Settings for the git auto export plugin."""
|
|
8
|
-
settings.GIT_REPO_EXPORT_DIR = "/
|
|
7
|
+
"""Settings for the git auto export plugin.""" # noqa: D401
|
|
8
|
+
settings.GIT_REPO_EXPORT_DIR = "/openedx/export_course_repos"
|
|
9
9
|
settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = True
|
|
@@ -4,6 +4,6 @@ from ol_openedx_git_auto_export.constants import ENABLE_GIT_AUTO_EXPORT
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def plugin_settings(settings):
|
|
7
|
-
"""Settings for the git auto export plugin."""
|
|
8
|
-
settings.GIT_REPO_EXPORT_DIR = "/
|
|
7
|
+
"""Settings for the git auto export plugin.""" # noqa: D401
|
|
8
|
+
settings.GIT_REPO_EXPORT_DIR = "/openedx/export_course_repos"
|
|
9
9
|
settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = True
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
|
|
4
4
|
from django.conf import settings
|
|
5
5
|
from django.dispatch import receiver
|
|
6
|
-
from xmodule.modulestore.django import SignalHandler
|
|
6
|
+
from xmodule.modulestore.django import SignalHandler, modulestore
|
|
7
7
|
|
|
8
8
|
from ol_openedx_git_auto_export.constants import ENABLE_GIT_AUTO_EXPORT
|
|
9
9
|
from ol_openedx_git_auto_export.tasks import async_export_to_git
|
|
@@ -13,27 +13,36 @@ log = logging.getLogger(__name__)
|
|
|
13
13
|
|
|
14
14
|
@receiver(SignalHandler.course_published)
|
|
15
15
|
def listen_for_course_publish(
|
|
16
|
-
sender,
|
|
16
|
+
sender, # noqa: ARG001
|
|
17
|
+
course_key,
|
|
18
|
+
**kwargs, # noqa: ARG001
|
|
17
19
|
): # pylint: disable=unused-argument
|
|
18
20
|
"""
|
|
19
21
|
Receives publishing signal and performs publishing related workflows
|
|
20
22
|
"""
|
|
21
23
|
git_repo_export_dir = getattr(
|
|
22
|
-
settings, "GIT_REPO_EXPORT_DIR", "/
|
|
24
|
+
settings, "GIT_REPO_EXPORT_DIR", "/openedx/export_course_repos"
|
|
23
25
|
)
|
|
24
|
-
if not os.path.exists(git_repo_export_dir):
|
|
25
|
-
# for development/docker/vagrant if GIT_REPO_EXPORT_DIR folder does not exist then create it
|
|
26
|
+
if not os.path.exists(git_repo_export_dir): # noqa: PTH110
|
|
27
|
+
# for development/docker/vagrant if GIT_REPO_EXPORT_DIR folder does not exist then create it # noqa: E501
|
|
26
28
|
log.error(
|
|
27
29
|
"GIT_REPO_EXPORT_DIR is not available in settings, please create it first"
|
|
28
30
|
)
|
|
29
|
-
os.makedirs(git_repo_export_dir, 0o755)
|
|
31
|
+
os.makedirs(git_repo_export_dir, 0o755) # noqa: PTH103
|
|
30
32
|
|
|
31
33
|
if settings.FEATURES.get("ENABLE_EXPORT_GIT") and settings.FEATURES.get(
|
|
32
34
|
ENABLE_GIT_AUTO_EXPORT
|
|
33
35
|
):
|
|
36
|
+
course_module = modulestore().get_course(course_key)
|
|
37
|
+
if not course_module.giturl:
|
|
38
|
+
log.info(
|
|
39
|
+
"Course %s does not have a GIT URL set in course advance settings, skipping export.", # noqa: E501
|
|
40
|
+
course_module.id,
|
|
41
|
+
)
|
|
42
|
+
return
|
|
34
43
|
# If the Git auto-export is enabled, push the course changes to Git
|
|
35
44
|
log.info(
|
|
36
|
-
"Course published with auto-export enabled. Starting export... (course id: %s)",
|
|
45
|
+
"Course published with auto-export enabled. Starting export... (course id: %s)", # noqa: E501
|
|
37
46
|
course_key,
|
|
38
47
|
)
|
|
39
48
|
async_export_to_git.delay(str(course_key))
|
|
@@ -11,7 +11,7 @@ LOGGER = get_task_logger(__name__)
|
|
|
11
11
|
def async_export_to_git(course_key_string, user=None):
|
|
12
12
|
"""
|
|
13
13
|
Exports a course to Git.
|
|
14
|
-
"""
|
|
14
|
+
""" # noqa: D401
|
|
15
15
|
course_key = CourseKey.from_string(course_key_string)
|
|
16
16
|
course_module = modulestore().get_course(course_key)
|
|
17
17
|
|
|
@@ -21,15 +21,13 @@ def async_export_to_git(course_key_string, user=None):
|
|
|
21
21
|
course_module.id,
|
|
22
22
|
)
|
|
23
23
|
export_to_git(course_module.id, course_module.giturl, user=user)
|
|
24
|
-
except GitExportError
|
|
25
|
-
LOGGER.
|
|
26
|
-
"Failed async course content export to git (course id: %s)
|
|
24
|
+
except GitExportError:
|
|
25
|
+
LOGGER.exception(
|
|
26
|
+
"Failed async course content export to git (course id: %s)",
|
|
27
27
|
course_module.id,
|
|
28
|
-
ex,
|
|
29
28
|
)
|
|
30
|
-
except Exception
|
|
31
|
-
LOGGER.
|
|
32
|
-
"Unknown error occured during async course content export to git (course id: %s):
|
|
29
|
+
except Exception:
|
|
30
|
+
LOGGER.exception(
|
|
31
|
+
"Unknown error occured during async course content export to git (course id: %s)", # noqa: E501
|
|
33
32
|
course_module.id,
|
|
34
|
-
ex,
|
|
35
33
|
)
|
|
@@ -15,7 +15,7 @@ setup(**{
|
|
|
15
15
|
'Django>2.0',
|
|
16
16
|
'celery>=4.4.7',
|
|
17
17
|
'edx-django-utils>4.0.0',
|
|
18
|
-
'edx-opaque-keys
|
|
18
|
+
'edx-opaque-keys<4.0.0,>=3.0.0',
|
|
19
19
|
),
|
|
20
20
|
'license': 'BSD-3-Clause',
|
|
21
21
|
'name': 'ol-openedx-git-auto-export',
|
|
@@ -29,5 +29,5 @@ setup(**{
|
|
|
29
29
|
'ol_openedx_git_auto_export.settings',
|
|
30
30
|
),
|
|
31
31
|
'python_requires': '>=3.8',
|
|
32
|
-
'version': '0.
|
|
32
|
+
'version': '0.4.0',
|
|
33
33
|
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|