forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
199 lines (190 loc) · 10.2 KB
/
setup.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
[tool:pytest]
# Note: The first file of settings found is used, there is no combining, so
# this file is only used for tests that don't find a pytest.ini file first.
# Details at https://docs.pytest.org/en/latest/reference/customize.html
DJANGO_SETTINGS_MODULE = lms.envs.test
addopts = --nomigrations --reuse-db --durations=20 --json-report --json-report-omit keywords streams collectors log traceback tests --json-report-file=none
# Enable default handling for all warnings, including those that are ignored by default;
# but hide rate-limit warnings (because we deliberately don't throttle test user logins)
# and field_data deprecation warnings (because fixing them requires a major low-priority refactoring)
filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit:UserWarning
ignore::xblock.exceptions.FieldDataDeprecationWarning
# Remove default_app_config warning after updating Django to 4.2
ignore:.*You can remove default_app_config.*:PendingDeprecationWarning
ignore:Instead access HTTPResponse.headers directly.*:DeprecationWarning:elasticsearch
# ABC deprecation Warning comes from libsass
ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass
# declare_namespace Warning comes from XBlock https://github.com/openedx/XBlock/issues/641
# and also due to dependency: https://github.com/PyFilesystem/pyfilesystem2
ignore:Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning
ignore:.*pkg_resources is deprecated as an API.*:DeprecationWarning
ignore:'etree' is deprecated. Use 'xml.etree.ElementTree' instead.:DeprecationWarning:wiki
junit_family = xunit2
norecursedirs = .* *.egg build conf dist node_modules test_root cms/envs lms/envs
python_classes =
python_files = tests.py test_*.py tests_*.py *_tests.py __init__.py
[pycodestyle]
# error codes: https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
# E501: line too long
# E265: block comment should start with '# '
# We ignore this because pep8 used to erroneously lump E266 into it also.
# We should probably fix these now.
# E266: too many leading '#' for block comment
# We have lots of comments that look like "##### HEADING #####" which violate
# this rule, because they don't have a space after the first #. However,
# they're still perfectly reasonable comments, so we disable this rule.
# W602: deprecated form of raising exception
# We do this in a few places to modify the exception message while preserving
# the traceback. See this blog post for more info:
# http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html
# It's a little unusual, but we have good reasons for doing so, so we disable
# this rule.
# E305,E402,E722,E731,E741,E743,W503,W504: errors and warnings added since pep8/pycodestyle
# 1.5.7 that we haven't cleaned up yet
ignore=E265,E266,E305,E402,E501,E722,E731,E741,E743,W503,W504,W602
exclude=migrations,.git,.pycharm_helpers,.tox,test_root/staticfiles,node_modules
[isort]
indent=' '
line_length=120
multi_line_output=3
skip=
envs
migrations
[importlinter]
root_packages =
lms
cms
openedx
openedx_learning
include_external_packages = True
contract_types =
# Our custom contract which checks that we're only importing from 'api.py'
# for participating packages.
isolated_apps: openedx.testing.importlinter.isolated_apps_contract.IsolatedAppsContract
[importlinter:contract:1]
name = lms and cms are independent
type = independence
modules =
lms
cms
ignore_imports =
############################################################################
# lms side imports that we are ignoring for now
lms.djangoapps.course_home_api.outline.tests.test_view -> cms.djangoapps.contentstore.outlines
lms.djangoapps.course_home_api.tests.utils -> cms.djangoapps.contentstore.outlines
# lms.djangoapps.instructor.tests.test_api & lms.djangoapps.instructor.tests.test_tools
# -> openedx.core.djangoapps.course_date_signals.handlers
# -> cms.djangoapps.contentstore.config.waffle
openedx.core.djangoapps.course_date_signals.handlers -> cms.djangoapps.contentstore.config.waffle
############################################################################
# cms side imports that we are ignoring for now
cms.djangoapps.contentstore.views.tests.test_block -> lms.djangoapps.lms_xblock.mixin
cms.envs.common -> lms.envs.common
cms.djangoapps.contentstore.signals.handlers -> lms.djangoapps.grades.api
cms.djangoapps.contentstore.course_group_config -> lms.lib.utils
cms.djangoapps.contentstore.views.preview -> lms.djangoapps.lms_xblock.field_data
cms.envs.common -> lms.djangoapps.lms_xblock.mixin
cms.envs.test -> lms.envs.test
# cms.djangoapps.contentstore.views.tests.test_group_configurations
# -> openedx.features.content_type_gating.helpers
# -> lms.djangoapps.courseware.masquerade
openedx.features.content_type_gating.helpers -> lms.djangoapps.courseware.masquerade
# cms.djangoapps.contentstore.utils
# -> openedx.core.djangoapps.django_comment_common.models
# -> openedx.core.djangoapps.course_groups.cohorts
# -> lms.djangoapps.courseware.courses
openedx.core.djangoapps.course_groups.cohorts -> lms.djangoapps.courseware.courses
# cms.djangoapps.models.settings.course_metadata
# -> openedx.features.course_experience
# -> openedx.features.course_experience.url_helpers
# -> lms.djangoapps.courseware.toggles
openedx.features.course_experience.url_helpers -> lms.djangoapps.courseware.toggles
# cms.djangoapps.contentstore.[various]
# -> openedx.features.content_type_gating.partitions
# -> lms.djangoapps.commerce.utils
openedx.features.content_type_gating.partitions -> lms.djangoapps.commerce.utils
# cms.djangoapps.contentstore.course_group_config
# -> openedx.core.djangoapps.course_groups.partition_scheme
# -> lms.djangoapps.courseware.masquerade
openedx.core.djangoapps.course_groups.partition_scheme -> lms.djangoapps.courseware.masquerade
# cms.djangoapps.contentstore.[various]
# -> openedx.core.djangoapps.content.course_overviews.models
# -> lms.djangoapps.ccx.utils
# & lms.djangoapps.certificates.api
# & lms.djangoapps.discussion.django_comment_client
openedx.core.djangoapps.content.course_overviews.models -> lms.djangoapps.*.*
# cms.djangoapps.export_course_metadata.tasks
# -> openedx.core.djangoapps.schedules.content_highlights
# -> lms.djangoapps.courseware.block_render & lms.djangoapps.courseware.model_data
openedx.core.djangoapps.content_libraries.* -> lms.djangoapps.*.*
# cms.djangoapps.contentstore.tasks -> openedx.core.djangoapps.content_libraries.[various]
# -> lms.djangoapps.grades.api
openedx.core.djangoapps.xblock.*.* -> lms.djangoapps.*.*
# cms.djangoapps.contentstore.tasks -> openedx.core.djangoapps.content_libraries.[various] -> openedx.core.djangoapps.xblock.[various]
# -> lms.djangoapps.courseware & lms.djangoapps.courseware.grades
openedx.core.djangoapps.schedules.content_highlights -> lms.djangoapps.courseware.*
# cms.djangoapps.contentstore.[various]
# -> openedx.core.lib.gating.api
# -> lms.djangoapps.course_blocks.api & lms.djangoapps.courseware.access & lms.djangoapps.grades.api
openedx.core.lib.gating.api -> lms.djangoapps.*.*
# cms.djangoapps.contentstore.[various]
# -> openedx.features.content_type_gating.partitions
# -> openedx.features.discounts.utils
# -> lms.djangoapps.courseware.utils & lms.djangoapps.experiments.models
openedx.features.discounts.utils -> lms.djangoapps.courseware.utils
openedx.features.discounts.utils -> lms.djangoapps.experiments.models
# cms.djangoapps.contentstore.signals.handlers
# -> openedx.core.djangoapps.discussions.tasks
# -> openedx.core.djangoapps.discussions.utils
# -> lms.djangoapps.courseware.access
openedx.core.djangoapps.discussions.utils -> lms.djangoapps.courseware.access
# cms.djangoapps.contentstore.[various]
# -> openedx.features.content_type_gating.partitions
# -> openedx.features.discounts.utils
# -> openedx.features.discounts.applicability
# -> lms.djangoapps.courseware.toggles
# & lms.djangoapps.courseware.utils
# & lms.djangoapps.experiments.models
# & lms.djangoapps.experiments.stable_bucketing
openedx.features.discounts.applicability -> lms.djangoapps.courseware.*
openedx.features.discounts.applicability -> lms.djangoapps.experiments.*
# cms.djangoapps.contentstore.[various]
# -> openedx.core.djangoapps.content.learning_sequences.api
# -> openedx.core.djangoapps.content.learning_sequences.api.outlines
# -> openedx.core.djangoapps.content.learning_sequences.api.permissions
# -> lms.djangoapps.courseware.access
openedx.core.djangoapps.content.learning_sequences.api.permissions -> lms.djangoapps.courseware.access
# cms.djangoapps.contentstore.[various]
# -> openedx.features.content_type_gating.partitions
# -> openedx.features.discounts.utils
# -> openedx.features.discounts.applicability
# -> openedx.features.enterprise_support.utils
openedx.features.enterprise_support.utils -> lms.djangoapps.branding.api
cms.djangoapps.contentstore.rest_api.v1.views.settings -> lms.djangoapps.certificates.api
[importlinter:contract:2]
name = Do not depend on non-public API of isolated apps.
type = isolated_apps
isolated_apps =
openedx.core.djangoapps.agreements
openedx.core.djangoapps.bookmarks
openedx.core.djangoapps.content_libraries
openedx.core.djangoapps.content_staging
openedx.core.djangoapps.olx_rest_api
openedx.core.djangoapps.xblock
openedx.core.lib.xblock_serializer
allowed_modules =
# Only imports from api.py are allowed elsewhere in the code
# See https://open-edx-proposals.readthedocs.io/en/latest/best-practices/oep-0049-django-app-patterns.html#api-py
api
[importlinter:contract:3]
name = Do not import apps from openedx-learning (only import from openedx_learning.api.* and openedx_learning.lib.*).
type = forbidden
source_modules =
cms
lms
openedx
forbidden_modules =
openedx_learning.apps
allow_indirect_imports = True