Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add basic exasol-toolbox support to project #32

Merged
merged 11 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Documentation

on: workflow_call

jobs:

documentation-job:
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Build Documentation
run: |
poetry run python -m nox -s build-docs

- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: .html-documentation
git-config-name: Github Action
git-config-email: [email protected]
14 changes: 14 additions & 0 deletions .github/workflows/pr-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR-Merge

on:
push:
branches:
- 'main'
- 'master'

jobs:

publish-docs:
name: Publish Documentation
uses: ./.github/workflows/gh-pages.yml

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ poetry.lock

# Sphinx
doc/_build
.html-documentation

.lint.json
.lint.txt
1 change: 1 addition & 0 deletions doc/_static/dark-exasol-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions doc/_static/light-exasol-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
12 changes: 12 additions & 0 deletions doc/_templates/version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% if versions %}
<h3>{{ _('Versions') }}</h3>
<ul>
{%- for item in versions | reverse %}
{%- if item.name == "main" %}
<li><a href="{{ item.url }}">latest</a></li>
{%- else %}
<li><a href="{{ item.url }}">{{ item.name }}</a></li>
{%- endif %}
{%- endfor %}
</ul>
{% endif %}
12 changes: 12 additions & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@
* [0.3.0](changes_0.3.0.md)
* [0.2.0](changes_0.2.0.md)
* [0.1.0](changes_0.1.0.md)


```{toctree}
---
hidden:
---
unreleased
changes_0.4.0
changes_0.3.0
changes_0.2.0
changes_0.1.0
```
78 changes: 78 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 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 = "Error Reporting Python"
copyright = "2022, Exasol" # pylint: disable=redefined-builtin
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",
]

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

# Make sure the target is unique
source_suffix = {
".rst": "restructuredtext",
".txt": "markdown",
".md": "markdown",
}

todo_include_todos = True

# 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", ".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 = "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 = "Toolbox"
html_theme_options = {
"light_logo": "_static/light-exasol-logo.svg",
"dark_logo": "_static/dark-exasol-logo.svg",
"github_url": "https://github.com/exasol/error-reporting-python",
"accent_color": "grass",
}

2 changes: 2 additions & 0 deletions doc/developer_guide/developer_guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Developer Guide
===============
4 changes: 4 additions & 0 deletions doc/faq.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _faq:

FAQ
===
27 changes: 27 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Documentation of the Exasol-Toolbox
-----------------------------------


.. grid:: 1 1 3 2
:gutter: 2
:padding: 0
:class-container: surface

.. grid-item-card:: :octicon:`question` FAQ
:link: faq
:link-type: ref

Frequently asked questsions.


.. toctree::
:maxdepth: 1
:hidden:

user_guide/user_guide
developer_guide/developer_guide
dependencies
faq
changes/changelog


8 changes: 4 additions & 4 deletions doc/user_guide/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Please keep in mind that error-code should satisfy the error-code format (see [c
Flexibility is provided by introducing placeholder parameters to the error
message.

#### code
### code
This parameter needs to obey the following format (`^[FEW]-[[A-Z][A-Z0-9]+(-[A-Z][A-Z0-9]+)*-[0-9]+$`):

`severity "-" project-short-tag ["-" module-short-tag] "-" error-number` where,
Expand All @@ -28,15 +28,15 @@ Examples of valide error codes:
- E-EXA-SQL-22004
- F-VS-QRW-13

#### message
### message
This parameter includes the error description which can be given by either a static
string or a string containing placeholders in double curly brackets. Parameters
of placeholders in the error message can be provided using the `parameters` parameter.

#### mitigations
### mitigations
This parameter provides a list of hints on how to fix the error.
Parameters of placeholders in the mitigations can be given via the `parameters` parameter.

#### parameters
### parameters
This argument takes a dictionary of placeholder names and the respective parameter values.
They will be used to replace the placeholders in the mitigations and messages.
20 changes: 20 additions & 0 deletions noxconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Configuration for nox based task runner"""
from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path
from typing import Iterable


@dataclass(frozen=True)
class Config:
"""Project specific configuration used by nox infrastructure"""

root: Path = Path(__file__).parent
doc: Path = Path(__file__).parent / "doc"
version_file: Path = Path(__file__).parent / "exasol" / "error" / "version.py"
path_filters: Iterable[str] = ("dist", ".eggs", "venv")
plugins = []


PROJECT_CONFIG = Config()
8 changes: 8 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""defines nox tasks/targets for this project"""
import nox

# imports all nox task provided by the toolbox
from exasol.toolbox.nox.tasks import * # pylint: disable=wildcard-import disable=unused-wildcard-import

# default actions to be run if nothing is explicitly specified with the -s option
nox.options.sessions = ["fix"]
43 changes: 41 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,50 @@ python = "^3.8"

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.2"
prysk = {extras = ["pytest-plugin"], version = "^0.15.1"}
prysk = {extras = ["pytest-plugin"], version = ">=0.15.1"}
exasol-toolbox = ">=0.13.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
ec = 'exasol.error._cli:main'
ec = 'exasol.error._cli:main'


[tool.coverage.run]
relative_files = true
source = [
"exasol",
]

[tool.coverage.report]
fail_under = 65


[tool.black]
line-length = 88
verbose = false
include = "\\.pyi?$"


[tool.isort]
profile = "black"
force_grid_wrap = 2


[tool.pylint.master]
fail-under = 7.0

[tool.pylint.format]
max-line-length = 88
max-module-lines = 800


[[tool.mypy.overrides]]
module = [
"exasol.toolbox.sphinx.multiversion.*",
"test.unit.*",
"test.integration.*",
]
ignore_errors = true
Loading