|
1 | | -# openedx_learning is intended to be a library of apps used across multiple |
| 1 | +# This repo is intended to be a library of apps used across multiple |
2 | 2 | # projects, and we want to ensure certain dependency relationships. Please |
3 | 3 | # think through any changes you make to this file carefully, and don't just |
4 | 4 | # casually modify these linting rules to "fix the build". |
| 5 | + |
5 | 6 | [importlinter] |
6 | | -root_package = openedx_learning |
7 | | - |
8 | | -# This is the most basic layering for openedx_learning. |
9 | | -# |
10 | | -# The "lib" package is meant for low level utilities, field definitions, and the |
11 | | -# like, so it's at the bottom layer. |
12 | | -# |
13 | | -# The "core" apps are meant to be the heart of our system, with foundational |
14 | | -# data models and plugin interfaces. It can rely on "lib" utilities. |
15 | | -# |
16 | | -# The "contrib" apps are meant to be apps that could easily be created outside |
17 | | -# of openedx_learning in a separate repository, but are bundled here because |
18 | | -# we think they'll be generally useful. These apps may call into "core" or "lib" |
19 | | -# apps, but not the other way around. The "core" apps should *never* import from |
20 | | -# "contrib". |
21 | | -[importlinter:contract:openedx_learning_layering] |
22 | | -name = Lib / Core / Contrib Layering |
| 7 | +root_packages = |
| 8 | + openedx_content |
| 9 | + openedx_tagging |
| 10 | + openedx_django_lib |
| 11 | + openedx_core |
| 12 | + |
| 13 | +# This is layering within our top-level src folders (mostly Django apps). |
| 14 | +# This should be updated as new Django apps are added. |
| 15 | +# It's possible this might need to grow into multiple rules. |
| 16 | +[importlinter:contract:src_layering] |
| 17 | +name = "top-level source folders are layered correctly" |
23 | 18 | type = layers |
24 | | -layers= |
25 | | - openedx_learning.contrib |
26 | | - openedx_learning.apps |
27 | | - openedx_learning.lib |
| 19 | +layers = |
| 20 | + # Content is currently the highest-level thing in this repo. |
| 21 | + # Over time, we may add apps "above" or "below" this. |
| 22 | + openedx_content |
| 23 | + |
| 24 | + # Tagging is very simple & fundamental. Should probably not depend on any other Django apps. |
| 25 | + openedx_tagging |
| 26 | + |
| 27 | + # Django utilities. Should not dependend on any of the real apps (above). |
| 28 | + openedx_django_lib |
| 29 | + |
| 30 | + # This just a empty packages to expose the __version__ number. |
| 31 | + # Should not depend on anything. |
| 32 | + openedx_core |
28 | 33 |
|
29 | | -# This is layering within our Authoring apps. Every new app should be added to |
| 34 | +# This is layering within our Content applets. Every new applet should be added to |
30 | 35 | # this list when it it created. |
31 | | -[importlinter:contract:core_apps_layering] |
32 | | -name = Authoring App Dependency Layering |
| 36 | +[importlinter:contract:content_applet_layering] |
| 37 | +name = "openedx_content's internal applets are layered correctly" |
33 | 38 | type = layers |
34 | 39 | layers= |
35 | | - # The public authoring API is at the top–none of the apps should call to it. |
36 | | - openedx_learning.api.authoring |
| 40 | + # The public API is at the top. None of the apps should call to it. |
| 41 | + openedx_content.api |
37 | 42 |
|
38 | 43 | # The "backup_restore" app handle the new export and import mechanism. |
39 | | - openedx_learning.apps.openedx_content.applets.backup_restore |
| 44 | + openedx_content.applets.backup_restore |
40 | 45 |
|
41 | 46 | # The "components" app is responsible for storing versioned Components, |
42 | 47 | # which is Open edX Studio terminology maps to things like individual |
43 | 48 | # Problems, Videos, and blocks of HTML text. This is also the type we would |
44 | 49 | # associate with a single "leaf" XBlock–one that is not a container type and |
45 | 50 | # has no child elements. |
46 | | - openedx_learning.apps.openedx_content.applets.components |
| 51 | + openedx_content.applets.components |
47 | 52 |
|
48 | 53 | # The "contents" app stores the simplest pieces of binary and text data, |
49 | 54 | # without versioning information. These belong to a single Learning Package. |
50 | | - openedx_learning.apps.openedx_content.applets.contents |
| 55 | + openedx_content.applets.contents |
51 | 56 |
|
52 | 57 | # The "collections" app stores arbitrary groupings of PublishableEntities. |
53 | 58 | # Its only dependency should be the publishing app. |
54 | | - openedx_learning.apps.openedx_content.applets.collections |
| 59 | + openedx_content.applets.collections |
55 | 60 |
|
56 | 61 | # The lowest layer is "publishing", which holds the basic primitives needed |
57 | 62 | # to create Learning Packages and manage the draft and publish states for |
58 | 63 | # various types of content. |
59 | | - openedx_learning.apps.openedx_content.applets.publishing |
| 64 | + openedx_content.applets.publishing |
0 commit comments