tutor 23.0.0.dev3191__tar.gz → 23.0.0.dev3194__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.
Files changed (110) hide show
  1. tutor-23.0.0.dev3194/.hatch_build.py +79 -0
  2. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/PKG-INFO +1 -1
  3. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/config.py +25 -0
  4. tutor-23.0.0.dev3191/.hatch_build.py +0 -28
  5. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/.gitignore +0 -0
  6. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/LICENSE.txt +0 -0
  7. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/README.rst +0 -0
  8. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/pyproject.toml +0 -0
  9. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/requirements/base.in +0 -0
  10. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/requirements/dev.txt +0 -0
  11. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/requirements/plugins.txt +0 -0
  12. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/__about__.py +0 -0
  13. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/__init__.py +0 -0
  14. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/bindmount.py +0 -0
  15. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/__init__.py +0 -0
  16. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/cli.py +0 -0
  17. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/compose.py +0 -0
  18. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/config.py +0 -0
  19. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/context.py +0 -0
  20. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/dev.py +0 -0
  21. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/images.py +0 -0
  22. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/jobs.py +0 -0
  23. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/jobs_utils.py +0 -0
  24. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/k8s.py +0 -0
  25. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/local.py +0 -0
  26. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/mounts.py +0 -0
  27. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/params.py +0 -0
  28. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/plugins.py +0 -0
  29. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/upgrade/__init__.py +0 -0
  30. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/upgrade/common.py +0 -0
  31. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/upgrade/compose.py +0 -0
  32. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/commands/upgrade/k8s.py +0 -0
  33. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/core/__init__.py +0 -0
  34. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/core/hooks/__init__.py +0 -0
  35. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/core/hooks/actions.py +0 -0
  36. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/core/hooks/contexts.py +0 -0
  37. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/core/hooks/filters.py +0 -0
  38. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/core/hooks/priorities.py +0 -0
  39. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/env.py +0 -0
  40. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/exceptions.py +0 -0
  41. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/fmt.py +0 -0
  42. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/hooks/__init__.py +0 -0
  43. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/hooks/catalog.py +0 -0
  44. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/images.py +0 -0
  45. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/interactive.py +0 -0
  46. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/plugins/__init__.py +0 -0
  47. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/plugins/base.py +0 -0
  48. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/plugins/indexes.py +0 -0
  49. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/plugins/openedx.py +0 -0
  50. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/plugins/v0.py +0 -0
  51. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/plugins/v1.py +0 -0
  52. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/py.typed +0 -0
  53. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/serialize.py +0 -0
  54. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/tasks.py +0 -0
  55. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/caddy/Caddyfile +0 -0
  56. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/config/cms.env.yml +0 -0
  57. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/config/lms.env.yml +0 -0
  58. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/config/partials/auth.yml +0 -0
  59. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/cms/__init__.py +0 -0
  60. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/cms/development.py +0 -0
  61. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/cms/production.py +0 -0
  62. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/cms/test.py +0 -0
  63. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/lms/__init__.py +0 -0
  64. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/lms/development.py +0 -0
  65. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/lms/production.py +0 -0
  66. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/lms/test.py +0 -0
  67. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/partials/common_all.py +0 -0
  68. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/partials/common_cms.py +0 -0
  69. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/partials/common_lms.py +0 -0
  70. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/settings/partials/common_test.py +0 -0
  71. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/openedx/uwsgi.ini +0 -0
  72. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/permissions/setowners.sh +0 -0
  73. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/apps/redis/redis.conf +0 -0
  74. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/Dockerfile +0 -0
  75. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/bin/reload-uwsgi +0 -0
  76. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/revisions.yml +0 -0
  77. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/cms/__init__.py +0 -0
  78. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/cms/assets.py +0 -0
  79. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/cms/i18n.py +0 -0
  80. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/lms/__init__.py +0 -0
  81. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/lms/assets.py +0 -0
  82. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/lms/i18n.py +0 -0
  83. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/partials/assets.py +0 -0
  84. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/partials/i18n.py +0 -0
  85. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/settings/uwsgi.ini +0 -0
  86. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/openedx/themes/README +0 -0
  87. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/permissions/Dockerfile +0 -0
  88. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/build/permissions/setowner.sh +0 -0
  89. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/config/base.yml +0 -0
  90. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/config/defaults.yml +0 -0
  91. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/dev/docker-compose.jobs.yml +0 -0
  92. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/dev/docker-compose.yml +0 -0
  93. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/jobs/init/cms.sh +0 -0
  94. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/jobs/init/lms.sh +0 -0
  95. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/jobs/init/meilisearch.sh +0 -0
  96. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/jobs/init/mounted-directories.sh +0 -0
  97. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/jobs/init/mysql.sh +0 -0
  98. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/k8s/deployments.yml +0 -0
  99. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/k8s/jobs.yml +0 -0
  100. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/k8s/namespace.yml +0 -0
  101. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/k8s/override.yml +0 -0
  102. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/k8s/services.yml +0 -0
  103. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/k8s/volumes.yml +0 -0
  104. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/kustomization.yml +0 -0
  105. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/local/docker-compose.jobs.yml +0 -0
  106. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/local/docker-compose.prod.yml +0 -0
  107. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/local/docker-compose.yml +0 -0
  108. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/templates/version +0 -0
  109. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/types.py +0 -0
  110. {tutor-23.0.0.dev3191 → tutor-23.0.0.dev3194}/tutor/utils.py +0 -0
@@ -0,0 +1,79 @@
1
+ # https://hatch.pypa.io/latest/how-to/config/dynamic-metadata/
2
+ import os
3
+ import re
4
+ import typing as t
5
+
6
+ from hatchling.metadata.plugin.interface import MetadataHookInterface
7
+
8
+ HERE = os.path.dirname(__file__)
9
+
10
+ # Official plugins listed in requirements/plugins.txt are all hosted under this
11
+ # GitHub organization, in a repository that has the same name as the package.
12
+ PLUGINS_GITHUB_ORG = "https://github.com/overhangio"
13
+
14
+ # Plugin requirements must be of the form "<name><version specifier>", such as
15
+ # "tutor-mfe>=22.0.0,<23.0.0". Extras, environment markers and URLs are rejected
16
+ # rather than silently dropped when the requirement is rewritten for Tutor Main.
17
+ PLUGIN_REQUIREMENT_REGEX = re.compile(
18
+ r"^(?P<name>[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?)\s*(?P<specifier>([<>=!~]=?[^;\[\]@]*)?)$"
19
+ )
20
+
21
+
22
+ class MetaDataHook(MetadataHookInterface):
23
+ def update(self, metadata: dict[str, t.Any]) -> None:
24
+ metadata["dependencies"] = load_requirements("base.in")
25
+ metadata["optional-dependencies"] = {
26
+ "dev": load_requirements("dev.txt"),
27
+ "full": load_plugin_requirements(),
28
+ }
29
+
30
+
31
+ def load_requirements(filename: str) -> list[str]:
32
+ requirements = []
33
+ with open(
34
+ os.path.join(HERE, "requirements", filename), "rt", encoding="utf-8"
35
+ ) as f:
36
+ for line in f:
37
+ line = line.strip()
38
+ if line != "" and not line.startswith("#"):
39
+ requirements.append(line)
40
+ return requirements
41
+
42
+
43
+ def load_plugin_requirements() -> list[str]:
44
+ """
45
+ Load the official plugin requirements from requirements/plugins.txt.
46
+
47
+ That file always pins plugins to PyPI version ranges, on every branch. In
48
+ Tutor Main (i.e: when the version suffix is "main"), plugins are installed
49
+ from the main branch of their GitHub repository instead. This is the same
50
+ mechanism that sets OPENEDX_COMMON_VERSION to "master" in Tutor Main, and it
51
+ means that plugins.txt does not differ between the main and release
52
+ branches, so it never conflicts when one is merged into the other.
53
+ """
54
+ requirements = load_requirements("plugins.txt")
55
+ if load_version_suffix() != "main":
56
+ return requirements
57
+ main_requirements = []
58
+ for requirement in requirements:
59
+ match = PLUGIN_REQUIREMENT_REGEX.match(requirement)
60
+ if not match:
61
+ raise ValueError(
62
+ f"Unsupported plugin requirement: '{requirement}'. Expected "
63
+ "'<name><version specifier>' with no extras, markers or URL."
64
+ )
65
+ name = match.group("name")
66
+ main_requirements.append(f"{name}@git+{PLUGINS_GITHUB_ORG}/{name}@main")
67
+ return main_requirements
68
+
69
+
70
+ def load_version_suffix() -> str:
71
+ """
72
+ Read __version_suffix__ from tutor/__about__.py without importing tutor,
73
+ which is not installed yet at build time.
74
+ """
75
+ with open(os.path.join(HERE, "tutor", "__about__.py"), encoding="utf-8") as f:
76
+ match = re.search(r'^__version_suffix__ = "([^"]*)"', f.read(), re.MULTILINE)
77
+ if not match:
78
+ raise ValueError("Could not find __version_suffix__ in tutor/__about__.py")
79
+ return match.group(1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tutor
3
- Version: 23.0.0.dev3191
3
+ Version: 23.0.0.dev3194
4
4
  Summary: The Docker-based Open edX distribution designed for peace of mind
5
5
  Project-URL: Homepage, https://docs.tutor.edly.io/
6
6
  Project-URL: Documentation, https://docs.tutor.edly.io/
@@ -9,6 +9,11 @@ from tutor.types import Config, ConfigValue, cast_config, get_typed
9
9
 
10
10
  CONFIG_FILENAME = "config.yml"
11
11
 
12
+ # Default value of the MEILISEARCH_URL setting. It is duplicated here from
13
+ # config/defaults.yml because loading the configuration defaults is slow. The
14
+ # two values are checked to be in sync by the unit tests.
15
+ MEILISEARCH_URL_DEFAULT = "http://meilisearch:7700"
16
+
12
17
 
13
18
  def load(root: str) -> Config:
14
19
  """
@@ -342,3 +347,23 @@ def _update_enabled_plugins_on_unload(_plugin: str, _root: str, config: Config)
342
347
  Note that this action must be performed after the plugin has been unloaded, hence the low priority.
343
348
  """
344
349
  save_enabled_plugins(config)
350
+
351
+
352
+ @hooks.Actions.CONFIG_LOADED.add()
353
+ def _check_meilisearch_url(config: Config) -> None:
354
+ """
355
+ Warn the user in case Meilisearch is not run by Tutor while MEILISEARCH_URL
356
+ still points at the Tutor-managed instance.
357
+
358
+ Meilisearch is a required component of the Open edX platform: RUN_MEILISEARCH=false
359
+ does not disable it, it only indicates that it is hosted externally.
360
+ """
361
+ if get_typed(config, "RUN_MEILISEARCH", bool, True):
362
+ return
363
+ if get_typed(config, "MEILISEARCH_URL", str, "") == MEILISEARCH_URL_DEFAULT:
364
+ fmt.echo_alert(
365
+ f'Warning: RUN_MEILISEARCH=false, but MEILISEARCH_URL is still set to its default value "{MEILISEARCH_URL_DEFAULT}". '
366
+ "Meilisearch is a required component of the Open edX platform, so RUN_MEILISEARCH=false only means that it is hosted "
367
+ "externally. Set MEILISEARCH_URL to the URL of an existing, preconfigured Meilisearch instance, or set "
368
+ "RUN_MEILISEARCH=true to have Tutor run its own."
369
+ )
@@ -1,28 +0,0 @@
1
- # https://hatch.pypa.io/latest/how-to/config/dynamic-metadata/
2
- import os
3
- import typing as t
4
-
5
- from hatchling.metadata.plugin.interface import MetadataHookInterface
6
-
7
- HERE = os.path.dirname(__file__)
8
-
9
-
10
- class MetaDataHook(MetadataHookInterface):
11
- def update(self, metadata: dict[str, t.Any]) -> None:
12
- metadata["dependencies"] = load_requirements("base.in")
13
- metadata["optional-dependencies"] = {
14
- "dev": load_requirements("dev.txt"),
15
- "full": load_requirements("plugins.txt"),
16
- }
17
-
18
-
19
- def load_requirements(filename: str) -> list[str]:
20
- requirements = []
21
- with open(
22
- os.path.join(HERE, "requirements", filename), "rt", encoding="utf-8"
23
- ) as f:
24
- for line in f:
25
- line = line.strip()
26
- if line != "" and not line.startswith("#"):
27
- requirements.append(line)
28
- return requirements