Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing make docs issue #25799

Merged
merged 2 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/djangoapps/third_party_auth/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from openedx.core.djangoapps.theming.helpers import get_current_request

from .models import (
from common.djangoapps.third_party_auth.models import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be harmless, but why was it needed?

Copy link
Contributor Author

@awais786 awais786 Jan 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was giving error during make docs command. I will add the complete traceback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmbowman Otherwise this error appears

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/sphinx/config.py", line 319, in eval_config_file
    execfile_(filename, namespace)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/sphinx/util/pycompat.py", line 89, in execfile_
    exec(code, _globals)
  File "/edx/app/edxapp/edx-platform/docs/guides/conf.py", line 43, in <module>
    django.setup()
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/integrated_channels/sap_success_factors/models.py", line 18, in <module>
    from integrated_channels.sap_success_factors.exporters.learner_data import (
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/integrated_channels/sap_success_factors/exporters/learner_data.py", line 14, in <module>
    from enterprise.tpa_pipeline import get_user_from_social_auth
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/enterprise/tpa_pipeline.py", line 23, in <module>
    from third_party_auth.provider import Registry
  File "/edx/app/edxapp/edx-platform/common/djangoapps/third_party_auth/provider.py", line 10, in <module>
    from .models import (
  File "/edx/app/edxapp/edx-platform/common/djangoapps/third_party_auth/models.py", line 338, in <module>
    class OAuth2ProviderConfig(ProviderConfig):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/db/models/base.py", line 316, in __new__
    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/apps/registry.py", line 227, in register_model
    raise RuntimeError(
RuntimeError: Conflicting 'oauth2providerconfig' models in application 'third_party_auth': <class 'common.djangoapps.third_party_auth.models.OAuth2ProviderConfig'> and <class 'third_party_auth.models.OAuth2ProviderConfig'>.

_LTI_BACKENDS,
_PSA_OAUTH2_BACKENDS,
_PSA_SAML_BACKENDS,
Expand Down
4 changes: 3 additions & 1 deletion docs/docs_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
'contentstore.apps.ContentstoreConfig',
'cms.djangoapps.course_creators',
'xblock_config.apps.XBlockConfig',
'user_tasks',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defined in lms/envs/common.py also.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Dave added that just 2 weeks ago in https://github.com/edx/edx-platform/pull/25933 .

'lms.djangoapps.lti_provider'
])


COMMON_TEST_DATA_ROOT = ''
Copy link
Contributor Author

@awais786 awais786 Dec 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise undefined var error appeared.

14 changes: 13 additions & 1 deletion docs/guides/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,17 @@
modules[path] = path


# These Django apps under lms don't import correctly with the "lms.djangapps" prefix
# Others don't import correctly without it...INSTALLED_APPS entries are inconsistent
lms_djangoapps = ['badges', 'branding', 'bulk_email', 'courseware',
'coursewarehistoryextended', 'email_marketing', 'experiments', 'lti_provider',
'mobile_api', 'notes', 'rss_proxy', 'shoppingcart', 'survey']
for app in lms_djangoapps:
path = os.path.join('lms', 'djangoapps', app)
if app not in ['notes']:
modules[path] = path


def update_settings_module(service='lms'):
"""
Set the "DJANGO_SETTINGS_MODULE" environment variable appropriately
Expand Down Expand Up @@ -283,6 +294,7 @@ def on_init(app): # pylint: disable=unused-argument
exclude_dirs = ['envs', 'migrations', 'test', 'tests']
exclude_dirs.extend(cms_djangoapps)
exclude_dirs.extend(lms_djangoapps)
Copy link
Contributor Author

@awais786 awais786 Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lms_djangoapps was removed in this commit.
but its reference remains.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we can rip out all this out pretty soon, but probably best to wait until the sys.path hack removal is fully complete.


exclude_files = ['admin.py', 'test.py', 'testing.py', 'tests.py', 'testutils.py', 'wsgi.py']
for module in modules:
module_path = six.text_type(root / module)
Expand Down Expand Up @@ -315,5 +327,5 @@ def on_init(app): # pylint: disable=unused-argument

def setup(app):
"""Sphinx extension: run sphinx-apidoc."""
event = b'builder-inited' if six.PY2 else 'builder-inited'
event = 'builder-inited'
app.connect(event, on_init)
3 changes: 3 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,6 @@ sympy==1.6.2

# cryptography 3.3.1 started failing tests on sandbox because it dropped support for python3.5
cryptography==3.2.1

# greater versions breaking the code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please write a ticket summarizing the problem with newer versions and link to it from here? Also, it looks like the docs requirements file hasn't been updated accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, its due to conflicts. make upgrade in progress right now.

Sphinx==3.3.0
2 changes: 1 addition & 1 deletion requirements/edx-sandbox/py35.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ matplotlib==2.2.4 # via -c requirements/edx-sandbox/../constraints.txt,
mpmath==1.1.0 # via sympy
networkx==2.2 # via -r requirements/edx-sandbox/py35.in
nltk==3.5 # via -r requirements/edx-sandbox/shared.txt, chem
numpy==1.16.5 # via -c requirements/edx-sandbox/../constraints.txt, -r requirements/edx-sandbox/py35.in, chem, matplotlib, openedx-calc, scipy
numpy==1.16.5 # via -c requirements/edx-sandbox/../constraints.txt, -r requirements/edx-sandbox/py35.in, chem, matplotlib, openedx-calc
openedx-calc==1.0.9 # via -r requirements/edx-sandbox/py35.in
pycparser==2.20 # via -r requirements/edx-sandbox/shared.txt, cffi
pyparsing==2.2.0 # via -r requirements/edx-sandbox/py35.in, chem, matplotlib, openedx-calc
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ social-auth-core==3.3.3 # via -r requirements/edx/testing.txt, social-auth-app
sorl-thumbnail==12.7.0 # via -r requirements/edx/testing.txt, django-wiki
sortedcontainers==2.3.0 # via -r requirements/edx/testing.txt
soupsieve==2.1 # via -r requirements/edx/testing.txt, beautifulsoup4
sphinx==3.4.2 # via edx-sphinx-theme, sphinxcontrib-httpdomain
sphinx==3.3.0 # via -c requirements/edx/../constraints.txt, edx-sphinx-theme, sphinxcontrib-httpdomain
sphinxcontrib-applehelp==1.0.2 # via sphinx
sphinxcontrib-devhelp==1.0.2 # via sphinx
sphinxcontrib-htmlhelp==1.0.3 # via sphinx
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ requests==2.25.1 # via sphinx
six==1.15.0 # via edx-sphinx-theme, stevedore
smmap==3.0.4 # via gitdb
snowballstemmer==2.0.0 # via sphinx
sphinx==3.4.2 # via -r requirements/edx/doc.in, edx-sphinx-theme
sphinx==3.3.0 # via -c requirements/edx/../constraints.txt, -r requirements/edx/doc.in, edx-sphinx-theme
sphinxcontrib-applehelp==1.0.2 # via sphinx
sphinxcontrib-devhelp==1.0.2 # via sphinx
sphinxcontrib-htmlhelp==1.0.3 # via sphinx
Expand Down