From df13b521819c707f17808531572a8e84c339dbba Mon Sep 17 00:00:00 2001 From: Peter Desjardins Date: Wed, 9 Dec 2015 00:18:01 -0500 Subject: [PATCH] Fix doc build failures that were caused by Python module import failures. Also fix broken cross references. https://openedx.atlassian.net/browse/DOC-2478 --- docs/en_us/platform_api/requirements.txt | 12 +++-- docs/en_us/platform_api/source/change_log.rst | 5 +- docs/en_us/platform_api/source/conf.py | 54 ++----------------- .../platform_api/source/docs_settings.py | 4 ++ docs/en_us/platform_api/source/overview.rst | 8 +-- 5 files changed, 23 insertions(+), 60 deletions(-) diff --git a/docs/en_us/platform_api/requirements.txt b/docs/en_us/platform_api/requirements.txt index 64a0ffa0e8..1ab308ab28 100644 --- a/docs/en_us/platform_api/requirements.txt +++ b/docs/en_us/platform_api/requirements.txt @@ -1,9 +1,15 @@ path.py -Django >=1.4,<1.5 +Django >=1.8,<1.9 +django-simple-history==1.6.3 pytz --e git+https://github.com/edx/XBlock.git#egg=XBlock +git+https://github.com/edx/XBlock.git#egg=XBlock +git+https://github.com/edx/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework_oauth-master lxml +Babel +lazy sphinxcontrib-napoleon==0.2.6 +sphinx_rtd_theme stevedore==0.14.1 -djangorestframework==2.3.14 +djangorestframework==3.2.3 PyYAML>=3.10 +mock diff --git a/docs/en_us/platform_api/source/change_log.rst b/docs/en_us/platform_api/source/change_log.rst index 9ad8008790..dfa28d2012 100644 --- a/docs/en_us/platform_api/source/change_log.rst +++ b/docs/en_us/platform_api/source/change_log.rst @@ -15,7 +15,7 @@ Change Log * - 10 June 2015 - Added the section :ref:`Profile Images API Version 1.0`. * - 11 May 2015 - - Updated the :ref:`User API ` to + - Updated the :ref:`User API ` to Version 1.0. * - - Added the :ref:`User Preferences API`. @@ -26,7 +26,6 @@ Change Log ``enrollment_start`` and ``enrollment_end fields``. * - 2 April 2015 - Added the :ref:`EdX Platform Course Structure API Version 0`, :ref:`edX - Platform Enrollment API Version 1.0` and edX Platform User API - Version 0 sections. + Platform Enrollment API` and edX Platform User API Version 0 sections. * - 29 January 2015 - Added the :ref:`Get or Change User Status in a Course` section. diff --git a/docs/en_us/platform_api/source/conf.py b/docs/en_us/platform_api/source/conf.py index 73e37cd843..ba8f17f6c7 100644 --- a/docs/en_us/platform_api/source/conf.py +++ b/docs/en_us/platform_api/source/conf.py @@ -13,55 +13,35 @@ MOCK_MODULES = [ 'lxml', 'requests', 'xblock', - 'fields', 'xblock.fields', - 'frament', 'xblock.fragment', 'webob', - 'multidict', 'webob.multidict', - 'core', 'xblock.core', - 'runtime', 'xblock.runtime', 'sortedcontainers', 'contracts', - 'plugin', 'xblock.plugin', 'opaque_keys.edx.asides', - 'asides', 'dogstats_wrapper', 'fs', 'fs.errors', 'edxmako', 'edxmako.shortcuts', - 'shortcuts', 'crum', 'opaque_keys.edx.locator', - 'LibraryLocator', - 'Location', 'ipware', - 'ip', 'ipware.ip', - 'get_ip', 'pygeoip', 'ipaddr', 'django_countries', - 'fields', 'django_countries.fields', 'opaque_keys', 'opaque_keys.edx', 'opaque_keys.edx.keys', - 'CourseKey', - 'UsageKey', - 'BlockTypeKey', 'opaque_keys.edx.locations', - 'SlashSeparatedCourseKey', - 'Locator', 'courseware', - 'access', 'courseware.access', - 'is_mobile_available_for_user', 'courseware.model_data', 'courseware.module_render', 'courseware.views', @@ -81,9 +61,7 @@ MOCK_MODULES = [ 'analytics', 'courseware.courses', 'django.contrib.staticfiles', - 'storage', 'django.contrib.staticfiles.storage', - 'content', 'xmodule.contentstore', 'xmodule.contentstore.content', 'xblock.exceptions', @@ -98,18 +76,13 @@ MOCK_MODULES = [ 'social.apps.django_app', 'social.backends', 'mako', - 'exceptions', 'mako.exceptions', 'boto', - 'exception', 'boto.exception', 'PIL', 'reportlab', - 'lib', 'reportlab.lib', 'pdfgen', - 'canvas', - 'pdfgen', 'pdfgen.canvas', 'reportlab.pdfgen', 'reportlab.pdfgen.canvas', @@ -118,9 +91,6 @@ MOCK_MODULES = [ 'reportlab.lib.styles', 'reportlab.platypus', 'reportlab.platypus.tables', - 'boto', - 's3', - 'connection', 'boto.s3', 'boto.s3.connection', 'boto.s3.key', @@ -128,13 +98,9 @@ MOCK_MODULES = [ 'Crypto.Cipher', 'Crypto.PublicKey', 'openid', - 'store', - 'interface', 'openid.store', - 'store.interface', 'openid.store.interface', 'external_auth.views', - 'html_to_text', 'mail_utils', 'ratelimitbackend.backends', 'social.apps.django_app.default', @@ -166,35 +132,23 @@ MOCK_MODULES = [ 'student.roles', 'embargo.models', 'xmodule.vertical_block', - 'vertical_block', - 'errors', - 'UserNotFound', - 'UserNotAuthorized', - 'AccountUpdateError', - 'AccountValidationError', - 'transaction', - 'parsers', - 'MergePatchParser', - 'get_account_settings', - 'update_account_settings', - 'serializers', - 'profile_images.images', 'xmodule.course_module', 'user_api.accounts.api', 'user_api.accounts.serializers', 'edx_rest_api_client', - 'client', 'edx_rest_api_client.client', 'edx_rest_api_client.exceptions', 'student.auth', 'ccx_keys', 'ccx_keys.locator', 'user_api.preferences.api', - 'rest_framework_oauth.authentication' + 'rest_framework_oauth.authentication', + 'certificates.api', + 'courseware.date_summary', ] for mod_name in MOCK_MODULES: - sys.modules[mod_name] = mock.Mock(class_that_is_extended=object) + sys.modules[mod_name] = mock.Mock() if "DJANGO_SETTINGS_MODULE" not in os.environ: docs_path = os.getcwd() diff --git a/docs/en_us/platform_api/source/docs_settings.py b/docs/en_us/platform_api/source/docs_settings.py index 47c1f0e1c9..5eb9a12e89 100644 --- a/docs/en_us/platform_api/source/docs_settings.py +++ b/docs/en_us/platform_api/source/docs_settings.py @@ -6,3 +6,7 @@ This is the local_settings file for platform API doc. from random import choice characters = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)' SECRET_KEY = ''.join([choice(characters) for i in range(50)]) + +# for use in openedx/core/djangoapps/profile_images/images.py +PROFILE_IMAGE_MAX_BYTES = 1000 +PROFILE_IMAGE_MIN_BYTES = 1000 diff --git a/docs/en_us/platform_api/source/overview.rst b/docs/en_us/platform_api/source/overview.rst index 40dcd6abdc..4e00c8bc99 100644 --- a/docs/en_us/platform_api/source/overview.rst +++ b/docs/en_us/platform_api/source/overview.rst @@ -14,17 +14,17 @@ interchange format. The APIs also use edX OAuth 2.0 for :ref:`authentication Supported edX Platform API Modules ********************************************** -The following edX Platform APIs are currently supported: +The following edX Platform APIs are currently supported. -* :ref:`edX Platform Enrollment API Version 1.0` +* :ref:`edX Platform Enrollment API` * :ref:`edX Platform Mobile API Version 0.5` * :ref:`Profile Images API Version 1.0` -* :ref:`edX Platform User API Version 1.0` +* :ref:`edX Platform User API` ********************************************** Experimental edX Platform API Modules ********************************************** -The following edX Platform APIs are currently experimental: +The following edX Platform APIs are currently experimental. * :ref:`EdX Platform Course Structure API Version 0`