From 0fe4d5c229fa42082c6915574e313cf290d8f92c Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 23 Mar 2021 20:45:05 +0100 Subject: [PATCH 01/38] First test to use sphinx for documentation --- Makefile | 20 +++++ ..._python.upload.upload_file_to_bucketfs.rst | 6 ++ ...thon.upload.upload_fileobj_to_bucketfs.rst | 6 ++ ...d.upload_object_to_bucketfs_via_joblib.rst | 6 ++ ...ython.upload.upload_string_to_bucketfs.rst | 6 ++ conf.py | 57 ++++++++++++++ doc/exasol_bucketfs_utils_python.rst | 77 +++++++++++++++++++ doc/modules.rst | 7 ++ .../bucketfs_utils.py | 4 + exasol_bucketfs_utils_python/download.py | 4 + exasol_bucketfs_utils_python/upload.py | 4 + index.rst | 20 +++++ make.bat | 35 +++++++++ pyproject.toml | 9 ++- setup.py | 2 +- 15 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100644 api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst create mode 100644 api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst create mode 100644 api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst create mode 100644 api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst create mode 100644 conf.py create mode 100644 doc/exasol_bucketfs_utils_python.rst create mode 100644 doc/modules.rst create mode 100644 index.rst create mode 100644 make.bat diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst b/api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst new file mode 100644 index 00000000..8b8517b0 --- /dev/null +++ b/api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst @@ -0,0 +1,6 @@ +upload_file_to_bucketfs +======================= + +.. currentmodule:: exasol_bucketfs_utils_python.upload + +.. autofunction:: upload_file_to_bucketfs diff --git a/api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst b/api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst new file mode 100644 index 00000000..f6e41cda --- /dev/null +++ b/api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst @@ -0,0 +1,6 @@ +upload_fileobj_to_bucketfs +========================== + +.. currentmodule:: exasol_bucketfs_utils_python.upload + +.. autofunction:: upload_fileobj_to_bucketfs diff --git a/api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst b/api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst new file mode 100644 index 00000000..c99b7cb8 --- /dev/null +++ b/api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst @@ -0,0 +1,6 @@ +upload_object_to_bucketfs_via_joblib +==================================== + +.. currentmodule:: exasol_bucketfs_utils_python.upload + +.. autofunction:: upload_object_to_bucketfs_via_joblib diff --git a/api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst b/api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst new file mode 100644 index 00000000..c260310a --- /dev/null +++ b/api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst @@ -0,0 +1,6 @@ +upload_string_to_bucketfs +========================= + +.. currentmodule:: exasol_bucketfs_utils_python.upload + +.. autofunction:: upload_string_to_bucketfs diff --git a/conf.py b/conf.py new file mode 100644 index 00000000..b8089aab --- /dev/null +++ b/conf.py @@ -0,0 +1,57 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'Exasol BucketFS Utils Python' +copyright = '2021, Torsten Kilias' +author = 'Torsten Kilias' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', + 'sphinx.ext.intersphinx', + 'sphinx_automodapi.automodapi', + 'sphinx_automodapi.smart_resolver', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff --git a/doc/exasol_bucketfs_utils_python.rst b/doc/exasol_bucketfs_utils_python.rst new file mode 100644 index 00000000..58ffbacd --- /dev/null +++ b/doc/exasol_bucketfs_utils_python.rst @@ -0,0 +1,77 @@ +exasol\_bucketfs\_utils\_python package +======================================= + +Submodules +---------- + +exasol\_bucketfs\_utils\_python.bucket\_config module +----------------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.bucket_config + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.bucketfs\_config module +------------------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.bucketfs_config + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.bucketfs\_connection\_config module +------------------------------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.bucketfs_connection_config + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.bucketfs\_utils module +------------------------------------------------------ + +.. automodule:: exasol_bucketfs_utils_python.bucketfs_utils + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.download module +----------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.download + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.github\_release\_file\_bucketfs\_uploader module +-------------------------------------------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.release\_link\_extractor module +--------------------------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.release_link_extractor + :members: + :undoc-members: + :show-inheritance: + +exasol\_bucketfs\_utils\_python.upload module +--------------------------------------------- + +.. automodule:: exasol_bucketfs_utils_python.upload + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: exasol_bucketfs_utils_python + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/modules.rst b/doc/modules.rst new file mode 100644 index 00000000..d2682e56 --- /dev/null +++ b/doc/modules.rst @@ -0,0 +1,7 @@ +exasol_bucketfs_utils_python +============================ + +.. toctree:: + :maxdepth: 4 + + exasol_bucketfs_utils_python diff --git a/exasol_bucketfs_utils_python/bucketfs_utils.py b/exasol_bucketfs_utils_python/bucketfs_utils.py index 81e73a1b..b3910245 100644 --- a/exasol_bucketfs_utils_python/bucketfs_utils.py +++ b/exasol_bucketfs_utils_python/bucketfs_utils.py @@ -36,6 +36,7 @@ def _make_path_relative(path_in_bucket: Union[None, str, PurePosixPath]) -> Pure def generate_bucketfs_udf_path(bucketfs_config: BucketFSConfig) -> PurePosixPath: """ This function generates the path where UDFs can access the content of a BucketFS in their file system + :param bucketfs_config: Config of the BucketFS, the BucketFSConnectionConfig in the BucketFSConfig can be None :return: Path of the given BucketFS in the file system of the UDFs """ @@ -49,6 +50,7 @@ def generate_bucket_udf_path(bucket_config: BucketConfig, """ This function generates the path where UDFs can access the content of a bucket or the given path in a bucket in their file system + :param bucket_config: Config of the Bucket, the BucketFSConnectionConfig in the BucketFSConfig can be None :param path_in_bucket: If not None, path_in_bucket gets concatenated to the path of the bucket :return: Path of the bucket or the file in the Bucket in the file system of UDFs @@ -71,6 +73,7 @@ def generate_bucketfs_http_url(bucketfs_config: BucketFSConfig, """ This function generates an HTTP[s] url for the given BucketFSConfig with or without basic authentication (a template: http[s]://user:password@host:port) + :param bucketfs_config: A BucketFSConfig with a non None BucketFSConnectionConfig :param with_credentials: If True, this function generates a url with basic authentication, default False :return: HTTP[S] URL of the BucketFS @@ -100,6 +103,7 @@ def generate_bucket_http_url(bucket_config: BucketConfig, path_in_bucket: Union[ """ This function generates an HTTP[s] url for the given bucket or the path in the bucket with or without basic authentication (a template: http[s]://user:password@host:port) + :param bucket_config: Config of the Bucket, the BucketFSConnectionConfig in the BucketFSConfig must be not None :param path_in_bucket: If not None, path_in_bucket gets concatenated to the path of the bucket :param with_credentials: If True, this function generates a url with basic authentication, default False diff --git a/exasol_bucketfs_utils_python/download.py b/exasol_bucketfs_utils_python/download.py index 98de4b2f..e260fe15 100644 --- a/exasol_bucketfs_utils_python/download.py +++ b/exasol_bucketfs_utils_python/download.py @@ -13,6 +13,7 @@ def download_from_bucketfs_to_file(bucket_config: BucketConfig, bucket_file_path: str, local_file_path: Path): """ Download a file from the specified path in the bucket in the BucketFs and save as a local file + :param bucket_config: BucketConfig for the bucket to download from :param bucket_file_path: Path in the bucket to download the file from :param local_file_path: File path to the local file to store the downloaded data @@ -26,6 +27,7 @@ def download_from_bucketfs_to_fileobj(bucket_config: BucketConfig, bucket_file_p """ Download a file from the specified path in the bucket in the BucketFs into a given `file object `_ + :param bucket_config: BucketConfig for the bucket to download from :param bucket_file_path: Path in the bucket to download the file from :param fileobj: File object where the data of the file in the BucketFS is downloaded to @@ -44,6 +46,7 @@ def download_from_bucketfs_to_fileobj(bucket_config: BucketConfig, bucket_file_p def download_from_bucketfs_to_string(bucket_config: BucketConfig, bucket_file_path: str) -> str: """ Download a file from the specified path in the bucket in the BucketFs into a string + :param bucket_config: BucketConfig for the bucket to download from :param bucket_file_path: Path in the bucket to download the file from :return: The content of the file in the BucketFS as string @@ -61,6 +64,7 @@ def download_object_from_bucketfs_via_joblib(bucket_config: BucketConfig, bucket """ Download a file from the specified path in the bucket in the BucketFs and deserialize it via `joblib.load `_ + :param bucket_config: BucketConfig for the bucket to download from :param bucket_file_path: Path in the bucket to download the file from :return: The deserialized object which was downloaded from the BucketFS diff --git a/exasol_bucketfs_utils_python/upload.py b/exasol_bucketfs_utils_python/upload.py index fcf7a504..e8ca518a 100644 --- a/exasol_bucketfs_utils_python/upload.py +++ b/exasol_bucketfs_utils_python/upload.py @@ -15,6 +15,7 @@ def upload_file_to_bucketfs(bucket_config: BucketConfig, bucket_file_path: str, -> Tuple[ParseResult, PurePosixPath]: """ This function uploads a file to the specified path in a bucket of the BucketFS. + :param bucket_config: BucketConfig for the destination bucket :param bucket_file_path: Path in the bucket to upload the file to :param local_file_path: File path to the local file @@ -29,6 +30,7 @@ def upload_fileobj_to_bucketfs(bucket_config: BucketConfig, bucket_file_path: st """ This function uploads a `file object `_ to the specified path in a bucket of the BucketFS. + :param bucket_config: BucketConfig for the destination bucket :param bucket_file_path: Path in the bucket to upload the file to :param fileobj: File object which should be uploaded @@ -48,6 +50,7 @@ def upload_string_to_bucketfs(bucket_config: BucketConfig, bucket_file_path: str -> Tuple[ParseResult, PurePosixPath]: """ This function uploads a string to the specified path in a bucket of the BucketFS. + :param bucket_config: BucketConfig for the destination bucket :param bucket_file_path: Path in the bucket to upload the file to :param string: String which should be uploaded @@ -71,6 +74,7 @@ def upload_object_to_bucketfs_via_joblib(object: Any, This function serializes a python object with `joblib.dump `_ and uploads it to the specified path in a bucket of the BucketFS. + :param object: Object which gets serialized and uploaded via joblib.dump :param bucket_config: BucketConfig for the destination bucket :param bucket_file_path: Path in the bucket to upload the file to diff --git a/index.rst b/index.rst new file mode 100644 index 00000000..3cacb9ff --- /dev/null +++ b/index.rst @@ -0,0 +1,20 @@ +.. Exasol BucketFS Utils Python documentation master file, created by + sphinx-quickstart on Tue Mar 23 19:47:46 2021. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Exasol BucketFS Utils Python's documentation! +======================================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + doc/modules.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/make.bat b/make.bat new file mode 100644 index 00000000..2119f510 --- /dev/null +++ b/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/pyproject.toml b/pyproject.toml index 382e9766..498ff667 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ homepage = "https://github.com/exasol/bucketfs-utils-python" keywords = ['exasol', 'bucketfs'] [tool.poetry.dependencies] -python = ">=3.6.1" +python = ">=3.6.1,<4.0" requests = "^2.24.0" joblib="^1.0.1" typeguard = "^2.11.1" @@ -26,3 +26,10 @@ typeguard = "^2.11.1" [tool.poetry.dev-dependencies] pytest = "^6.1.1" pytest-cov = "^2.10.1" +Sphinx = "^3.5.3" +taskipy = "^1.6.0" +sphinx-automodapi = "^0.13" + +[tool.taskipy.tasks] +html_docs = "make html" +test = "pytest tests" diff --git a/setup.py b/setup.py index cbd1a2c9..77f1347b 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ 'packages': packages, 'package_data': package_data, 'install_requires': install_requires, - 'python_requires': '>=3.6.1', + 'python_requires': '>=3.6.1,<4.0', } From 6921bb6f384ae58cbbf0776be7c795238e0febdd Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Mon, 7 Jun 2021 19:08:12 +0200 Subject: [PATCH 02/38] Properly setup sphinx and transformed README to rst. Use poethepoet to add tasks to poetry. --- .gitignore | 5 +- README.md | 54 ------------- README.rst | 23 ++++++ ..._python.upload.upload_file_to_bucketfs.rst | 6 -- ...thon.upload.upload_fileobj_to_bucketfs.rst | 6 -- ...d.upload_object_to_bucketfs_via_joblib.rst | 6 -- ...ython.upload.upload_string_to_bucketfs.rst | 6 -- Makefile => doc/Makefile | 12 ++- ...ol_bucketfs_utils_python.bucket_config.rst | 7 ++ ..._bucketfs_utils_python.bucketfs_config.rst | 7 ++ ...tils_python.bucketfs_connection_config.rst | 7 ++ ...l_bucketfs_utils_python.bucketfs_utils.rst | 7 ++ .../exasol_bucketfs_utils_python.download.rst | 7 ++ ....github_release_file_bucketfs_uploader.rst | 7 ++ ...fs_utils_python.release_link_extractor.rst | 7 ++ doc/api/exasol_bucketfs_utils_python.rst | 25 ++++++ .../exasol_bucketfs_utils_python.upload.rst | 7 ++ conf.py => doc/conf.py | 10 ++- doc/dependencies.md | 24 ++++++ doc/exasol_bucketfs_utils_python.rst | 77 ------------------- doc/index.rst | 30 ++++++++ doc/modules.rst | 7 -- doc/overview.rst | 29 +++++++ doc/user_guide/examples.md | 17 ++++ doc/user_guide/user_guide.md | 3 + index.rst | 20 ----- make.bat | 35 --------- pyproject.toml | 12 +-- setup.py | 2 +- 29 files changed, 238 insertions(+), 227 deletions(-) delete mode 100644 README.md create mode 100644 README.rst delete mode 100644 api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst delete mode 100644 api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst delete mode 100644 api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst delete mode 100644 api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst rename Makefile => doc/Makefile (65%) create mode 100644 doc/api/exasol_bucketfs_utils_python.bucket_config.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.bucketfs_config.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.bucketfs_connection_config.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.bucketfs_utils.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.download.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.release_link_extractor.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.rst create mode 100644 doc/api/exasol_bucketfs_utils_python.upload.rst rename conf.py => doc/conf.py (92%) create mode 100644 doc/dependencies.md delete mode 100644 doc/exasol_bucketfs_utils_python.rst create mode 100644 doc/index.rst delete mode 100644 doc/modules.rst create mode 100644 doc/overview.rst create mode 100644 doc/user_guide/examples.md create mode 100644 doc/user_guide/user_guide.md delete mode 100644 index.rst delete mode 100644 make.bat diff --git a/.gitignore b/.gitignore index 3428480c..284db3de 100644 --- a/.gitignore +++ b/.gitignore @@ -132,4 +132,7 @@ dmypy.json poetry.lock # PyCharm -.idea \ No newline at end of file +.idea + +# Sphinx +doc/_build diff --git a/README.md b/README.md deleted file mode 100644 index c0af00b2..00000000 --- a/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# BucketFS Utils Python - -This project provides a python library for the Exasol BucketFS system. - -Features: - -* [Uploading a GitHub release to a bucket](#uploading-github-release-to-bucket) - -## How to Use It - -Install the package from Github via `pip`: - -``` -pip install -e git://github.com/exasol/bucketfs-utils-python.git@{ tag name }#egg=exasol-bucketfs-utils-python -``` - -## Uploading GitHub Release to Bucket - -Example: - -```python -from exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader import GithubReleaseFileBucketFSUploader - -release_uploader = \ - GithubReleaseFileBucketFSUploader(file_to_download_name="file", - github_user="user", - repository_name="repository", - release_name="latest", - path_inside_bucket="some/path/") -release_uploader.upload("http://://", "user", "password") -``` - -### Run Time Dependencies - -| Dependency | Purpose | License | -|-------------------------------|----------------------------------|--------------------| -| [Python 3][python] | Python version 3.6.1 and above | PSF | -| [Requests][requests] | Allows to send HTTP/1.1 requests | Apache License 2.0 | - - -### Test Dependencies - -| Dependency | Purpose | License | -|-------------------------------|-----------------------------------|-------------------| -| [Pytest][pytest] | Testing framework | MIT | -| [Pytest Coverage][pytest-cov] | Tests coverage | MIT | - - - -[python]: https://docs.python.org -[requests]: https://pypi.org/project/requests/ - -[pytest]: https://docs.pytest.org/en/stable/ -[pytest-cov]: https://pypi.org/project/pytest-cov/ diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..2b252e73 --- /dev/null +++ b/README.rst @@ -0,0 +1,23 @@ +##################### +BucketFS Utils Python +##################### + +.. include:: doc/overview.rst + +***************** +Table of Contents +***************** +.. include::doc/overview.rst + +Information for Users +===================== + +* [User Guide](doc/user_guide/user_guide.md) +* [Changelog](doc/changes/changelog.md) + +Information for Developers +========================== + +* [Developer Guide](doc/developer_guide/developer_guide.md) +* [Dependencies](doc/dependencies.md) + diff --git a/api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst b/api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst deleted file mode 100644 index 8b8517b0..00000000 --- a/api/exasol_bucketfs_utils_python.upload.upload_file_to_bucketfs.rst +++ /dev/null @@ -1,6 +0,0 @@ -upload_file_to_bucketfs -======================= - -.. currentmodule:: exasol_bucketfs_utils_python.upload - -.. autofunction:: upload_file_to_bucketfs diff --git a/api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst b/api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst deleted file mode 100644 index f6e41cda..00000000 --- a/api/exasol_bucketfs_utils_python.upload.upload_fileobj_to_bucketfs.rst +++ /dev/null @@ -1,6 +0,0 @@ -upload_fileobj_to_bucketfs -========================== - -.. currentmodule:: exasol_bucketfs_utils_python.upload - -.. autofunction:: upload_fileobj_to_bucketfs diff --git a/api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst b/api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst deleted file mode 100644 index c99b7cb8..00000000 --- a/api/exasol_bucketfs_utils_python.upload.upload_object_to_bucketfs_via_joblib.rst +++ /dev/null @@ -1,6 +0,0 @@ -upload_object_to_bucketfs_via_joblib -==================================== - -.. currentmodule:: exasol_bucketfs_utils_python.upload - -.. autofunction:: upload_object_to_bucketfs_via_joblib diff --git a/api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst b/api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst deleted file mode 100644 index c260310a..00000000 --- a/api/exasol_bucketfs_utils_python.upload.upload_string_to_bucketfs.rst +++ /dev/null @@ -1,6 +0,0 @@ -upload_string_to_bucketfs -========================= - -.. currentmodule:: exasol_bucketfs_utils_python.upload - -.. autofunction:: upload_string_to_bucketfs diff --git a/Makefile b/doc/Makefile similarity index 65% rename from Makefile rename to doc/Makefile index d4bb2cbb..2fc37c4c 100644 --- a/Makefile +++ b/doc/Makefile @@ -5,8 +5,11 @@ # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build +SPHINXAPIDOC ?= sphinx-apidoc SOURCEDIR = . BUILDDIR = _build +MODULES_PATH = ../exasol_bucketfs_utils_python +APIDOC_OUTPUT = api # Put it first so that "make" without argument is like "make help". help: @@ -14,7 +17,14 @@ help: .PHONY: help Makefile +api-doc: + @$(SPHINXAPIDOC) -T -d 1 --separate -o "$(APIDOC_OUTPUT)" "$(MODULES_PATH)" + +clean-build: + [ ! -e "$(BUILDDIR)" ] || rm -r "$(BUILDDIR)" + [ ! -e "$(APIDOC_OUTPUT)" ] || rm -r "$(APIDOC_OUTPUT)" + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile +%: Makefile api-doc @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/api/exasol_bucketfs_utils_python.bucket_config.rst b/doc/api/exasol_bucketfs_utils_python.bucket_config.rst new file mode 100644 index 00000000..11e0aead --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.bucket_config.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.bucket\_config module +===================================================== + +.. automodule:: exasol_bucketfs_utils_python.bucket_config + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.bucketfs_config.rst b/doc/api/exasol_bucketfs_utils_python.bucketfs_config.rst new file mode 100644 index 00000000..863f3865 --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.bucketfs_config.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.bucketfs\_config module +======================================================= + +.. automodule:: exasol_bucketfs_utils_python.bucketfs_config + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.bucketfs_connection_config.rst b/doc/api/exasol_bucketfs_utils_python.bucketfs_connection_config.rst new file mode 100644 index 00000000..bb01128d --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.bucketfs_connection_config.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.bucketfs\_connection\_config module +=================================================================== + +.. automodule:: exasol_bucketfs_utils_python.bucketfs_connection_config + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.bucketfs_utils.rst b/doc/api/exasol_bucketfs_utils_python.bucketfs_utils.rst new file mode 100644 index 00000000..23ab96f7 --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.bucketfs_utils.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.bucketfs\_utils module +====================================================== + +.. automodule:: exasol_bucketfs_utils_python.bucketfs_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.download.rst b/doc/api/exasol_bucketfs_utils_python.download.rst new file mode 100644 index 00000000..40e6f557 --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.download.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.download module +=============================================== + +.. automodule:: exasol_bucketfs_utils_python.download + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader.rst b/doc/api/exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader.rst new file mode 100644 index 00000000..73ad7c62 --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.github\_release\_file\_bucketfs\_uploader module +================================================================================ + +.. automodule:: exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.release_link_extractor.rst b/doc/api/exasol_bucketfs_utils_python.release_link_extractor.rst new file mode 100644 index 00000000..68771d41 --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.release_link_extractor.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.release\_link\_extractor module +=============================================================== + +.. automodule:: exasol_bucketfs_utils_python.release_link_extractor + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.rst b/doc/api/exasol_bucketfs_utils_python.rst new file mode 100644 index 00000000..10f5c468 --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.rst @@ -0,0 +1,25 @@ +exasol\_bucketfs\_utils\_python package +======================================= + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + exasol_bucketfs_utils_python.bucket_config + exasol_bucketfs_utils_python.bucketfs_config + exasol_bucketfs_utils_python.bucketfs_connection_config + exasol_bucketfs_utils_python.bucketfs_utils + exasol_bucketfs_utils_python.download + exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader + exasol_bucketfs_utils_python.release_link_extractor + exasol_bucketfs_utils_python.upload + +Module contents +--------------- + +.. automodule:: exasol_bucketfs_utils_python + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/exasol_bucketfs_utils_python.upload.rst b/doc/api/exasol_bucketfs_utils_python.upload.rst new file mode 100644 index 00000000..6fd3755c --- /dev/null +++ b/doc/api/exasol_bucketfs_utils_python.upload.rst @@ -0,0 +1,7 @@ +exasol\_bucketfs\_utils\_python.upload module +============================================= + +.. automodule:: exasol_bucketfs_utils_python.upload + :members: + :undoc-members: + :show-inheritance: diff --git a/conf.py b/doc/conf.py similarity index 92% rename from conf.py rename to doc/conf.py index b8089aab..775a9765 100644 --- a/conf.py +++ b/doc/conf.py @@ -31,10 +31,16 @@ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', - 'sphinx_automodapi.automodapi', - 'sphinx_automodapi.smart_resolver', + 'sphinx.ext.autosummary', + 'myst_parser' ] +source_suffix = { + '.rst': 'restructuredtext', + '.txt': 'markdown', + '.md': 'markdown', +} + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/dependencies.md b/doc/dependencies.md new file mode 100644 index 00000000..13245374 --- /dev/null +++ b/doc/dependencies.md @@ -0,0 +1,24 @@ +## Dependencies + +### Run Time Dependencies + +| Dependency | Purpose | License | +|-------------------------------|----------------------------------|--------------------| +| [Python 3][python] | Python version 3.6.1 and above | PSF | +| [Requests][requests] | Allows to send HTTP/1.1 requests | Apache License 2.0 | + + +### Test Dependencies + +| Dependency | Purpose | License | +|-------------------------------|-----------------------------------|-------------------| +| [Pytest][pytest] | Testing framework | MIT | +| [Pytest Coverage][pytest-cov] | Tests coverage | MIT | + + + +[python]: https://docs.python.org +[requests]: https://pypi.org/project/requests/ + +[pytest]: https://docs.pytest.org/en/stable/ +[pytest-cov]: https://pypi.org/project/pytest-cov/ diff --git a/doc/exasol_bucketfs_utils_python.rst b/doc/exasol_bucketfs_utils_python.rst deleted file mode 100644 index 58ffbacd..00000000 --- a/doc/exasol_bucketfs_utils_python.rst +++ /dev/null @@ -1,77 +0,0 @@ -exasol\_bucketfs\_utils\_python package -======================================= - -Submodules ----------- - -exasol\_bucketfs\_utils\_python.bucket\_config module ------------------------------------------------------ - -.. automodule:: exasol_bucketfs_utils_python.bucket_config - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.bucketfs\_config module -------------------------------------------------------- - -.. automodule:: exasol_bucketfs_utils_python.bucketfs_config - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.bucketfs\_connection\_config module -------------------------------------------------------------------- - -.. automodule:: exasol_bucketfs_utils_python.bucketfs_connection_config - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.bucketfs\_utils module ------------------------------------------------------- - -.. automodule:: exasol_bucketfs_utils_python.bucketfs_utils - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.download module ------------------------------------------------ - -.. automodule:: exasol_bucketfs_utils_python.download - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.github\_release\_file\_bucketfs\_uploader module --------------------------------------------------------------------------------- - -.. automodule:: exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.release\_link\_extractor module ---------------------------------------------------------------- - -.. automodule:: exasol_bucketfs_utils_python.release_link_extractor - :members: - :undoc-members: - :show-inheritance: - -exasol\_bucketfs\_utils\_python.upload module ---------------------------------------------- - -.. automodule:: exasol_bucketfs_utils_python.upload - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: exasol_bucketfs_utils_python - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 00000000..2fdd9433 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,30 @@ +##################### +BucketFS Utils Python +##################### + +.. include:: overview.rst + +***************** +Table of Contents +***************** + +.. toctree:: + :maxdepth: 2 + + user_guide/user_guide.md + +************* +API Reference +************* + +.. autosummary:: + :toctree: api + + exasol_bucketfs_utils_python + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/modules.rst b/doc/modules.rst deleted file mode 100644 index d2682e56..00000000 --- a/doc/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -exasol_bucketfs_utils_python -============================ - -.. toctree:: - :maxdepth: 4 - - exasol_bucketfs_utils_python diff --git a/doc/overview.rst b/doc/overview.rst new file mode 100644 index 00000000..7ff107be --- /dev/null +++ b/doc/overview.rst @@ -0,0 +1,29 @@ +******** +Overview +******** + +This project provides a python library for the Exasol BucketFS system. + +In a Nutshell +============= + +Prerequisites +------------- + +- Python 3.6+ + +Installation +------------- + +Install the package from Github via `pip`: + +``` +pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python +``` + +Features +======== + +* Object-based specification of BucketFS connection information +* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html)) +* Loading files directly from Github Releases diff --git a/doc/user_guide/examples.md b/doc/user_guide/examples.md new file mode 100644 index 00000000..6eb2daf0 --- /dev/null +++ b/doc/user_guide/examples.md @@ -0,0 +1,17 @@ +# Examples + +## Uploading GitHub Release to Bucket + +Example: + +```python +from exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader import GithubReleaseFileBucketFSUploader + +release_uploader = \ + GithubReleaseFileBucketFSUploader(file_to_download_name="file", + github_user="user", + repository_name="repository", + release_name="latest", + path_inside_bucket="some/path/") +release_uploader.upload("http://://", "user", "password") +``` diff --git a/doc/user_guide/user_guide.md b/doc/user_guide/user_guide.md new file mode 100644 index 00000000..aa2d91e0 --- /dev/null +++ b/doc/user_guide/user_guide.md @@ -0,0 +1,3 @@ +## User Guide + +The exasol-bucketfs-utils-python package is a library which provides basic functionalities to interact with Exasol's BucketFS from python. diff --git a/index.rst b/index.rst deleted file mode 100644 index 3cacb9ff..00000000 --- a/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. Exasol BucketFS Utils Python documentation master file, created by - sphinx-quickstart on Tue Mar 23 19:47:46 2021. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Exasol BucketFS Utils Python's documentation! -======================================================== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - doc/modules.rst - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/make.bat b/make.bat deleted file mode 100644 index 2119f510..00000000 --- a/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/pyproject.toml b/pyproject.toml index 498ff667..40ce9d3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ "Anastasiia Sergienko " ] -readme = 'README.md' +readme = 'README.rst' repository = "https://github.com/exasol/bucketfs-utils-python" homepage = "https://github.com/exasol/bucketfs-utils-python" @@ -27,9 +27,11 @@ typeguard = "^2.11.1" pytest = "^6.1.1" pytest-cov = "^2.10.1" Sphinx = "^3.5.3" -taskipy = "^1.6.0" -sphinx-automodapi = "^0.13" +poethepoet = "^0.10.0" +myst-parser = "^0.14.0" -[tool.taskipy.tasks] -html_docs = "make html" +[tool.poe.tasks] +build-html-doc = {shell = "cd $(git rev-parse --show-toplevel)/doc; make clean-build; make html" } +open-html-doc = { shell = "xdg-open doc/_build/html/index.html" } +open-build-html-doc [ "build-html-doc", "open-html-doc" ] test = "pytest tests" diff --git a/setup.py b/setup.py index 77f1347b..269fc328 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '# BucketFS Utils Python\n\nThis project provides a python library for the Exasol BucketFS system.\n\nFeatures:\n\n* [Uploading a GitHub release to a bucket](#uploading-github-release-to-bucket)\n\n## How to Use It\n\nInstall the package from Github via `pip`:\n \n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{ tag name }#egg=exasol-bucketfs-utils-python\n```\n\n## Uploading GitHub Release to Bucket\n\nExample:\n\n```python\nfrom exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader import GithubReleaseFileBucketFSUploader\n\nrelease_uploader = \\\n GithubReleaseFileBucketFSUploader(file_to_download_name="file",\n github_user="user",\n repository_name="repository",\n release_name="latest",\n path_inside_bucket="some/path/")\nrelease_uploader.upload("http://://", "user", "password")\n```\n\n### Run Time Dependencies\n\n| Dependency | Purpose | License |\n|-------------------------------|----------------------------------|--------------------|\n| [Python 3][python] | Python version 3.6.1 and above | PSF |\n| [Requests][requests] | Allows to send HTTP/1.1 requests | Apache License 2.0 |\n\n\n### Test Dependencies\n\n| Dependency | Purpose | License |\n|-------------------------------|-----------------------------------|-------------------|\n| [Pytest][pytest] | Testing framework | MIT |\n| [Pytest Coverage][pytest-cov] | Tests coverage | MIT |\n\n\n\n[python]: https://docs.python.org\n[requests]: https://pypi.org/project/requests/\n\n[pytest]: https://docs.pytest.org/en/stable/\n[pytest-cov]: https://pypi.org/project/pytest-cov/\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n.. include:: doc/overview.rst\n\n*****************\nTable of Contents\n*****************\n.. include::doc/overview.rst\n\nInformation for Users\n=====================\n\n* [User Guide](doc/user_guide/user_guide.md)\n* [Changelog](doc/changes/changelog.md)\n\nInformation for Developers\n==========================\n\n* [Developer Guide](doc/developer_guide/developer_guide.md)\n* [Dependencies](doc/dependencies.md)\n\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From 4ba663f9c20b0b97a36fb25b0ccb4eb6d59b1496 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Mon, 7 Jun 2021 19:33:32 +0200 Subject: [PATCH 03/38] Test rst references --- README.rst | 33 +++++++++++++++++-- doc/index.rst | 6 +--- doc/overview.rst | 29 ---------------- .../{user_guide.md => user_guide.rst} | 6 +++- setup.py | 2 +- 5 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 doc/overview.rst rename doc/user_guide/{user_guide.md => user_guide.rst} (73%) diff --git a/README.rst b/README.rst index 2b252e73..1511b0c3 100644 --- a/README.rst +++ b/README.rst @@ -2,16 +2,45 @@ BucketFS Utils Python ##################### -.. include:: doc/overview.rst +******** +Overview +******** + +This project provides a python library for the Exasol BucketFS system. + +In a Nutshell +============= + +Prerequisites +------------- + +- Python 3.6+ + +Installation +------------- + +Install the package from Github via `pip`: + +``` +pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python +``` + +Features +======== + +* Object-based specification of BucketFS connection information +* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html)) +* Loading files directly from Github Releases ***************** Table of Contents ***************** -.. include::doc/overview.rst Information for Users ===================== +:ref:`user-guide` + * [User Guide](doc/user_guide/user_guide.md) * [Changelog](doc/changes/changelog.md) diff --git a/doc/index.rst b/doc/index.rst index 2fdd9433..b10acf95 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,7 +1,3 @@ -##################### -BucketFS Utils Python -##################### - .. include:: overview.rst ***************** @@ -11,7 +7,7 @@ Table of Contents .. toctree:: :maxdepth: 2 - user_guide/user_guide.md + user_guide/user_guide.rst ************* API Reference diff --git a/doc/overview.rst b/doc/overview.rst deleted file mode 100644 index 7ff107be..00000000 --- a/doc/overview.rst +++ /dev/null @@ -1,29 +0,0 @@ -******** -Overview -******** - -This project provides a python library for the Exasol BucketFS system. - -In a Nutshell -============= - -Prerequisites -------------- - -- Python 3.6+ - -Installation -------------- - -Install the package from Github via `pip`: - -``` -pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python -``` - -Features -======== - -* Object-based specification of BucketFS connection information -* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html)) -* Loading files directly from Github Releases diff --git a/doc/user_guide/user_guide.md b/doc/user_guide/user_guide.rst similarity index 73% rename from doc/user_guide/user_guide.md rename to doc/user_guide/user_guide.rst index aa2d91e0..0d3e77c0 100644 --- a/doc/user_guide/user_guide.md +++ b/doc/user_guide/user_guide.rst @@ -1,3 +1,7 @@ -## User Guide +********** +User Guide +********** + +.. _user-guide: The exasol-bucketfs-utils-python package is a library which provides basic functionalities to interact with Exasol's BucketFS from python. diff --git a/setup.py b/setup.py index 269fc328..d3072dbe 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n.. include:: doc/overview.rst\n\n*****************\nTable of Contents\n*****************\n.. include::doc/overview.rst\n\nInformation for Users\n=====================\n\n* [User Guide](doc/user_guide/user_guide.md)\n* [Changelog](doc/changes/changelog.md)\n\nInformation for Developers\n==========================\n\n* [Developer Guide](doc/developer_guide/developer_guide.md)\n* [Dependencies](doc/dependencies.md)\n\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n\n*****************\nTable of Contents\n*****************\n\nInformation for Users\n=====================\n\n:ref:`user-guide`\n\n* [User Guide](doc/user_guide/user_guide.md)\n* [Changelog](doc/changes/changelog.md)\n\nInformation for Developers\n==========================\n\n* [Developer Guide](doc/developer_guide/developer_guide.md)\n* [Dependencies](doc/dependencies.md)\n\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From d8b4cd79c3ddcf34d2c974cb345226f791ff9fc4 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 11:18:36 +0200 Subject: [PATCH 04/38] Add deployment script for the documentation to github pages. Add .gitkeep for _static and _templates directory --- doc/_static/.gitkeep | 0 doc/_templates/.gitkeep | 0 doc/deploy-to-gh-pages.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 doc/_static/.gitkeep create mode 100644 doc/_templates/.gitkeep create mode 100644 doc/deploy-to-gh-pages.sh diff --git a/doc/_static/.gitkeep b/doc/_static/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/doc/_templates/.gitkeep b/doc/_templates/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/doc/deploy-to-gh-pages.sh b/doc/deploy-to-gh-pages.sh new file mode 100644 index 00000000..172eb1ea --- /dev/null +++ b/doc/deploy-to-gh-pages.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -euo pipefail + +TARGET_BRANCH="$1" + +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + +cleanup(){ + if [ -e "$WORKTREE" ] + then + echo "Cleanup git worktree $WORKTREE" + git worktree remove --force "$WORKTREE" || echo "Removing worktree $WORKTREE failed" + fi + echo "Cleanup temporary directory $TMP" + rm -rf $TMP +} + +TMP="$(mktemp -d)" +WORKTREE="$TMP/worktree" +BUILD_DIR="$TMP/build" +trap 'cleanup' EXIT; +git worktree add "$WORKTREE" "$TARGET_BRANCH" +sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" +rm -rf "$WORKTREE/"* +mv "$BUILD_DIR/html/"* "$WORKTREE/" +SOURCE_COMMIT_ID="$(git rev-parse HEAD)" +SOURCE_BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" +pushd "$WORKTREE" +echo "BRANCH=$SOURCE_BRANCH_NAME" > .source +echo "COMMIT_ID=$SOURCE_COMMIT_ID" >> .source +git add . +git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH_NAME' with commit id '$SOURCE_COMMIT_ID'" +popd +touch "$WORKTREE/.nojekyll" From 441006e34cfa28ba009da9c9da4af373c106e989 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 19:59:34 +0200 Subject: [PATCH 05/38] Add deployment scripts for sphinx documentation --- .../github_pages_docs_for_current.yaml | 26 ++++++++++ .../workflows/github_pages_docs_for_main.yaml | 26 ++++++++++ doc/deploy-to-gh-pages.sh | 35 ------------- doc/deploy-to-github-pages-current.sh | 23 ++++++++ doc/deploy-to-github-pages-main.sh | 15 ++++++ doc/deploy-to-github-pages.sh | 52 +++++++++++++++++++ pyproject.toml | 27 ++++++++-- 7 files changed, 166 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/github_pages_docs_for_current.yaml create mode 100644 .github/workflows/github_pages_docs_for_main.yaml delete mode 100644 doc/deploy-to-gh-pages.sh create mode 100644 doc/deploy-to-github-pages-current.sh create mode 100644 doc/deploy-to-github-pages-main.sh create mode 100644 doc/deploy-to-github-pages.sh diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml new file mode 100644 index 00000000..f7d004cb --- /dev/null +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -0,0 +1,26 @@ +name: Build and push documentation for current branch + +on: + push: + branches-ignore: + - main + +jobs: + create_github_pages_docs: + strategy: + fail-fast: false + matrix: + python-version: [3.6] + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install poetry + uses: abatilo/actions-poetry@v2.0.0 + - name: Test deploy documentation to github-pages-main branch + run: poetry run poe commit-html-doc-to-github-pages-current diff --git a/.github/workflows/github_pages_docs_for_main.yaml b/.github/workflows/github_pages_docs_for_main.yaml new file mode 100644 index 00000000..eee077c4 --- /dev/null +++ b/.github/workflows/github_pages_docs_for_main.yaml @@ -0,0 +1,26 @@ +name: Build and push documentation for main branch + +on: + push: + branches: + - main + +jobs: + create_github_pages_docs: + strategy: + fail-fast: false + matrix: + python-version: [3.6] + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install poetry + uses: abatilo/actions-poetry@v2.0.0 + - name: Deploy documentation to github-pages-main branch + run: poetry run poe push-html-doc-to-github-pages-main diff --git a/doc/deploy-to-gh-pages.sh b/doc/deploy-to-gh-pages.sh deleted file mode 100644 index 172eb1ea..00000000 --- a/doc/deploy-to-gh-pages.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -TARGET_BRANCH="$1" - -SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" - -cleanup(){ - if [ -e "$WORKTREE" ] - then - echo "Cleanup git worktree $WORKTREE" - git worktree remove --force "$WORKTREE" || echo "Removing worktree $WORKTREE failed" - fi - echo "Cleanup temporary directory $TMP" - rm -rf $TMP -} - -TMP="$(mktemp -d)" -WORKTREE="$TMP/worktree" -BUILD_DIR="$TMP/build" -trap 'cleanup' EXIT; -git worktree add "$WORKTREE" "$TARGET_BRANCH" -sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -rm -rf "$WORKTREE/"* -mv "$BUILD_DIR/html/"* "$WORKTREE/" -SOURCE_COMMIT_ID="$(git rev-parse HEAD)" -SOURCE_BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" -pushd "$WORKTREE" -echo "BRANCH=$SOURCE_BRANCH_NAME" > .source -echo "COMMIT_ID=$SOURCE_COMMIT_ID" >> .source -git add . -git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH_NAME' with commit id '$SOURCE_COMMIT_ID'" -popd -touch "$WORKTREE/.nojekyll" diff --git a/doc/deploy-to-github-pages-current.sh b/doc/deploy-to-github-pages-current.sh new file mode 100644 index 00000000..ef569c26 --- /dev/null +++ b/doc/deploy-to-github-pages-current.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +PUSH_ENABLED="$1" + +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" +if [ "$SOURCE_BRANCH" != "main" ] +then + BRANCH="github-pages/$SOURCE_BRANCH" + if [ -n "$SOURCE_BRANCH" ] + then + BRANCH="github-pages/$SOURCE_BRANCH" + bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$BRANCH" origin "$PUSH_ENABLED" + else + echo "ERROR: Could not acquire your current checked out branch. Please check the state of your " + fi +else + echo "ERROR: Source branch is not 'main', you are at branch '$SOURCE_BRANCH'" +fi \ No newline at end of file diff --git a/doc/deploy-to-github-pages-main.sh b/doc/deploy-to-github-pages-main.sh new file mode 100644 index 00000000..8b3cf103 --- /dev/null +++ b/doc/deploy-to-github-pages-main.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +PUSH_ENABLED="$1" + +set -euo pipefail + +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" +if [ "$SOURCE_BRANCH" == "main" ] +then + BRANCH="github-pages/main" + bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$BRANCH" origin "$PUSH_ENABLED" +else + echo "Abort. Source branch is not 'main', you are at branch '$SOURCE_BRANCH'" +fi diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh new file mode 100644 index 00000000..957026a4 --- /dev/null +++ b/doc/deploy-to-github-pages.sh @@ -0,0 +1,52 @@ +#!/bin/bash +set -x +PUSH_ORIGIN="$2" +PUSH_ENABLED="$3" + +set -euo pipefail + +TARGET_BRANCH="$1" + +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + +cleanup(){ + if [ -e "$WORKTREE" ] + then + echo "Cleanup git worktree $WORKTREE" + git worktree remove --force "$WORKTREE" || echo "Removing worktree $WORKTREE failed" + fi + echo "Cleanup temporary directory $TMP" + rm -rf "$TMP" +} + +TMP="$(mktemp -d)" +WORKTREE="$TMP/worktree" +BUILD_DIR="$TMP/build" +trap 'cleanup' EXIT; +TARGET_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" +if [ -n "$TARGET_BRANCH_EXISTS" ] +then + echo "Checkout existing branch $TARGET_BRANCH" + git worktree add "$WORKTREE" "$TARGET_BRANCH" +else + echo "Checkout new branch $TARGET_BRANCH" + git worktree add -b "$TARGET_BRANCH" "$WORKTREE" github-pages/main +fi +sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -W +rm -rf "${WORKTREE:?}/"* +mv "$BUILD_DIR/html/"* "$WORKTREE/" +SOURCE_COMMIT_ID="$(git rev-parse HEAD)" +SOURCE_BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" +pushd "$WORKTREE" +echo "BRANCH=$SOURCE_BRANCH_NAME" > .source +echo "COMMIT_ID=$SOURCE_COMMIT_ID" >> .source +echo "Git commit" +git add . +git diff-index --quiet HEAD || git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH_NAME' with commit id '$SOURCE_COMMIT_ID'" +if [ -n "$PUSH_ORIGIN" ] && [ "$PUSH_ENABLED" == "push" ] +then + echo "Git push $PUSH_ORIGIN $TARGET_BRANCH" + git push "$PUSH_ORIGIN" "$TARGET_BRANCH" +fi +popd +touch "$WORKTREE/.nojekyll" diff --git a/pyproject.toml b/pyproject.toml index 40ce9d3f..ddd4f596 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,28 @@ poethepoet = "^0.10.0" myst-parser = "^0.14.0" [tool.poe.tasks] -build-html-doc = {shell = "cd $(git rev-parse --show-toplevel)/doc; make clean-build; make html" } -open-html-doc = { shell = "xdg-open doc/_build/html/index.html" } -open-build-html-doc [ "build-html-doc", "open-html-doc" ] +build-html-doc = {shell = """ + cd "$(git rev-parse --show-toplevel)/doc"; + make clean-build; make html + """ } +open-html-doc = { shell = """ + cd "$(git rev-parse --show-toplevel)/doc"; + xdg-open _build/html/index.html""" } +build-and-open-html-doc = [ "build-html-doc", "open-html-doc" ] +commit-html-doc-to-github-pages-main = { shell = """ + cd $(git rev-parse --show-toplevel)/doc; + bash deploy-to-github-pages-main.sh commit""" } + +push-html-doc-to-github-pages-main = { shell = """ + cd $(git rev-parse --show-toplevel)/doc; + bash deploy-to-github-pages-main.sh push""" } + +commit-html-doc-to-github-pages-current = { shell = """ + cd $(git rev-parse --show-toplevel)/doc; + bash deploy-to-github-pages-current.sh commit""" } + +push-html-doc-to-github-pages-current = { shell = """ + cd $(git rev-parse --show-toplevel)/doc; + bash deploy-to-github-pages-current.sh push""" } + test = "pytest tests" From 9f201f34365fd40b9ea011011906bd7e6ccc7c0e Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:05:17 +0200 Subject: [PATCH 06/38] Update poetry version in CI --- .github/workflows/check_setup_py.yaml | 2 ++ .github/workflows/github_pages_docs_for_current.yaml | 2 ++ .github/workflows/github_pages_docs_for_main.yaml | 2 ++ .github/workflows/pytest.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/check_setup_py.yaml b/.github/workflows/check_setup_py.yaml index eec2d710..35835a2e 100644 --- a/.github/workflows/check_setup_py.yaml +++ b/.github/workflows/check_setup_py.yaml @@ -16,6 +16,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.1.4 - name: Run packaging update run: bash githooks/update_setup_py.sh - name: Show changes on working copy diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index f7d004cb..38351aed 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -22,5 +22,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install poetry uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.1.4 - name: Test deploy documentation to github-pages-main branch run: poetry run poe commit-html-doc-to-github-pages-current diff --git a/.github/workflows/github_pages_docs_for_main.yaml b/.github/workflows/github_pages_docs_for_main.yaml index eee077c4..50003ad7 100644 --- a/.github/workflows/github_pages_docs_for_main.yaml +++ b/.github/workflows/github_pages_docs_for_main.yaml @@ -22,5 +22,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install poetry uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.1.4 - name: Deploy documentation to github-pages-main branch run: poetry run poe push-html-doc-to-github-pages-main diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index b26fc374..afe7f132 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -16,6 +16,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.1.4 - name: Poetry install run: poetry install - name: Poetry build From bc66fc01ae1ffb253c36833b6c0de582860d657d Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:07:41 +0200 Subject: [PATCH 07/38] Add poetry install to install packages --- .github/workflows/check_setup_py.yaml | 2 ++ .github/workflows/github_pages_docs_for_current.yaml | 2 ++ .github/workflows/github_pages_docs_for_main.yaml | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_setup_py.yaml b/.github/workflows/check_setup_py.yaml index 35835a2e..444f9d7d 100644 --- a/.github/workflows/check_setup_py.yaml +++ b/.github/workflows/check_setup_py.yaml @@ -18,6 +18,8 @@ jobs: - uses: abatilo/actions-poetry@v2.0.0 with: poetry-version: 1.1.4 + - name: Poetry install + run: poetry install - name: Run packaging update run: bash githooks/update_setup_py.sh - name: Show changes on working copy diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index 38351aed..6c46f79f 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -24,5 +24,7 @@ jobs: uses: abatilo/actions-poetry@v2.0.0 with: poetry-version: 1.1.4 + - name: Poetry install + run: poetry install - name: Test deploy documentation to github-pages-main branch run: poetry run poe commit-html-doc-to-github-pages-current diff --git a/.github/workflows/github_pages_docs_for_main.yaml b/.github/workflows/github_pages_docs_for_main.yaml index 50003ad7..8d0ad2c1 100644 --- a/.github/workflows/github_pages_docs_for_main.yaml +++ b/.github/workflows/github_pages_docs_for_main.yaml @@ -24,5 +24,8 @@ jobs: uses: abatilo/actions-poetry@v2.0.0 with: poetry-version: 1.1.4 + - name: Poetry install + run: poetry install - name: Deploy documentation to github-pages-main branch - run: poetry run poe push-html-doc-to-github-pages-main + run: | + poetry run poe push-html-doc-to-github-pages-main From 4c2665d75faf6bcb0ab1a9e113a73917cc9f5d95 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:13:41 +0200 Subject: [PATCH 08/38] Ignore github-pages/* branches --- .github/workflows/check_setup_py.yaml | 5 ++++- .github/workflows/github_pages_docs_for_current.yaml | 1 + .github/workflows/github_pages_docs_for_main.yaml | 2 ++ .github/workflows/pytest.yaml | 5 ++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_setup_py.yaml b/.github/workflows/check_setup_py.yaml index 444f9d7d..1a930674 100644 --- a/.github/workflows/check_setup_py.yaml +++ b/.github/workflows/check_setup_py.yaml @@ -1,6 +1,9 @@ name: Check if setup.py is up to date -on: [push, pull_request] +on: + push: + branches-ignore: + - github-pages/* jobs: check_setup_py: diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index 6c46f79f..91f609cc 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -4,6 +4,7 @@ on: push: branches-ignore: - main + - github-pages/* jobs: create_github_pages_docs: diff --git a/.github/workflows/github_pages_docs_for_main.yaml b/.github/workflows/github_pages_docs_for_main.yaml index 8d0ad2c1..1bc4888f 100644 --- a/.github/workflows/github_pages_docs_for_main.yaml +++ b/.github/workflows/github_pages_docs_for_main.yaml @@ -4,6 +4,8 @@ on: push: branches: - main + branches-ignore: + - github-pages/* jobs: create_github_pages_docs: diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index afe7f132..3dd71c49 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -1,6 +1,9 @@ name: Run pytest tests -on: [ push, pull_request ] +on: + push: + branches-ignore: + - github-pages/* jobs: integration_tests: From 1a0e039d168879d9b8ce935a2ad5ae920ce5cc5e Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:18:05 +0200 Subject: [PATCH 09/38] Remove markdown residuals from README --- README.rst | 6 ------ setup.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 1511b0c3..e2316bff 100644 --- a/README.rst +++ b/README.rst @@ -41,12 +41,6 @@ Information for Users :ref:`user-guide` -* [User Guide](doc/user_guide/user_guide.md) -* [Changelog](doc/changes/changelog.md) - Information for Developers ========================== -* [Developer Guide](doc/developer_guide/developer_guide.md) -* [Dependencies](doc/dependencies.md) - diff --git a/setup.py b/setup.py index d3072dbe..be84a91b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n\n*****************\nTable of Contents\n*****************\n\nInformation for Users\n=====================\n\n:ref:`user-guide`\n\n* [User Guide](doc/user_guide/user_guide.md)\n* [Changelog](doc/changes/changelog.md)\n\nInformation for Developers\n==========================\n\n* [Developer Guide](doc/developer_guide/developer_guide.md)\n* [Dependencies](doc/dependencies.md)\n\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n\n*****************\nTable of Contents\n*****************\n\nInformation for Users\n=====================\n\n:ref:`user-guide`\n\nInformation for Developers\n==========================\n\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From 70f67198daaf774f668e9361a33976c8c4cb0cbc Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:19:35 +0200 Subject: [PATCH 10/38] add git fetch into github_pages_docs* CI scripts --- .github/workflows/github_pages_docs_for_current.yaml | 4 +++- .github/workflows/github_pages_docs_for_main.yaml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index 91f609cc..d9217d8e 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -28,4 +28,6 @@ jobs: - name: Poetry install run: poetry install - name: Test deploy documentation to github-pages-main branch - run: poetry run poe commit-html-doc-to-github-pages-current + run: | + git fetch + poetry run poe commit-html-doc-to-github-pages-current diff --git a/.github/workflows/github_pages_docs_for_main.yaml b/.github/workflows/github_pages_docs_for_main.yaml index 1bc4888f..f5afb889 100644 --- a/.github/workflows/github_pages_docs_for_main.yaml +++ b/.github/workflows/github_pages_docs_for_main.yaml @@ -30,4 +30,5 @@ jobs: run: poetry install - name: Deploy documentation to github-pages-main branch run: | + git fetch poetry run poe push-html-doc-to-github-pages-main From 05ee4d084ed2eae8a25ac331687f27887b2c21cd Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:21:15 +0200 Subject: [PATCH 11/38] Remove ref to user guide from README --- README.rst | 2 -- setup.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.rst b/README.rst index e2316bff..9db63d23 100644 --- a/README.rst +++ b/README.rst @@ -39,8 +39,6 @@ Table of Contents Information for Users ===================== -:ref:`user-guide` - Information for Developers ========================== diff --git a/setup.py b/setup.py index be84a91b..88e60f4b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n\n*****************\nTable of Contents\n*****************\n\nInformation for Users\n=====================\n\n:ref:`user-guide`\n\nInformation for Developers\n==========================\n\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n\n*****************\nTable of Contents\n*****************\n\nInformation for Users\n=====================\n\nInformation for Developers\n==========================\n\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From 86df39d7652d9c7733c4c292ad22fdacc84f4ff5 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:24:46 +0200 Subject: [PATCH 12/38] Test checkout in CI if it is sufficient for commit-html-doc-to-github-pages-current --- .github/workflows/github_pages_docs_for_current.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index d9217d8e..59c82def 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -30,4 +30,6 @@ jobs: - name: Test deploy documentation to github-pages-main branch run: | git fetch - poetry run poe commit-html-doc-to-github-pages-current + git branch -v + git checkout github-pages/main + #poetry run poe commit-html-doc-to-github-pages-current From 9674a586fcaa042c61a3f2f00e093fb9ff851868 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:25:59 +0200 Subject: [PATCH 13/38] Remove empty headlines from README --- README.rst | 11 ----------- setup.py | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 9db63d23..1a110859 100644 --- a/README.rst +++ b/README.rst @@ -31,14 +31,3 @@ Features * Object-based specification of BucketFS connection information * Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html)) * Loading files directly from Github Releases - -***************** -Table of Contents -***************** - -Information for Users -===================== - -Information for Developers -========================== - diff --git a/setup.py b/setup.py index 88e60f4b..1e11276b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n\n*****************\nTable of Contents\n*****************\n\nInformation for Users\n=====================\n\nInformation for Developers\n==========================\n\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From 3f40cfa50bed9fa9db579007612201877b4e6d57 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:29:51 +0200 Subject: [PATCH 14/38] debug github CI github_pages_docs_for_current.yaml --- .github/workflows/github_pages_docs_for_current.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index 59c82def..266a1d28 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -31,5 +31,4 @@ jobs: run: | git fetch git branch -v - git checkout github-pages/main - #poetry run poe commit-html-doc-to-github-pages-current + poetry run poe commit-html-doc-to-github-pages-current From 1c4675ea17c40360d1ab52710781815bbf71da1a Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:34:41 +0200 Subject: [PATCH 15/38] debug github CI github_pages_docs_for_current.yaml --- doc/deploy-to-github-pages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 957026a4..d808b7dd 100644 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -30,7 +30,7 @@ then git worktree add "$WORKTREE" "$TARGET_BRANCH" else echo "Checkout new branch $TARGET_BRANCH" - git worktree add -b "$TARGET_BRANCH" "$WORKTREE" github-pages/main + git worktree add -b "$TARGET_BRANCH" "$WORKTREE" "github-pages/main" fi sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -W rm -rf "${WORKTREE:?}/"* From bd3494f0d56a11610c758be8ba6b10d503bed62e Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:38:22 +0200 Subject: [PATCH 16/38] debug github CI github_pages_docs_for_current.yaml --- pyproject.toml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ddd4f596..57a6f910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,20 +39,10 @@ open-html-doc = { shell = """ cd "$(git rev-parse --show-toplevel)/doc"; xdg-open _build/html/index.html""" } build-and-open-html-doc = [ "build-html-doc", "open-html-doc" ] -commit-html-doc-to-github-pages-main = { shell = """ - cd $(git rev-parse --show-toplevel)/doc; - bash deploy-to-github-pages-main.sh commit""" } -push-html-doc-to-github-pages-main = { shell = """ - cd $(git rev-parse --show-toplevel)/doc; - bash deploy-to-github-pages-main.sh push""" } - -commit-html-doc-to-github-pages-current = { shell = """ - cd $(git rev-parse --show-toplevel)/doc; - bash deploy-to-github-pages-current.sh commit""" } - -push-html-doc-to-github-pages-current = { shell = """ - cd $(git rev-parse --show-toplevel)/doc; - bash deploy-to-github-pages-current.sh push""" } +commit-html-doc-to-github-pages-main = { shell = "cd $(git rev-parse --show-toplevel)/doc; bash deploy-to-github-pages-main.sh commit" } +push-html-doc-to-github-pages-main = { shell = "cd $(git rev-parse --show-toplevel)/doc; bash deploy-to-github-pages-main.sh push" } +commit-html-doc-to-github-pages-current = { shell = "cd $(git rev-parse --show-toplevel)/doc; bash deploy-to-github-pages-current.sh commit" } +push-html-doc-to-github-pages-current = { shell = "cd $(git rev-parse --show-toplevel)/doc; bash deploy-to-github-pages-current.sh push" } test = "pytest tests" From 8644311c614d930187ec845cf881b5280c278b6d Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:41:35 +0200 Subject: [PATCH 17/38] debug github CI github_pages_docs_for_current.yaml --- .github/workflows/github_pages_docs_for_current.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/github_pages_docs_for_current.yaml index 266a1d28..c61bf6da 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/github_pages_docs_for_current.yaml @@ -29,6 +29,7 @@ jobs: run: poetry install - name: Test deploy documentation to github-pages-main branch run: | + git version git fetch git branch -v poetry run poe commit-html-doc-to-github-pages-current From f879efc06d794ddbfa28f3d562ab71ace74a7665 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 20:56:40 +0200 Subject: [PATCH 18/38] Use workaround to set new github-pages branch to the correct commit id --- doc/deploy-to-github-pages.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index d808b7dd..beb6602d 100644 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -30,7 +30,11 @@ then git worktree add "$WORKTREE" "$TARGET_BRANCH" else echo "Checkout new branch $TARGET_BRANCH" - git worktree add -b "$TARGET_BRANCH" "$WORKTREE" "github-pages/main" + git branch "$TARGET_BRANCH" + git worktree add "$WORKTREE" "$TARGET_BRANCH" + pushd "$WORKTREE" + git reset --hard "github-pages/main" + popd fi sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -W rm -rf "${WORKTREE:?}/"* From 5ff05322ecfac64a813a7e6daac07c4a815778cd Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Tue, 8 Jun 2021 21:03:39 +0200 Subject: [PATCH 19/38] debug github CI github_pages_docs_for_current.yaml --- doc/deploy-to-github-pages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index beb6602d..518d327a 100644 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -33,7 +33,7 @@ else git branch "$TARGET_BRANCH" git worktree add "$WORKTREE" "$TARGET_BRANCH" pushd "$WORKTREE" - git reset --hard "github-pages/main" + git reset --hard "origin/github-pages/main" popd fi sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -W From fdc78138f3536429175a93801e532f866cd5b91d Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Wed, 9 Jun 2021 20:28:27 +0200 Subject: [PATCH 20/38] Fix structure of sphinx docu and start with content conversion --- README.rst | 5 +++++ doc/changes/changelog.md | 3 --- doc/changes/changelog.rst | 6 ++++++ doc/dependencies.md | 6 +++--- doc/index.rst | 8 +++++--- .../{examples.md => upload_github_release_to_bucket.py} | 8 -------- doc/user_guide/upload_github_release_to_bucket.rst | 6 ++++++ doc/user_guide/user_guide.rst | 5 +++-- .../github_release_file_bucketfs_uploader.py | 4 +++- setup.py | 2 +- 10 files changed, 32 insertions(+), 21 deletions(-) delete mode 100644 doc/changes/changelog.md create mode 100644 doc/changes/changelog.rst rename doc/user_guide/{examples.md => upload_github_release_to_bucket.py} (87%) create mode 100644 doc/user_guide/upload_github_release_to_bucket.rst diff --git a/README.rst b/README.rst index 1a110859..72528295 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,11 @@ Install the package from Github via `pip`: pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python ``` +Documentation +------------- + +`Documentation for the latest release text `_ is hosted on the Github Pages of this project. + Features ======== diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md deleted file mode 100644 index 387930a1..00000000 --- a/doc/changes/changelog.md +++ /dev/null @@ -1,3 +0,0 @@ -# Changelog - -* [0.1.0](changes_0.1.0.md) \ No newline at end of file diff --git a/doc/changes/changelog.rst b/doc/changes/changelog.rst new file mode 100644 index 00000000..634a28f3 --- /dev/null +++ b/doc/changes/changelog.rst @@ -0,0 +1,6 @@ +***************** +Changelog +***************** + +.. toctree:: + changes_0.1.0.md diff --git a/doc/dependencies.md b/doc/dependencies.md index 13245374..4421031f 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -1,6 +1,6 @@ -## Dependencies +# Dependencies -### Run Time Dependencies +## Run Time Dependencies | Dependency | Purpose | License | |-------------------------------|----------------------------------|--------------------| @@ -8,7 +8,7 @@ | [Requests][requests] | Allows to send HTTP/1.1 requests | Apache License 2.0 | -### Test Dependencies +## Test Dependencies | Dependency | Purpose | License | |-------------------------------|-----------------------------------|-------------------| diff --git a/doc/index.rst b/doc/index.rst index b10acf95..b7ecbf6b 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,13 +1,15 @@ -.. include:: overview.rst +.. include:: ../README.rst ***************** Table of Contents ***************** .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - user_guide/user_guide.rst + user_guide/user_guide + dependencies + changes/changelog ************* API Reference diff --git a/doc/user_guide/examples.md b/doc/user_guide/upload_github_release_to_bucket.py similarity index 87% rename from doc/user_guide/examples.md rename to doc/user_guide/upload_github_release_to_bucket.py index 6eb2daf0..362c491e 100644 --- a/doc/user_guide/examples.md +++ b/doc/user_guide/upload_github_release_to_bucket.py @@ -1,10 +1,3 @@ -# Examples - -## Uploading GitHub Release to Bucket - -Example: - -```python from exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader import GithubReleaseFileBucketFSUploader release_uploader = \ @@ -14,4 +7,3 @@ release_name="latest", path_inside_bucket="some/path/") release_uploader.upload("http://://", "user", "password") -``` diff --git a/doc/user_guide/upload_github_release_to_bucket.rst b/doc/user_guide/upload_github_release_to_bucket.rst new file mode 100644 index 00000000..e17e56cb --- /dev/null +++ b/doc/user_guide/upload_github_release_to_bucket.rst @@ -0,0 +1,6 @@ +********************************** +Uploading GitHub Release to Bucket +********************************** + +.. literalinclude:: upload_github_release_to_bucket.py + :language: python3 \ No newline at end of file diff --git a/doc/user_guide/user_guide.rst b/doc/user_guide/user_guide.rst index 0d3e77c0..5428bf4c 100644 --- a/doc/user_guide/user_guide.rst +++ b/doc/user_guide/user_guide.rst @@ -2,6 +2,7 @@ User Guide ********** -.. _user-guide: +.. toctree:: + :maxdepth: 1 -The exasol-bucketfs-utils-python package is a library which provides basic functionalities to interact with Exasol's BucketFS from python. + upload_github_release_to_bucket diff --git a/exasol_bucketfs_utils_python/github_release_file_bucketfs_uploader.py b/exasol_bucketfs_utils_python/github_release_file_bucketfs_uploader.py index f5d94b7b..530156bd 100644 --- a/exasol_bucketfs_utils_python/github_release_file_bucketfs_uploader.py +++ b/exasol_bucketfs_utils_python/github_release_file_bucketfs_uploader.py @@ -15,9 +15,11 @@ def __init__(self, file_to_download_name, github_user, repository_name, release_ def upload(self, address, username, password): """ This method uploads the GitHub release into a selected Exasol bucket. - :param address: address in the format 'http://:/' + + :param address: address in the format :samp:`http://{host}:{port}/{bucket name}` :param username: bucket writing username :param password: bucket writing password + :return: none """ download_url = self.__extract_download_url() r_download = requests.get(download_url, stream=True) diff --git a/setup.py b/setup.py index 1e11276b..03c1bff5 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nDocumentation\n-------------\n\n`Documentation for the latest release text `_ is hosted on the Github Pages of this project.\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From c157eea88febdea18a721ff99dde2064edf4dd83 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Thu, 10 Jun 2021 19:35:03 +0200 Subject: [PATCH 21/38] Allow multiple versions of the documentation live in the same branch. We need this provide the documentation for all available versions. --- ... check_github_pages_docs_for_current.yaml} | 2 +- ...=> deploy_github_pages_docs_for_main.yaml} | 0 doc/deploy-to-github-pages-current.sh | 13 +- doc/deploy-to-github-pages-main.sh | 7 +- doc/deploy-to-github-pages.sh | 123 ++++++++++++------ 5 files changed, 92 insertions(+), 53 deletions(-) rename .github/workflows/{github_pages_docs_for_current.yaml => check_github_pages_docs_for_current.yaml} (93%) rename .github/workflows/{github_pages_docs_for_main.yaml => deploy_github_pages_docs_for_main.yaml} (100%) diff --git a/.github/workflows/github_pages_docs_for_current.yaml b/.github/workflows/check_github_pages_docs_for_current.yaml similarity index 93% rename from .github/workflows/github_pages_docs_for_current.yaml rename to .github/workflows/check_github_pages_docs_for_current.yaml index c61bf6da..d5a43284 100644 --- a/.github/workflows/github_pages_docs_for_current.yaml +++ b/.github/workflows/check_github_pages_docs_for_current.yaml @@ -1,4 +1,4 @@ -name: Build and push documentation for current branch +name: Build and check documentation for current branch on: push: diff --git a/.github/workflows/github_pages_docs_for_main.yaml b/.github/workflows/deploy_github_pages_docs_for_main.yaml similarity index 100% rename from .github/workflows/github_pages_docs_for_main.yaml rename to .github/workflows/deploy_github_pages_docs_for_main.yaml diff --git a/doc/deploy-to-github-pages-current.sh b/doc/deploy-to-github-pages-current.sh index ef569c26..effd0eb8 100644 --- a/doc/deploy-to-github-pages-current.sh +++ b/doc/deploy-to-github-pages-current.sh @@ -8,16 +8,13 @@ SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" -if [ "$SOURCE_BRANCH" != "main" ] -then - BRANCH="github-pages/$SOURCE_BRANCH" - if [ -n "$SOURCE_BRANCH" ] - then - BRANCH="github-pages/$SOURCE_BRANCH" - bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$BRANCH" origin "$PUSH_ENABLED" +if [ "$SOURCE_BRANCH" != "main" ]; then + if [ -n "$SOURCE_BRANCH" ]; then + TARGET_BRANCH="github-pages/$SOURCE_BRANCH" + bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$TARGET_BRANCH" origin "$PUSH_ENABLED" "$SOURCE_BRANCH" else echo "ERROR: Could not acquire your current checked out branch. Please check the state of your " fi else echo "ERROR: Source branch is not 'main', you are at branch '$SOURCE_BRANCH'" -fi \ No newline at end of file +fi diff --git a/doc/deploy-to-github-pages-main.sh b/doc/deploy-to-github-pages-main.sh index 8b3cf103..c7a7685a 100644 --- a/doc/deploy-to-github-pages-main.sh +++ b/doc/deploy-to-github-pages-main.sh @@ -6,10 +6,9 @@ set -euo pipefail SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" -if [ "$SOURCE_BRANCH" == "main" ] -then - BRANCH="github-pages/main" - bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$BRANCH" origin "$PUSH_ENABLED" +if [ "$SOURCE_BRANCH" == "main" ]; then + TARGET_BRANCH="github-pages/main" + bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$TARGET_BRANCH" origin "$PUSH_ENABLED" "$SOURCE_BRANCH" else echo "Abort. Source branch is not 'main', you are at branch '$SOURCE_BRANCH'" fi diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 518d327a..8570fccb 100644 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -2,55 +2,98 @@ set -x PUSH_ORIGIN="$2" PUSH_ENABLED="$3" +SOURCE_BRANCH="$4" set -euo pipefail -TARGET_BRANCH="$1" - -SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +detect_source_branch() { + CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" + if [ -z "$SOURCE_BRANCH" ]; then + if [ -z "$CURRENT_BRANCH" ]; then + echo "Abort. Could detect current branch and no source branch given." + exit 1 + fi + SOURCE_BRANCH="$CURRENT_BRANCH" + fi + if [ "$SOURCE_BRANCH" != "$CURRENT_BRANCH" ]; then + echo "Abort. Specified Source Branch doesn't correspond to the currently checked out branch $CURRENT_BRANCH." + exit 1 + fi +} -cleanup(){ - if [ -e "$WORKTREE" ] - then +cleanup_trap() { + if [ -e "$WORKTREE" ]; then echo "Cleanup git worktree $WORKTREE" - git worktree remove --force "$WORKTREE" || echo "Removing worktree $WORKTREE failed" + git worktree remove --force "$WORKTREE" || echo "Removing worktree $WORKTREE failed" fi echo "Cleanup temporary directory $TMP" - rm -rf "$TMP" + rm -rf "$TMP" +} + +checkout_target_branch_as_worktree() { + TARGET_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" + if [ -n "$TARGET_BRANCH_EXISTS" ]; then + echo "Checkout existing branch $TARGET_BRANCH" + git worktree add "$WORKTREE" "$TARGET_BRANCH" + else + echo "Checkout new branch $TARGET_BRANCH" + git branch "$TARGET_BRANCH" + git worktree add "$WORKTREE" "$TARGET_BRANCH" + pushd "$WORKTREE" + git reset --hard "$SOURCE_BRANCH" + popd + fi +} + +build_and_copy_documentation() { + echo "Build with sphinx" + sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -W + + echo "Generated HTML Output" + HTML_OUTPUT_DIR="$BUILD_DIR/html/" + ls -la "$HTML_OUTPUT_DIR" + + OUTPUT_DIR="${WORKTREE:?}/${SOURCE_BRANCH:?}" + if [ -e "${OUTPUT_DIR}" ]; then + echo "Removing existing output directory $OUTPUT_DIR" + rm -rf "${OUTPUT_DIR}" + fi + echo "Creating output directory $OUTPUT_DIR" + mkdir -p "$OUTPUT_DIR" + echo "Copying HTML output $HTML_OUTPUT_DIR to the output directory $OUTPUT_DIR" + find "$HTML_OUTPUT_DIR" -mindepth 1 -maxdepth 1 -exec mv -t "$OUTPUT_DIR" -- {} + + echo "Content of output directory $OUTPUT_DIR" + touch "$WORKTREE/.nojekyll" + ls -la "$OUTPUT_DIR" } +git_commit_and_push() { + pushd "$WORKTREE" + echo "Git commit" + echo "BRANCH=$SOURCE_BRANCH" >.source + echo "COMMIT_ID=$CURRENT_COMMIT_ID" >>.source + git add . + git diff-index --quiet HEAD || git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH' with commit id '$CURRENT_COMMIT_ID'" + if [ -n "$PUSH_ORIGIN" ] && [ "$PUSH_ENABLED" == "push" ]; then + git config --local user.email "opensource@exasol.com" + git config --local user.name "GitHub Action" + echo "Git push $PUSH_ORIGIN $TARGET_BRANCH" + git push "$PUSH_ORIGIN" "$TARGET_BRANCH" + fi + popd +} + +SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + TMP="$(mktemp -d)" WORKTREE="$TMP/worktree" BUILD_DIR="$TMP/build" -trap 'cleanup' EXIT; -TARGET_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" -if [ -n "$TARGET_BRANCH_EXISTS" ] -then - echo "Checkout existing branch $TARGET_BRANCH" - git worktree add "$WORKTREE" "$TARGET_BRANCH" -else - echo "Checkout new branch $TARGET_BRANCH" - git branch "$TARGET_BRANCH" - git worktree add "$WORKTREE" "$TARGET_BRANCH" - pushd "$WORKTREE" - git reset --hard "origin/github-pages/main" - popd -fi -sphinx-build -M html "$SCRIPT_DIR" "$BUILD_DIR" -W -rm -rf "${WORKTREE:?}/"* -mv "$BUILD_DIR/html/"* "$WORKTREE/" -SOURCE_COMMIT_ID="$(git rev-parse HEAD)" -SOURCE_BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" -pushd "$WORKTREE" -echo "BRANCH=$SOURCE_BRANCH_NAME" > .source -echo "COMMIT_ID=$SOURCE_COMMIT_ID" >> .source -echo "Git commit" -git add . -git diff-index --quiet HEAD || git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH_NAME' with commit id '$SOURCE_COMMIT_ID'" -if [ -n "$PUSH_ORIGIN" ] && [ "$PUSH_ENABLED" == "push" ] -then - echo "Git push $PUSH_ORIGIN $TARGET_BRANCH" - git push "$PUSH_ORIGIN" "$TARGET_BRANCH" -fi -popd -touch "$WORKTREE/.nojekyll" +trap 'cleanup_trap' EXIT + +TARGET_BRANCH="$1" +CURRENT_COMMIT_ID="$(git rev-parse HEAD)" + +detect_source_branch +checkout_target_branch_as_worktree +build_and_copy_documentation +git_commit_and_push From af8859ee683cfa00cd7513d3767cbc76ad9026f9 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Thu, 10 Jun 2021 19:44:30 +0200 Subject: [PATCH 22/38] Move git user config before the git commit for the deployment --- doc/deploy-to-github-pages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 8570fccb..4c8d627c 100644 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -73,10 +73,10 @@ git_commit_and_push() { echo "BRANCH=$SOURCE_BRANCH" >.source echo "COMMIT_ID=$CURRENT_COMMIT_ID" >>.source git add . + git config --local user.email "opensource@exasol.com" + git config --local user.name "GitHub Action" git diff-index --quiet HEAD || git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH' with commit id '$CURRENT_COMMIT_ID'" if [ -n "$PUSH_ORIGIN" ] && [ "$PUSH_ENABLED" == "push" ]; then - git config --local user.email "opensource@exasol.com" - git config --local user.name "GitHub Action" echo "Git push $PUSH_ORIGIN $TARGET_BRANCH" git push "$PUSH_ORIGIN" "$TARGET_BRANCH" fi From 7a825a586e0722ebea8411b31c26a4d2f4e16de6 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Fri, 11 Jun 2021 10:56:44 +0200 Subject: [PATCH 23/38] Fix review suggestions and check_github_pages_docs_for_feature_branch.yaml now pushes the target branch for testing and deletes it from the remote directly afterwards --- ...> check_github_pages_docs_for_feature_branch.yaml} | 11 ++++++----- .../workflows/deploy_github_pages_docs_for_main.yaml | 3 --- doc/deploy-to-github-pages-current.sh | 4 ++-- doc/deploy-to-github-pages-main.sh | 2 +- doc/deploy-to-github-pages.sh | 6 +++--- doc/get_target_branch_name.sh | 6 ++++++ 6 files changed, 18 insertions(+), 14 deletions(-) rename .github/workflows/{check_github_pages_docs_for_current.yaml => check_github_pages_docs_for_feature_branch.yaml} (61%) create mode 100644 doc/get_target_branch_name.sh diff --git a/.github/workflows/check_github_pages_docs_for_current.yaml b/.github/workflows/check_github_pages_docs_for_feature_branch.yaml similarity index 61% rename from .github/workflows/check_github_pages_docs_for_current.yaml rename to .github/workflows/check_github_pages_docs_for_feature_branch.yaml index d5a43284..53a0025d 100644 --- a/.github/workflows/check_github_pages_docs_for_current.yaml +++ b/.github/workflows/check_github_pages_docs_for_feature_branch.yaml @@ -1,4 +1,4 @@ -name: Build and check documentation for current branch +name: Check documentation build and deployment for feature branch on: push: @@ -27,9 +27,10 @@ jobs: poetry-version: 1.1.4 - name: Poetry install run: poetry install - - name: Test deploy documentation to github-pages-main branch + - name: Test documentation deployment for current feature branch run: | - git version git fetch - git branch -v - poetry run poe commit-html-doc-to-github-pages-current + SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" + TARGET_BRANCH="$(doc/get_target_branch_name.sh "$SOURCE_BRANCH")" + poetry run poe push-html-doc-to-github-pages-current || echo + git push origin --delete "$TARGET_BRANCH" diff --git a/.github/workflows/deploy_github_pages_docs_for_main.yaml b/.github/workflows/deploy_github_pages_docs_for_main.yaml index f5afb889..beb59fa6 100644 --- a/.github/workflows/deploy_github_pages_docs_for_main.yaml +++ b/.github/workflows/deploy_github_pages_docs_for_main.yaml @@ -4,9 +4,6 @@ on: push: branches: - main - branches-ignore: - - github-pages/* - jobs: create_github_pages_docs: strategy: diff --git a/doc/deploy-to-github-pages-current.sh b/doc/deploy-to-github-pages-current.sh index effd0eb8..605df1b2 100644 --- a/doc/deploy-to-github-pages-current.sh +++ b/doc/deploy-to-github-pages-current.sh @@ -10,11 +10,11 @@ SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" if [ "$SOURCE_BRANCH" != "main" ]; then if [ -n "$SOURCE_BRANCH" ]; then - TARGET_BRANCH="github-pages/$SOURCE_BRANCH" + TARGET_BRANCH="$("$SCRIPT_DIR/get_target_branch_name.sh" "$SOURCE_BRANCH")" bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$TARGET_BRANCH" origin "$PUSH_ENABLED" "$SOURCE_BRANCH" else echo "ERROR: Could not acquire your current checked out branch. Please check the state of your " fi else - echo "ERROR: Source branch is not 'main', you are at branch '$SOURCE_BRANCH'" + echo "ERROR: Source branch is 'main'." fi diff --git a/doc/deploy-to-github-pages-main.sh b/doc/deploy-to-github-pages-main.sh index c7a7685a..347a3fc6 100644 --- a/doc/deploy-to-github-pages-main.sh +++ b/doc/deploy-to-github-pages-main.sh @@ -7,7 +7,7 @@ set -euo pipefail SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" if [ "$SOURCE_BRANCH" == "main" ]; then - TARGET_BRANCH="github-pages/main" + TARGET_BRANCH="$("$SCRIPT_DIR/get_target_branch_name.sh" "main")" bash "$SCRIPT_DIR/deploy-to-github-pages.sh" "$TARGET_BRANCH" origin "$PUSH_ENABLED" "$SOURCE_BRANCH" else echo "Abort. Source branch is not 'main', you are at branch '$SOURCE_BRANCH'" diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 4c8d627c..bb207ddb 100644 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -6,11 +6,11 @@ SOURCE_BRANCH="$4" set -euo pipefail -detect_source_branch() { +detect_or_verify_source_branch() { CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" if [ -z "$SOURCE_BRANCH" ]; then if [ -z "$CURRENT_BRANCH" ]; then - echo "Abort. Could detect current branch and no source branch given." + echo "Abort. Could not detect current branch and no source branch given." exit 1 fi SOURCE_BRANCH="$CURRENT_BRANCH" @@ -93,7 +93,7 @@ trap 'cleanup_trap' EXIT TARGET_BRANCH="$1" CURRENT_COMMIT_ID="$(git rev-parse HEAD)" -detect_source_branch +detect_or_verify_source_branch checkout_target_branch_as_worktree build_and_copy_documentation git_commit_and_push diff --git a/doc/get_target_branch_name.sh b/doc/get_target_branch_name.sh new file mode 100644 index 00000000..eff883c2 --- /dev/null +++ b/doc/get_target_branch_name.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -euo pipefail + +BRANCH=$1 +echo "github-pages/$BRANCH" \ No newline at end of file From 53ae6e058bd46d528aafba853d2034a1bcd98a37 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Fri, 11 Jun 2021 11:14:01 +0200 Subject: [PATCH 24/38] Fix executable permissions for doc shell scripts --- doc/deploy-to-github-pages-current.sh | 0 doc/deploy-to-github-pages-main.sh | 0 doc/deploy-to-github-pages.sh | 0 doc/get_target_branch_name.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 doc/deploy-to-github-pages-current.sh mode change 100644 => 100755 doc/deploy-to-github-pages-main.sh mode change 100644 => 100755 doc/deploy-to-github-pages.sh mode change 100644 => 100755 doc/get_target_branch_name.sh diff --git a/doc/deploy-to-github-pages-current.sh b/doc/deploy-to-github-pages-current.sh old mode 100644 new mode 100755 diff --git a/doc/deploy-to-github-pages-main.sh b/doc/deploy-to-github-pages-main.sh old mode 100644 new mode 100755 diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh old mode 100644 new mode 100755 diff --git a/doc/get_target_branch_name.sh b/doc/get_target_branch_name.sh old mode 100644 new mode 100755 From 020ee6988e65637c3df32a34ae48472b2e5dddb3 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Fri, 11 Jun 2021 16:39:40 +0200 Subject: [PATCH 25/38] Reconstruct and improve the content of the documentation --- README.rst | 21 ++++++++++++------- doc/changes/changelog.rst | 2 ++ doc/changes/changes_0.1.0.md | 12 +++++++++-- doc/conf.py | 6 ++++-- .../upload_github_release_to_bucket.rst | 11 +++++++--- doc/user_guide/user_guide.rst | 3 +++ setup.py | 2 +- 7 files changed, 41 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index 72528295..d2cb205f 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,8 @@ BucketFS Utils Python Overview ******** -This project provides a python library for the Exasol BucketFS system. +This project provides a python library for accessing the Exasol BucketFS system. +It provides functions to upload and download files to and from the BucketFS. In a Nutshell ============= @@ -19,11 +20,9 @@ Prerequisites Installation ------------- -Install the package from Github via `pip`: +Install the package from Github via `pip`:: -``` -pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python -``` + pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python Documentation ------------- @@ -33,6 +32,12 @@ Documentation Features ======== -* Object-based specification of BucketFS connection information -* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html)) -* Loading files directly from Github Releases +* Download or upload files from/to the Exasol BucketFS +* Supported sources and targets for the uploads and downloads: + + * Files on the local Filesystem + * Python file objects + * Python Strings + * Python objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html)) + +* Loading an artefact from a public Github Release into the BucketFS diff --git a/doc/changes/changelog.rst b/doc/changes/changelog.rst index 634a28f3..0519d9ca 100644 --- a/doc/changes/changelog.rst +++ b/doc/changes/changelog.rst @@ -3,4 +3,6 @@ Changelog ***************** .. toctree:: + :maxdepth: 1 + changes_0.1.0.md diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 3046288b..1ab183c9 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -2,6 +2,14 @@ Code name: Initial implementation -## Features +## Summary + +### Features + + - #1: Added initial implementation. + - #6: Download file into fileobj, string or file + - #7: Upload file, string or fileboj + +### Refactorings + - #15: Remove DepHell dependency, because it is not maintained anymore -#1: Added initial implementation. \ No newline at end of file diff --git a/doc/conf.py b/doc/conf.py index 775a9765..c4daeb7e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,9 +32,11 @@ 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', 'sphinx.ext.autosummary', - 'myst_parser' + 'myst_parser', + 'sphinx.ext.autosectionlabel', ] - +# Make sure the target is unique +autosectionlabel_prefix_document = True source_suffix = { '.rst': 'restructuredtext', '.txt': 'markdown', diff --git a/doc/user_guide/upload_github_release_to_bucket.rst b/doc/user_guide/upload_github_release_to_bucket.rst index e17e56cb..4c6fde0a 100644 --- a/doc/user_guide/upload_github_release_to_bucket.rst +++ b/doc/user_guide/upload_github_release_to_bucket.rst @@ -1,6 +1,11 @@ -********************************** -Uploading GitHub Release to Bucket -********************************** +******************************************************************** +Uploading an artefact from a public Github Release into the BucketFS +******************************************************************** + +With this function you can upload an artefact from a public Github Release into the BucketFS. +This can be useful, if you want to upload a released artefact from one of `Exasol's open source repositories `_. + +Example: .. literalinclude:: upload_github_release_to_bucket.py :language: python3 \ No newline at end of file diff --git a/doc/user_guide/user_guide.rst b/doc/user_guide/user_guide.rst index 5428bf4c..93dd825a 100644 --- a/doc/user_guide/user_guide.rst +++ b/doc/user_guide/user_guide.rst @@ -2,6 +2,9 @@ User Guide ********** +This user guide provides you with usage examples for this repository. +For a detailed explanation of the API, please refer to our :doc:`API Documentation ` + .. toctree:: :maxdepth: 1 diff --git a/setup.py b/setup.py index 03c1bff5..1fa02345 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ 'name': 'exasol-bucketfs-utils-python', 'version': '0.1.0', 'description': 'BucketFS utilities for the Python programming language', - 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for the Exasol BucketFS system.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`:\n\n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n```\n\nDocumentation\n-------------\n\n`Documentation for the latest release text `_ is hosted on the Github Pages of this project.\n\nFeatures\n========\n\n* Object-based specification of BucketFS connection information\n* Download into or upload from files, file objects, string and objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n* Loading files directly from Github Releases\n', + 'long_description': '#####################\nBucketFS Utils Python\n#####################\n\n********\nOverview\n********\n\nThis project provides a python library for accessing the Exasol BucketFS system.\nIt provides functions to upload and download files to and from the BucketFS.\n\nIn a Nutshell\n=============\n\nPrerequisites\n-------------\n\n- Python 3.6+\n\nInstallation\n-------------\n\nInstall the package from Github via `pip`::\n\n pip install -e git://github.com/exasol/bucketfs-utils-python.git@{tag name}#egg=exasol-bucketfs-utils-python\n\nDocumentation\n-------------\n\n`Documentation for the latest release text `_ is hosted on the Github Pages of this project.\n\nFeatures\n========\n\n* Download or upload files from/to the Exasol BucketFS\n* Supported sources and targets for the uploads and downloads:\n\n * Files on the local Filesystem\n * Python file objects\n * Python Strings\n * Python objects ((De-)Serialization with [Joblib](https://joblib.readthedocs.io/en/latest/persistence.html))\n\n* Loading an artefact from a public Github Release into the BucketFS\n', 'author': 'Torsten Kilias', 'author_email': 'torsten.kilias@exasol.com', 'maintainer': None, From c7fc47262bca28f9eb1600b7ca68a01538ad350b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 22 Jun 2021 12:01:17 +0200 Subject: [PATCH 26/38] Fix copyright in documentation --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index c4daeb7e..1f794175 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -18,8 +18,8 @@ # -- Project information ----------------------------------------------------- project = 'Exasol BucketFS Utils Python' -copyright = '2021, Torsten Kilias' -author = 'Torsten Kilias' +copyright = '2021, Exasol' +author = 'Exasol' # -- General configuration --------------------------------------------------- From 02eeb7e811012d7e0161226743a08ff8f00b73fb Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 22 Jun 2021 12:02:10 +0200 Subject: [PATCH 27/38] Fix the checkout of a new target branch in deploy-to-github-pages.sh --- doc/deploy-to-github-pages.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index bb207ddb..e70ad0a1 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -37,10 +37,21 @@ checkout_target_branch_as_worktree() { git worktree add "$WORKTREE" "$TARGET_BRANCH" else echo "Checkout new branch $TARGET_BRANCH" + # We create the branch with git branch and not with the -b option of git worktree, because the -b option seems to doesn't work in all cases git branch "$TARGET_BRANCH" + # We need to create the worktree directly with the TARGET_BRANCH, because every other branch could be already checked out git worktree add "$WORKTREE" "$TARGET_BRANCH" pushd "$WORKTREE" - git reset --hard "$SOURCE_BRANCH" + # We need to set the TARGET_BRANCH to the default branch + GH_PAGES_MAIN_BRANCH=github-pages/main + GH_PAGES_ROOT_BRANCH=github-pages/root + GH_PAGES_MAIN_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" + if [ -n "$GH_PAGES_MAIN_BRANCH_EXISTS" ] + then + git reset --hard "$GH_PAGES_MAIN_BRANCH" + else + git reset --hard "$GH_PAGES_ROOT_BRANCH" + fi popd fi } From 3df785d58d6469a2d201c12424415a0b39b4b4f5 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 22 Jun 2021 12:16:40 +0200 Subject: [PATCH 28/38] Use origin branches for MAIN and ROOT in deploy-to-github-pages.sh --- doc/deploy-to-github-pages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index e70ad0a1..515b3321 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -43,8 +43,8 @@ checkout_target_branch_as_worktree() { git worktree add "$WORKTREE" "$TARGET_BRANCH" pushd "$WORKTREE" # We need to set the TARGET_BRANCH to the default branch - GH_PAGES_MAIN_BRANCH=github-pages/main - GH_PAGES_ROOT_BRANCH=github-pages/root + GH_PAGES_MAIN_BRANCH=origin/github-pages/main + GH_PAGES_ROOT_BRANCH=origin/github-pages/root GH_PAGES_MAIN_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" if [ -n "$GH_PAGES_MAIN_BRANCH_EXISTS" ] then From e3d4f7e275080ea68add44053c17421ea3c2f539 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 22 Jun 2021 17:36:15 +0200 Subject: [PATCH 29/38] Add explanation for default branches github-pages/main and github-pages/root in deploy-to-github-pages.sh --- doc/deploy-to-github-pages.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 515b3321..ed7da6d0 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -43,6 +43,10 @@ checkout_target_branch_as_worktree() { git worktree add "$WORKTREE" "$TARGET_BRANCH" pushd "$WORKTREE" # We need to set the TARGET_BRANCH to the default branch + # The default branch from github for pages is gh-pages, but you can change that. + # Not using the default branch actually has benefits, because the branch gh-pages enforces some things. + # We use github-pages/root and github-pagesmain, because github-pages/root is the new git root for the github pages + # and main-branch replaces master-branch. Master is a banned word and we are going to migrate more and more repos to main. GH_PAGES_MAIN_BRANCH=origin/github-pages/main GH_PAGES_ROOT_BRANCH=origin/github-pages/root GH_PAGES_MAIN_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" From 0a5d27f680122f48de349ac38e161d1b3b0e1d7d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 22 Jun 2021 19:27:50 +0200 Subject: [PATCH 30/38] Add issue to changes_0.1.0.md and fix missing empty line --- doc/changes/changes_0.1.0.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 1ab183c9..aed74cf1 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -9,7 +9,9 @@ Code name: Initial implementation - #1: Added initial implementation. - #6: Download file into fileobj, string or file - #7: Upload file, string or fileboj + - #29: Add sphinx documentation ### Refactorings + - #15: Remove DepHell dependency, because it is not maintained anymore From 038de81f0d8ec33dad55b37750493c0bb1ef8a34 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Wed, 23 Jun 2021 11:48:47 +0200 Subject: [PATCH 31/38] Apply suggestions from code review --- doc/changes/changes_0.1.0.md | 3 +-- doc/deploy-to-github-pages.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index aed74cf1..693b3644 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,5 +1,5 @@ # BucketFS Utils Python 0.1.0, released 2020-11-?? - +# BucketFs Utily Python 0.1.0, released XYZ Code name: Initial implementation ## Summary @@ -14,4 +14,3 @@ Code name: Initial implementation ### Refactorings - #15: Remove DepHell dependency, because it is not maintained anymore - diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index ed7da6d0..57a8880f 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -45,7 +45,7 @@ checkout_target_branch_as_worktree() { # We need to set the TARGET_BRANCH to the default branch # The default branch from github for pages is gh-pages, but you can change that. # Not using the default branch actually has benefits, because the branch gh-pages enforces some things. - # We use github-pages/root and github-pagesmain, because github-pages/root is the new git root for the github pages + # We use github-pages/root and github-pages/main, because github-pages/root is the new git root for the github pages # and main-branch replaces master-branch. Master is a banned word and we are going to migrate more and more repos to main. GH_PAGES_MAIN_BRANCH=origin/github-pages/main GH_PAGES_ROOT_BRANCH=origin/github-pages/root From 99ebd606824ef9c84a3bb337159f5d6eb14b4a8e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 24 Jun 2021 10:28:27 +0200 Subject: [PATCH 32/38] Add the creation of the new root commit to doc/deploy-to-github-pages.sh --- doc/deploy-to-github-pages.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 57a8880f..ac12e363 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -x + PUSH_ORIGIN="$2" PUSH_ENABLED="$3" SOURCE_BRANCH="$4" @@ -37,24 +37,32 @@ checkout_target_branch_as_worktree() { git worktree add "$WORKTREE" "$TARGET_BRANCH" else echo "Checkout new branch $TARGET_BRANCH" - # We create the branch with git branch and not with the -b option of git worktree, because the -b option seems to doesn't work in all cases + # We create the branch with git branch and not with the -b option of git worktree, + # because the -b option seems to doesn't work in all cases git branch "$TARGET_BRANCH" - # We need to create the worktree directly with the TARGET_BRANCH, because every other branch could be already checked out + # We need to create the worktree directly with the TARGET_BRANCH, + # because every other branch could be already checked out git worktree add "$WORKTREE" "$TARGET_BRANCH" pushd "$WORKTREE" # We need to set the TARGET_BRANCH to the default branch # The default branch from github for pages is gh-pages, but you can change that. # Not using the default branch actually has benefits, because the branch gh-pages enforces some things. - # We use github-pages/root and github-pages/main, because github-pages/root is the new git root for the github pages - # and main-branch replaces master-branch. Master is a banned word and we are going to migrate more and more repos to main. + # We use github-pages/main with separate history for Github Pages, + # because automated commits to the main branch can cause problems and + # we don't want to mix the generated documentation with sources. + # Furthermore, Github Pages expects a certain directory structure in the repository + # which we only can provide with a separate history. GH_PAGES_MAIN_BRANCH=origin/github-pages/main - GH_PAGES_ROOT_BRANCH=origin/github-pages/root - GH_PAGES_MAIN_BRANCH_EXISTS="$(git show-ref "refs/heads/$TARGET_BRANCH" || echo)" + GH_PAGES_MAIN_BRANCH_EXISTS="$(git show-ref "refs/heads/$GH_PAGES_MAIN_BRANCH" || echo)" if [ -n "$GH_PAGES_MAIN_BRANCH_EXISTS" ] then git reset --hard "$GH_PAGES_MAIN_BRANCH" else - git reset --hard "$GH_PAGES_ROOT_BRANCH" + echo "Creating a new empty root commit for the Github Pages." + + git checkout --orphan "$GH_PAGES_MAIN_BRANCH" + git reset --hard + git commit --no-verify --allow-empty -m 'Initial empty commit for Github Pages' fi popd fi From d46a9adff58d751833b53bbdb3f5a124e89ea5ff Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 24 Jun 2021 12:10:20 +0200 Subject: [PATCH 33/38] Adding intitial eplaination about how to build the documentation to the developer guide --- .../building_documentation.rst | 62 +++++++++++++++++++ doc/developer_guide/developer_guide.rst | 10 +++ doc/index.rst | 1 + 3 files changed, 73 insertions(+) create mode 100644 doc/developer_guide/building_documentation.rst create mode 100644 doc/developer_guide/developer_guide.rst diff --git a/doc/developer_guide/building_documentation.rst b/doc/developer_guide/building_documentation.rst new file mode 100644 index 00000000..d9e5f6b4 --- /dev/null +++ b/doc/developer_guide/building_documentation.rst @@ -0,0 +1,62 @@ +************************** +Building the Documentation +************************** + +We are using Sphinx for generating the documentation of this project, +because it is the default documentation tool for Python projects. +Sphinx supports API generation for Python and with plugins also for other languages. +Furthermore, it supports reStructuredText with proper cros-document references. +We using the MyST-Parser to also integrate markdown files into the documentation. + +###################################################### +Building the Documentation interactivily during coding +###################################################### + +We defined several commands in the project.toml in poethepoet +which allow you to build and view the documentation during coding:: + + poetry run poe build-html-doc # Builds the documentation + poetry run poe open-html-doc # Opens the currently build documentation in the browser + poetry run poe build-and-open-html-doc # Builds and opens the documentation + +All three commands build use the builded documentation located in/doc/_build/ +which is excluded in gitignore. If you want to build the documentation to other formats than HTML, +you find a Makefile in /doc which allows you to run the sphinx build with other goals. + +#################################### +Building the Documentation in the CI +#################################### + +Building the Documentation in the CI is a bit different to what you do during coding, +because we in also contains the preperations for publishing. At the moment, we publish +the documentation on Github Pages. + +To publish it there, we need to build the HTML from the documentation source and commit it. +However, Github Pages expects a specific directory structure to find the HTML. +Our usual directory structure doesn't fit these requirements, so we decided to create +a new Git root commit and initially set github-pages/main branch to this commit. +We then add new commits to this branch to update existing or add new versions of the documentation. + +This has the additional benefit, that we don't have automatic commits to the source branch. +We create for each branch or tag for which we build the documentation in the CI +we add a directory to the root directory of the github-pages/main branch. + +With each merge into the main branch the CI updates the documentation for the main branch in github-pages/main. +For feature branches the CI checks this deployment process by creating a branch github-pages/. +but it removes the branch directly after pushing it. However, you can run this also locally for testing purposes or +checking the branch with Github Pages in a fork of the main repostory. +The scripts which are responsible for the deployment are:: + + deploy-to-github-pages-current # creates or updates github-pages/ + deploy-to-github-pages-main.sh # only applicable for the main branch and creates or updates github-pages/main + + +We again a few shortcuts defined in our project.toml for poethepoet:: + + poetry run poe commit-html-doc-to-github-pages-main # creates or updates github-pages/main locally + poetry run poe push-html-doc-to-github-pages-main # creates or updates github-pages/main and pushes it to origin + poetry run poe commit-html-doc-to-github-pages-current # creates or updates github-pages/ locally + poetry run poe push-html-doc-to-github-pages-current # creates or updates github-pages/ and pushes it to origin + + + diff --git a/doc/developer_guide/developer_guide.rst b/doc/developer_guide/developer_guide.rst new file mode 100644 index 00000000..e91bad0c --- /dev/null +++ b/doc/developer_guide/developer_guide.rst @@ -0,0 +1,10 @@ +*************** +Developer Guide +*************** + +In this developer guide we explain how you can build this project. + +.. toctree:: + :maxdepth: 1 + + building_documentation diff --git a/doc/index.rst b/doc/index.rst index b7ecbf6b..5a112c1d 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,6 +8,7 @@ Table of Contents :maxdepth: 1 user_guide/user_guide + developer_guide/developer_guide dependencies changes/changelog From 8096638f046c73a4732c503e1ee43518317c681f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 24 Jun 2021 12:20:17 +0200 Subject: [PATCH 34/38] Move git config user to the beginning in doc/deploy-to-github-pages.sh --- doc/deploy-to-github-pages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index ac12e363..4c3dc509 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -96,8 +96,6 @@ git_commit_and_push() { echo "BRANCH=$SOURCE_BRANCH" >.source echo "COMMIT_ID=$CURRENT_COMMIT_ID" >>.source git add . - git config --local user.email "opensource@exasol.com" - git config --local user.name "GitHub Action" git diff-index --quiet HEAD || git commit --no-verify -m "Update documentation from source branch '$SOURCE_BRANCH' with commit id '$CURRENT_COMMIT_ID'" if [ -n "$PUSH_ORIGIN" ] && [ "$PUSH_ENABLED" == "push" ]; then echo "Git push $PUSH_ORIGIN $TARGET_BRANCH" @@ -116,6 +114,8 @@ trap 'cleanup_trap' EXIT TARGET_BRANCH="$1" CURRENT_COMMIT_ID="$(git rev-parse HEAD)" +git config --local user.email "opensource@exasol.com" +git config --local user.name "GitHub Action" detect_or_verify_source_branch checkout_target_branch_as_worktree build_and_copy_documentation From 83220328b585bb66bd59344c7925b3762fa24b74 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Thu, 24 Jun 2021 12:45:24 +0200 Subject: [PATCH 35/38] Apply suggestions from code review Co-authored-by: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> --- doc/developer_guide/building_documentation.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/developer_guide/building_documentation.rst b/doc/developer_guide/building_documentation.rst index d9e5f6b4..856e0c5c 100644 --- a/doc/developer_guide/building_documentation.rst +++ b/doc/developer_guide/building_documentation.rst @@ -4,8 +4,8 @@ Building the Documentation We are using Sphinx for generating the documentation of this project, because it is the default documentation tool for Python projects. -Sphinx supports API generation for Python and with plugins also for other languages. -Furthermore, it supports reStructuredText with proper cros-document references. +Sphinx supports API documentation generation for Python and with plugins also for other languages. +Furthermore, it supports reStructuredText with proper cross-document references. We using the MyST-Parser to also integrate markdown files into the documentation. ###################################################### @@ -19,16 +19,16 @@ which allow you to build and view the documentation during coding:: poetry run poe open-html-doc # Opens the currently build documentation in the browser poetry run poe build-and-open-html-doc # Builds and opens the documentation -All three commands build use the builded documentation located in/doc/_build/ -which is excluded in gitignore. If you want to build the documentation to other formats than HTML, +All three build commands use the generated documentation located in /doc/_build/ +which is excluded in gitignore. If you want to build the documentation for other formats than HTML, you find a Makefile in /doc which allows you to run the sphinx build with other goals. #################################### Building the Documentation in the CI #################################### -Building the Documentation in the CI is a bit different to what you do during coding, -because we in also contains the preperations for publishing. At the moment, we publish +Building the documentation in the CI is a bit different to the steps you can use during coding, +because it also contains the preparations for publishing. At the moment, we publish the documentation on Github Pages. To publish it there, we need to build the HTML from the documentation source and commit it. @@ -38,7 +38,7 @@ a new Git root commit and initially set github-pages/main branch to this commit. We then add new commits to this branch to update existing or add new versions of the documentation. This has the additional benefit, that we don't have automatic commits to the source branch. -We create for each branch or tag for which we build the documentation in the CI +For each branch or tag for which we build the documentation in the CI we add a directory to the root directory of the github-pages/main branch. With each merge into the main branch the CI updates the documentation for the main branch in github-pages/main. @@ -59,4 +59,3 @@ We again a few shortcuts defined in our project.toml for poethepoet:: poetry run poe push-html-doc-to-github-pages-current # creates or updates github-pages/ and pushes it to origin - From 944041d9620dca818cec4d319ce4663f337c5353 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Thu, 24 Jun 2021 12:47:35 +0200 Subject: [PATCH 36/38] Apply suggestions from code review Co-authored-by: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> --- doc/developer_guide/building_documentation.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/developer_guide/building_documentation.rst b/doc/developer_guide/building_documentation.rst index 856e0c5c..564a305b 100644 --- a/doc/developer_guide/building_documentation.rst +++ b/doc/developer_guide/building_documentation.rst @@ -51,11 +51,10 @@ The scripts which are responsible for the deployment are:: deploy-to-github-pages-main.sh # only applicable for the main branch and creates or updates github-pages/main -We again a few shortcuts defined in our project.toml for poethepoet:: +We also provide a few shortcuts defined in our project.toml for poethepoet:: poetry run poe commit-html-doc-to-github-pages-main # creates or updates github-pages/main locally poetry run poe push-html-doc-to-github-pages-main # creates or updates github-pages/main and pushes it to origin poetry run poe commit-html-doc-to-github-pages-current # creates or updates github-pages/ locally poetry run poe push-html-doc-to-github-pages-current # creates or updates github-pages/ and pushes it to origin - From 11039fe0f78564306b0f0987242f2a714d55d4ec Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 24 Jun 2021 12:48:53 +0200 Subject: [PATCH 37/38] Apply suggestions from code review --- doc/changes/changes_0.1.0.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index 693b3644..e68a3fd1 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -1,4 +1,3 @@ -# BucketFS Utils Python 0.1.0, released 2020-11-?? # BucketFs Utily Python 0.1.0, released XYZ Code name: Initial implementation From 5ae0fc7abd5e9e0a5b86b0670926e3fa05a507b9 Mon Sep 17 00:00:00 2001 From: Torsten Kilias Date: Thu, 24 Jun 2021 13:02:01 +0200 Subject: [PATCH 38/38] Moved setting the github user config to the CI jobs --- .../workflows/check_github_pages_docs_for_feature_branch.yaml | 2 ++ .github/workflows/deploy_github_pages_docs_for_main.yaml | 2 ++ doc/deploy-to-github-pages.sh | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_github_pages_docs_for_feature_branch.yaml b/.github/workflows/check_github_pages_docs_for_feature_branch.yaml index 53a0025d..1beb4a56 100644 --- a/.github/workflows/check_github_pages_docs_for_feature_branch.yaml +++ b/.github/workflows/check_github_pages_docs_for_feature_branch.yaml @@ -29,6 +29,8 @@ jobs: run: poetry install - name: Test documentation deployment for current feature branch run: | + git config --local user.email "opensource@exasol.com" + git config --local user.name "GitHub Action" git fetch SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" TARGET_BRANCH="$(doc/get_target_branch_name.sh "$SOURCE_BRANCH")" diff --git a/.github/workflows/deploy_github_pages_docs_for_main.yaml b/.github/workflows/deploy_github_pages_docs_for_main.yaml index beb59fa6..a98769a9 100644 --- a/.github/workflows/deploy_github_pages_docs_for_main.yaml +++ b/.github/workflows/deploy_github_pages_docs_for_main.yaml @@ -27,5 +27,7 @@ jobs: run: poetry install - name: Deploy documentation to github-pages-main branch run: | + git config --local user.email "opensource@exasol.com" + git config --local user.name "GitHub Action" git fetch poetry run poe push-html-doc-to-github-pages-main diff --git a/doc/deploy-to-github-pages.sh b/doc/deploy-to-github-pages.sh index 4c3dc509..f7ccc866 100755 --- a/doc/deploy-to-github-pages.sh +++ b/doc/deploy-to-github-pages.sh @@ -114,8 +114,6 @@ trap 'cleanup_trap' EXIT TARGET_BRANCH="$1" CURRENT_COMMIT_ID="$(git rev-parse HEAD)" -git config --local user.email "opensource@exasol.com" -git config --local user.name "GitHub Action" detect_or_verify_source_branch checkout_target_branch_as_worktree build_and_copy_documentation