diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml index c221be09..e4be0103 100644 --- a/.github/workflows/pr-merge.yml +++ b/.github/workflows/pr-merge.yml @@ -8,6 +8,18 @@ on: jobs: + # This job can be removed if certain preconditions are met. See + # https://exasol.github.io/python-toolbox/user_guide/workflows.html#pr-merge-workflow + + ci-job: + name: Checks + uses: ./.github/workflows/checks.yml + secrets: inherit + publish-docs: name: Publish Documentation uses: ./.github/workflows/gh-pages.yml + + metrics: + needs: [ ci-job ] + uses: ./.github/workflows/report.yml diff --git a/doc/_templates/partials/webfonts.html b/doc/_templates/partials/webfonts.html new file mode 100644 index 00000000..e69de29b diff --git a/doc/conf.py b/doc/conf.py index be285acc..0f104734 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,37 +13,37 @@ import os import sys -# sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath("../")) - # -- Project information ----------------------------------------------------- project = "Exasol BucketFS" -copyright = "2021, Exasol" +copyright = "2024, Exasol" author = "Exasol" - # -- 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.todo", "sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx.ext.intersphinx", "sphinx.ext.autosummary", + "sphinx_copybutton", "myst_parser", + "sphinx_design", + "sphinx_inline_tabs", "sphinx_copybutton", - "sphinx.ext.autosectionlabel", + "exasol.toolbox.sphinx.multiversion", ] intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # Make sure the target is unique -autosectionlabel_prefix_document = True source_suffix = { ".rst": "restructuredtext", ".txt": "markdown", @@ -60,20 +60,21 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".build-docu"] - # -- 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 = "furo" +html_theme = "shibuya" # 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"] -html_title = f"Bucketfs" +html_title = "Bucketfs" html_theme_options = { "light_logo": "light-exasol-logo.svg", "dark_logo": "dark-exasol-logo.svg", + "github_url": "https://github.com/exasol/bucketfs-python", + "accent_color": "grass", } diff --git a/doc/user_guide/basics.rst b/doc/user_guide/basics.rst index 53b7670b..b8af8468 100644 --- a/doc/user_guide/basics.rst +++ b/doc/user_guide/basics.rst @@ -4,7 +4,7 @@ Basic's The Bucketfs Service -------------------- In the On-Prem database, a single bucketfs service can host multiple buckets. In order to interact with a -bucketfs service one can use the :ref:`exasol.bucketfs.Service ` class. +bucketfs service one can use the ``exasol.bucketfs.Service`` class. List buckets ++++++++++++ @@ -25,7 +25,7 @@ Get a Bucket reference Bucket class ------------ A Bucket contains a set of files which may be restricted, depending on the credentials of the requester. -The Bucket class for an On-Prem database is :ref:`exasol.bucketfs.Bucket `. +The Bucket class for an On-Prem database is ``exasol.bucketfs.Bucket``. The correspondent class for a SaaS database is exasol.bucketfs.SaaSBucket. Using these classes the user can interact with the files in the bucket (download, upload, list and delete them). @@ -60,13 +60,13 @@ Download files from a Bucket Available Converters ____________________ -* :ref:`exasol.bucketfs.as_bytes ` +* ``exasol.bucketfs.as_bytes`` -* :ref:`exasol.bucketfs.as_string ` +* ``exasol.bucketfs.as_string`` -* :ref:`exasol.bucketfs.as_hash ` +* ``exasol.bucketfs.as_hash`` -* :ref:`exasol.bucketfs.as_file ` +* ``exasol.bucketfs.as_file`` .. literalinclude:: /examples/download.py :language: python3 diff --git a/noxfile.py b/noxfile.py index 176dbf97..5a0e15a7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,25 @@ # imports all nox task provided by the toolbox from exasol.toolbox.nox.tasks import * +from noxconfig import PROJECT_CONFIG # default actions to be run if nothing is explicitly specified with the -s option nox.options.sessions = ["project:fix"] + +def _coverage(session, config, context) -> None: + # Overrides default implementation of PTB + # in order to only run unit tests for coverage + from exasol.toolbox.nox._test import _unit_tests + command = ["poetry", "run", "coverage", "report", "-m"] + coverage_file = config.root / ".coverage" + coverage_file.unlink(missing_ok=True) + _unit_tests(session, config, context) + session.run(*command) + +@nox.session(name="test:coverage", python=False) +def coverage(session) -> None: + from exasol.toolbox.nox._shared import _context + """Runs all tests (unit + integration) and reports the code coverage""" + context = _context(session, coverage=True) + _coverage(session, PROJECT_CONFIG, context) + diff --git a/pyproject.toml b/pyproject.toml index 86bebfa5..eca431e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ source = [ ] [tool.coverage.report] -fail_under = 15 +fail_under = 77 [tool.black] @@ -69,7 +69,7 @@ force_grid_wrap = 2 [tool.pylint.master] -fail-under = 7.0 +fail-under = 7.4 output-format = "colorized,json:.lint.json,text:.lint.txt" [tool.pylint.format]