diff --git a/HISTORY.rst b/HISTORY.rst index 0c26d17e8f..d76243e841 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -178,9 +178,16 @@ generalized utility of the storages app. - Add book link to the documentation. -3.3.11 (2019-XX-XX) +3.2.11 (2019-XX-XX) =================== - Backport transaction handling to document model events. +- Update example LDAP authentication settings file. +- Update FAQ entry about the LDAP file. +- Automate documentation building dependencies. +- Add sphinx sitemap extension. +- Move the file patching code from the Dependency class to a + generalized utility of the storages app. +- Add book link to the documentation. 3.2.10 (2019-11-19) =================== diff --git a/Makefile b/Makefile index cdb1c64744..02c8a8b0c9 100644 --- a/Makefile +++ b/Makefile @@ -242,10 +242,35 @@ generate-requirements: ## Generate all requirements files from the project deped @./manage.py generaterequirements build > requirements/build.txt @./manage.py generaterequirements development > requirements/development.txt @./manage.py generaterequirements documentation > requirements/documentation.txt + @./manage.py generaterequirements production --only=pathlib2 >> requirements/documentation.txt @./manage.py generaterequirements testing > requirements/testing-base.txt @./manage.py generaterequirements production --exclude=django > requirements/base.txt @./manage.py generaterequirements production --only=django > requirements/common.txt +gitlab-release-documentation: ## Trigger the documentation build and publication using GitLab CI +gitlab-release-documentation: + git push + git push origin :releases/documentation + git push origin HEAD:releases/documentation + +gitlab-release-docker: ## Trigger the Docker image build and publication using GitLab CI +gitlab-release-docker: + git push + git push origin :releases/docker + git push origin HEAD:releases/docker + +gitlab-release-python: ## Trigger the Python package build and publication using GitLab CI +gitlab-release-python: + git push + git push origin :releases/python + git push origin HEAD:releases/python + +gitlab-release-all: ## Trigger the Python package, Docker image, and documentation build and publication using GitLab CI +gitlab-release-all: + git push + git push origin :releases/all + git push origin HEAD:releases/all + # Dev server runserver: ## Run the development server. diff --git a/docs/utils.py b/docs/utils.py index f9fc3bba9a..adabac56fc 100644 --- a/docs/utils.py +++ b/docs/utils.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import shutil + from pathlib2 import Path import sphinx_rtd_theme diff --git a/mayan/apps/storage/utils.py b/mayan/apps/storage/utils.py index 07c85de529..66c97cc655 100644 --- a/mayan/apps/storage/utils.py +++ b/mayan/apps/storage/utils.py @@ -8,6 +8,7 @@ import tempfile from pathlib2 import Path from django.utils.module_loading import import_string +from django.utils.six import PY3 from .settings import setting_temporary_directory @@ -92,13 +93,18 @@ def patch_files(path=None, replace_list=None): } ] """ + if PY3: + file_open_mode = 'r+' + else: + file_open_mode = 'rb+' + path_object = Path(path) for replace_entry in replace_list or []: for path_entry in path_object.glob('**/{}'.format(replace_entry['filename_pattern'])): if path_entry.is_file(): for pattern in replace_entry['content_patterns']: - with path_entry.open(mode='r+') as source_file_object: - with tempfile.TemporaryFile(mode='r+') as temporary_file_object: + with path_entry.open(mode=file_open_mode) as source_file_object: + with tempfile.TemporaryFile(mode=file_open_mode) as temporary_file_object: source_position = 0 destination_position = 0 diff --git a/requirements/documentation.txt b/requirements/documentation.txt index ebe46c305c..b54ef1897a 100644 --- a/requirements/documentation.txt +++ b/requirements/documentation.txt @@ -5,3 +5,4 @@ sphinx_rtd_theme==0.4.3 sphinxcontrib-blockdiag==1.5.5 sphinxcontrib-spelling==4.2.1 tornado<6.0 +pathlib2==2.3.5