Skip to content

Commit

Permalink
Merge branch 'main' into feature/#248-add-security-linter-results-to-…
Browse files Browse the repository at this point in the history
…workflow-summary
  • Loading branch information
Jannis-Mittenzwei committed Nov 15, 2024
2 parents f22961e + 9876aa8 commit 05f923c
Show file tree
Hide file tree
Showing 61 changed files with 584 additions and 1,731 deletions.
2 changes: 1 addition & 1 deletion .github/actions/python-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
python-version:
description: 'Python version to use'
required: true
default: "3.8"
default: "3.10"

poetry-version:
description: 'Poetry version to use'
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Build Documentation
run: |
poetry run python -m nox -s build-docs
poetry run python -m nox -s docs:build
Lint:
name: Linting (Python-${{ matrix.python-version }})
Expand All @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: SCM Checkout
Expand All @@ -59,7 +59,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run lint
run: poetry run nox -s lint
run: poetry run nox -s lint:code

- name: Upload Artifacts
uses: actions/[email protected]
Expand All @@ -75,7 +75,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: SCM Checkout
Expand All @@ -87,7 +87,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run type-check
run: poetry run nox -s type-check
run: poetry run nox -s lint:typing

Security:
name: Security Checks (Python-${{ matrix.python-version }})
Expand All @@ -96,7 +96,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: SCM Checkout
Expand All @@ -108,7 +108,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run security linter
run: poetry run nox -s security
run: poetry run nox -s lint:security

- name: Upload Artifacts
uses: actions/[email protected]
Expand All @@ -126,7 +126,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11" ]
exasol-version: [ "7.1.9" ]

steps:
Expand All @@ -139,7 +139,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run Tests and Collect Coverage
run: poetry run nox -s coverage -- -- --db-version ${{ matrix.exasol-version }}
run: poetry run nox -s test:coverage -- -- --db-version ${{ matrix.exasol-version }}

- name: Upload Artifacts
uses: actions/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ jobs:
steps:
- name: SCM Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python & Poetry Environment
uses: ./.github/actions/python-environment

- name: Build Documentation
run: |
poetry run python -m nox -s build-docs
poetry run python -m nox -s docs:multiversion
- name: Deploy
uses: JamesIves/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cp security-python3.9/.security.json ../
- name: Generate Report
run: poetry run nox -s report -- -- --format json | tee metrics.json
run: poetry run nox -s project:report -- -- --format json | tee metrics.json

- name: Upload Artifacts
uses: actions/[email protected]
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Generate GitHub Summary
run: |
echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY
poetry run nox -s report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
poetry run nox -s project:report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
echo -e "\n\n# Coverage\n" >> $GITHUB_STEP_SUMMARY
poetry run coverage report -- --format markdown >> $GITHUB_STEP_SUMMARY
echo -e "\n\n# Static Code Analysis\n" >> $GITHUB_STEP_SUMMARY
Expand Down
12 changes: 0 additions & 12 deletions doc/_templates/version.html

This file was deleted.

2 changes: 2 additions & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

* [unreleased](unreleased.md)
* [0.16.0](changes_0.16.0.md)
* [0.15.0](changes_0.15.0.md)
* [0.14.0](changes_0.14.0.md)
* [0.13.0](changes_0.13.0.md)
Expand All @@ -24,6 +25,7 @@
hidden:
---
unreleased
changes_0.16.0
changes_0.15.0
changes_0.14.0
changes_0.13.0
Expand Down
1 change: 1 addition & 0 deletions doc/changes/changes_0.15.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Added cookiecutter-template for creating new project
* [#246](https://github.com/exasol/python-toolbox/issues/246): Added standard branch protection workflow
* #74: Added security linter nox task

## 🐞 Bug Fixes

Expand Down
42 changes: 42 additions & 0 deletions doc/changes/changes_0.16.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 0.16.0 - 2024-11-15

## 🚨 Breaking Changes

* Dropped python 3.8 support
* Changed names of all nox tasks

| Old Name | New Name | Description |
|--------------------|------------------------|----------------------------------------------------------------|
| fix | project:fix | Runs all automated fixes on the code base |
| check | project:check | Runs all available checks on the project |
| report | project:report | Collects and generates metrics summary for the workspace |
| unit-tests | test:unit | Runs all unit tests |
| integration-tests | test:integration | Runs all the integration tests |
| coverage | test:coverage | Runs all tests (unit + integration) and reports the code coverage |
| lint | lint:code | Runs the static code analyzer on the project |
| type-check | lint:typing | Runs the type checker on the project |
| security | lint:security | Runs the security linter on the project |
| build-build | docs:build | Builds the project documentation |
| open-open | docs:open | Opens the built project documentation |
| clean-docs | docs:clean | Removes the documentations build folder |
| prepare-release | release:prepare | Prepares the project for a new release |

## ✨ Added

* Added support for multi version Documentation
* Added nox tasks for building multi-version documentation

## 🐞 Fixed

* Fixed CD workflow template
* Fixed the selection of the latest version in Multi-Version Documentation

## 📚 Documentation

* Added Documentation on Metrics
* Added additional details regarding adjusted sphinx-multiversion
* Restructured documentation

## 🔩 Internal

* Relocked dependencies
13 changes: 0 additions & 13 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
# Unreleased

## 🐞 Fixed

* Fixed CD workflow template

## 📚 Documentation

* Add Documentation on Metrics

## 🔩 Internal

* Relock dependencies

1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"sphinx_design",
"sphinx_inline_tabs",
"sphinx_copybutton",
"exasol.toolbox.sphinx.multiversion",
]

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
../design
development
plugins
ideas
modules/modules
2 changes: 1 addition & 1 deletion doc/developer_guide/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This can be achieved by running the following command:

.. code-block:: shell
nox -s prepare-release -- <major>.<minor>.<patch>
nox -s release:prepare -- <major>.<minor>.<patch>
Replace `<major>`, `<minor>`, and `<patch>` with the appropriate version numbers.
Once the PR is successfully merged, the release can be triggered (see next section).
Expand Down
28 changes: 0 additions & 28 deletions doc/developer_guide/ideas.rst

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Modules
.. toctree::
:maxdepth: 2

sphinx/sphinx
nox
pre_commit_hooks
sphinx/sphinx

File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions doc/developer_guide/modules/sphinx/sphinx.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
sphinx
=======

sphinx-multiversion
+++++++++++++++++++

The `sphinx-multiversion` extension is a modified copy of `Holzhaus/sphinx-multiversion <https://github.com/Holzhaus/sphinx-multiversion>`_. This copy was taken from version :code:`0.24.0`.

It has been adjusted with minor code changes and modified defaults to work seamlessly with Exasol integration projects, which often require a specific project structure and layout. Additionally, it is designed to be used with an HTML theme that supports displaying and selecting multiple versions if the `versions` variable is set in the HTML context of sphinx. As of this writing, the theme used in conjunction with this modified version of `sphinx-multiversion` is `SHIBUYA <https://github.com/lepture/shibuya>`_, version :code:`2024.10.15`.

.. attention::

**Attribution**

A big thanks to the original author and project `Jan Holthuis <https://github.com/Holzhaus>`_, as well as `Samuel Dowling <https://github.com/samuel-emrys>`_, as we took various patches for the plugin from his fork.

Note: Both projects are published under the `BSD-2 license <https://opensource.org/license/bsd-2-clause>`_.

* https://github.com/sphinx-contrib/multiversion
* https://github.com/samuel-emrys/sphinx-multiversion

.. note::

In the long term, it would be advantageous to remove unnecessary features and code that are not required for Exasol's projects. Adding further tests would also be beneficial. However, the primary goal was to create a low-effort, stable multi-version support solution for our projects.
2 changes: 1 addition & 1 deletion doc/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Tooling
Projects
________

Projects can run the nox task :code:`nox -s report` to generate their project metrics if they are using the :code:`exasol-toolbox`.
Projects can run the nox task :code:`nox -s project:report` to generate their project metrics if they are using the :code:`exasol-toolbox`.


Development
Expand Down
29 changes: 16 additions & 13 deletions doc/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ Build and open the documentation:

.. code-block:: shell
nox -s build-docs open-docs
nox -s docs:build docs:open
Execute the unit tests of the project:

.. code-block:: shell
nox -s unit-tests
nox -s test:unit
.. _existing:
Expand Down Expand Up @@ -184,17 +184,20 @@ You are ready to use the toolbox. With *nox -l* you can list all available tasks
$ nox -l
Sessions defined in <PATH_TO_YOUR_PROJECT>/noxfile.py:
* fix -> Runs all automated fixes on the code base
- check -> Runs all available checks on the project
- lint -> Runs the linter on the project
- type-check -> Runs the type checker on the project
- unit-tests -> Runs all unit tests
- integration-tests -> Runs the all integration tests
- coverage -> Runs all tests (unit + integration) and reports the code coverage
- build-docs -> Builds the project documentation
- open-docs -> Opens the built project documentation
- clean-docs -> Removes the documentations build folder
- report -> Collects and generates a metrics summary for the workspace
* project:fix -> Runs all automated fixes on the code base
- project:check -> Runs all available checks on the project
- project:report -> Collects and generates metrics summary for the workspace
- test:unit -> Runs all unit tests
- test:integration -> Runs the all integration tests
- test:coverage -> Runs all tests (unit + integration) and reports the code coverage
- lint:code -> Runs the static code analyzer on the project
- lint:typing -> Runs the type checker on the project
- lint:security -> Runs the security linter on the project
- docs:multiversion -> Builds the multiversion project documentation
- docs:build -> Builds the project documentation
- docs:open -> Opens the built project documentation
- docs:clean -> Removes the documentations build folder
- release:prepare -> Prepares the project for a new release.
sessions marked with * are selected, sessions marked with - are skipped.
Expand Down

This file was deleted.

Loading

0 comments on commit 05f923c

Please sign in to comment.