diff --git a/.github/actions/security-issues/action.yml b/.github/actions/security-issues/action.yml index 55bea911f..42af5f295 100644 --- a/.github/actions/security-issues/action.yml +++ b/.github/actions/security-issues/action.yml @@ -39,7 +39,7 @@ runs: - name: Install Python Toolbox / Security tool shell: bash run: | - pip install exasol-toolbox==4.0.1 + pip install exasol-toolbox==5.0.0 - name: Create Security Issue Report shell: bash diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index e3095004a..8586564d0 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,6 +1,7 @@ # Changelog * [unreleased](unreleased.md) +* [5.0.0](changes_5.0.0.md) * [4.0.1](changes_4.0.1.md) * [4.0.0](changes_4.0.0.md) * [3.0.0](changes_3.0.0.md) @@ -54,6 +55,7 @@ hidden: --- unreleased +changes_5.0.0 changes_4.0.1 changes_4.0.0 changes_3.0.0 diff --git a/doc/changes/changes_5.0.0.md b/doc/changes/changes_5.0.0.md new file mode 100644 index 000000000..33daeaf3f --- /dev/null +++ b/doc/changes/changes_5.0.0.md @@ -0,0 +1,98 @@ +# 5.0.0 - 2026-01-23 + +## Summary + +In this major release, attention needs to be given to the following: + +* `gh-pages.yml` changes + * See GitHub `upload-pages-artifact` v4 +* default Poetry version changed from `2.1.2` to `2.3.0` + * See Poetry Update + +### GitHub `upload-pages-artifact` v4 + +In v4, the developers of `upload-pages-artifact` dropped support for uploading +dotfiles. This means that the `gh-pages.yml` has been modified such that it +converts the generated `.html-documentation` to `html-documentation`. It was also checked +which files are created by the nox session `docs:build`. It was found that in many cases +that the only dotfiles produced are `.buildinfo` and `.doctrees`, which do not need +to be uploaded for the GitHub pages to work. To verify that your project will not be +adversely affected by these changes, please: + +1. Run the nox sessions `docs:build` +2. Use this command to see what dotfiles are created: + ```bash + ls -a .hmtl-documentation/ | grep "^\." + ``` +3. If there are other critical dotfiles, consider converting them. Otherwise, create +an issue in the `python-toolbox`. + +### Poetry Update +The default behavior for `.github/actions/python-environment/action.yml` has changed. +In previous versions, the default value for `poetry-version` was `2.1.2`, and it is now `2.3.0`. + +* For migrating to `2.3.0`, see +[from Poetry 2.1.x to 2.3.0](https://exasol.github.io/python-toolbox/main/user_guide/dependencies.html#from-poetry-2-1-x-to-2-3-0). + +* Depending on its poetry version, a repository relying on the default behavior of said +action may run into breaking changes. This can easily be resolved with explicitly setting the +`poetry-version` when calling the GitHub action. It is, however, recommended whenever +possible to update the poetry version of the affected repository. Since this major release, +you can, if needed, alter the `poetry-version` via the `noxconfig.py::PROJECT_CONFIG` +by changing `dependency_manager_version`. If you do this, please create an issue to +update to `2.3.0` at your earliest convenience. + +## Documentation + +* #648: Moved sonar setup instructions in the User guide + +## Features + +* #649: Restricted noxconfig usage throughout exasol.toolbox to only exasol.toolbox.nox.* +* #647: Added summary to changelog template +* #657: Updated `release:prepare` to modify cookiecutter template exasol-toolbox version range +* #665: Added SECURITY.md to the cookiecutter template +* #667: Switched GitHub workflow templates to be controlled by PROJECT_CONFIG: + * The values in `BaseConfig.github_template_dict` are used to render the following values in + the templates + * `dependency_manager_version` - used for `poetry-version` in the workflows. + The default it `2.3.0`. + * `minimum_python_version` - used for `python-version` in the workflows whenever + `python-version` for actions that are run once. The default is the minimum value + in your project's defined `python_versions` + * `os_version` - used for the GitHub runner in the workflows. The default is + `ubuntu-24.04` + +## Refactoring + +* #624: Updated GitHub python-environment action and all code to use Poetry >= 2.3.0 +* #662: Update GitHub actions + * `checkout` from v5 to [v6](https://github.com/actions/checkout/releases/tag/v6.0.0) - using Node.js 24 + * `upload-pages-artifact` from v3 to [v4](https://github.com/actions/upload-pages-artifact/releases/tag/v4.0.0) - breaking change + * `download-artifact`from v6 to [v7](https://github.com/actions/download-artifact/releases/tag/v7.0.0) - using Node.js 24 + * `upload-artifact` from v5 to [v6](https://github.com/actions/upload-artifact/releases/tag/v6.0.0) - using Node.js 24 +* #667: Added deprecation warnings to `tbx workflow x` endpoints as some are unneeded +(will be removed) and others need updates (will be moved to a nox session) +* #669: Updated PTB GitHub workflows + +## Dependency Updates + +### `main` +* Updated dependency `bandit:1.9.2` to `1.9.3` +* Updated dependency `black:25.11.0` to `25.12.0` +* Updated dependency `coverage:7.12.0` to `7.13.1` +* Updated dependency `furo:2025.9.25` to `2025.12.19` +* Updated dependency `import-linter:2.7` to `2.9` +* Updated dependency `mypy:1.19.0` to `1.19.1` +* Updated dependency `pre-commit:4.5.0` to `4.5.1` +* Updated dependency `pysonar:1.2.1.3951` to `1.3.0.4086` +* Updated dependency `pytest:9.0.1` to `9.0.2` +* Added dependency `pyyaml:6.0.3` +* Updated dependency `ruff:0.14.8` to `0.14.13` +* Updated dependency `shibuya:2025.11.10` to `2026.1.9` +* Updated dependency `sphinx-design:0.6.1` to `0.7.0` +* Updated dependency `sphinx-toolbox:4.0.0` to `4.1.2` +* Updated dependency `typer:0.20.0` to `0.21.1` + +### `dev` +* Added dependency `types-pyyaml:6.0.12.20250915` diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 121438cd4..fb4737052 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -1,76 +1,3 @@ # Unreleased ## Summary - -In this major release, attention needs to be given to the following: - -* `gh-pages.yml` changes - * See GitHub `upload-pages-artifact` v4 -* default Poetry version changed from `2.1.2` to `2.3.0` - * See Poetry Update - -### GitHub `upload-pages-artifact` v4 - -In v4, the developers of `upload-pages-artifact` dropped support for uploading -dotfiles. This means that the `gh-pages.yml` has been modified such that it -converts the generated `.html-documentation` to `html-documentation`. It was also checked -which files are created by the nox session `docs:build`. It was found that in many cases -that the only dotfiles produced are `.buildinfo` and `.doctrees`, which do not need -to be uploaded for the GitHub pages to work. To verify that your project will not be -adversely affected by these changes, please: - -1. Run the nox sessions `docs:build` -2. Use this command to see what dotfiles are created: - ```bash - ls -a .hmtl-documentation/ | grep "^\." - ``` -3. If there are other critical dotfiles, consider converting them. Otherwise, create -an issue in the `python-toolbox`. - -### Poetry Update -The default behavior for `.github/actions/python-environment/action.yml` has changed. -In previous versions, the default value for `poetry-version` was `2.1.2`, and it is now `2.3.0`. - -* For migrating to `2.3.0`, see -[from Poetry 2.1.x to 2.3.0](https://exasol.github.io/python-toolbox/main/user_guide/dependencies.html#from-poetry-2-1-x-to-2-3-0). - -* Depending on its poetry version, a repository relying on the default behavior of said -action may run into breaking changes. This can easily be resolved with explicitly setting the -`poetry-version` when calling the GitHub action. It is, however, recommended whenever -possible to update the poetry version of the affected repository. Since this major release, -you can, if needed, alter the `poetry-version` via the `noxconfig.py::PROJECT_CONFIG` -by changing `dependency_manager_version`. If you do this, please create an issue to -update to `2.3.0` at your earliest convenience. - -## Documentation - -* #648: Moved sonar setup instructions in the User guide - -## Features - -* #649: Restricted noxconfig usage throughout exasol.toolbox to only exasol.toolbox.nox.* -* #647: Added summary to changelog template -* #657: Updated `release:prepare` to modify cookiecutter template exasol-toolbox version range -* #665: Added SECURITY.md to the cookiecutter template -* #667: Switched GitHub workflow templates to be controlled by PROJECT_CONFIG: - * The values in `BaseConfig.github_template_dict` are used to render the following values in - the templates - * `dependency_manager_version` - used for `poetry-version` in the workflows. - The default it `2.3.0`. - * `minimum_python_version` - used for `python-version` in the workflows whenever - `python-version` for actions that are run once. The default is the minimum value - in your project's defined `python_versions` - * `os_version` - used for the GitHub runner in the workflows. The default is - `ubuntu-24.04` - -## Refactoring - -* #624: Updated GitHub python-environment action and all code to use Poetry >= 2.3.0 -* #662: Update GitHub actions - * `checkout` from v5 to [v6](https://github.com/actions/checkout/releases/tag/v6.0.0) - using Node.js 24 - * `upload-pages-artifact` from v3 to [v4](https://github.com/actions/upload-pages-artifact/releases/tag/v4.0.0) - breaking change - * `download-artifact`from v6 to [v7](https://github.com/actions/download-artifact/releases/tag/v7.0.0) - using Node.js 24 - * `upload-artifact` from v5 to [v6](https://github.com/actions/upload-artifact/releases/tag/v6.0.0) - using Node.js 24 -* #667: Added deprecation warnings to `tbx workflow x` endpoints as some are unneeded -(will be removed) and others need updates (will be moved to a nox session) -* #669: Updated PTB GitHub workflows diff --git a/doc/user_guide/dependencies.rst b/doc/user_guide/dependencies.rst index ab4a46659..ab1be3797 100644 --- a/doc/user_guide/dependencies.rst +++ b/doc/user_guide/dependencies.rst @@ -35,7 +35,7 @@ Migration Information From Poetry 2.1.x to 2.3.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is **highly** encouraged that a developer update their ``pyproject.toml`` and -system-wide Poetry installation to most use effectively use Poetry ``2.3.0``: +system-wide Poetry installation to most effectively use Poetry ``2.3.0``: #. In your terminal, update your system-wide Poetry version: diff --git a/exasol/toolbox/templates/github/workflows/build-and-publish.yml b/exasol/toolbox/templates/github/workflows/build-and-publish.yml index 7f0faca79..cdf7ac950 100644 --- a/exasol/toolbox/templates/github/workflows/build-and-publish.yml +++ b/exasol/toolbox/templates/github/workflows/build-and-publish.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/check-release-tag.yml b/exasol/toolbox/templates/github/workflows/check-release-tag.yml index adb50b90a..16ae112aa 100644 --- a/exasol/toolbox/templates/github/workflows/check-release-tag.yml +++ b/exasol/toolbox/templates/github/workflows/check-release-tag.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/checks.yml b/exasol/toolbox/templates/github/workflows/checks.yml index cba276500..7c658c6f5 100644 --- a/exasol/toolbox/templates/github/workflows/checks.yml +++ b/exasol/toolbox/templates/github/workflows/checks.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" @@ -65,7 +65,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" @@ -87,7 +87,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: ${{ matrix.python-version }} poetry-version: "(( dependency_manager_version ))" @@ -119,7 +119,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: ${{ matrix.python-version }} poetry-version: "(( dependency_manager_version ))" @@ -142,7 +142,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: ${{ matrix.python-version }} poetry-version: "(( dependency_manager_version ))" @@ -167,7 +167,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" @@ -187,7 +187,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" @@ -210,7 +210,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: ${{ matrix.python-version }} poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/gh-pages.yml b/exasol/toolbox/templates/github/workflows/gh-pages.yml index 0a77ba8f4..71a3bdff3 100644 --- a/exasol/toolbox/templates/github/workflows/gh-pages.yml +++ b/exasol/toolbox/templates/github/workflows/gh-pages.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/matrix-all.yml b/exasol/toolbox/templates/github/workflows/matrix-all.yml index ae75945b4..cb66c81c7 100644 --- a/exasol/toolbox/templates/github/workflows/matrix-all.yml +++ b/exasol/toolbox/templates/github/workflows/matrix-all.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/matrix-exasol.yml b/exasol/toolbox/templates/github/workflows/matrix-exasol.yml index 51894e837..d3e528c14 100644 --- a/exasol/toolbox/templates/github/workflows/matrix-exasol.yml +++ b/exasol/toolbox/templates/github/workflows/matrix-exasol.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/matrix-python.yml b/exasol/toolbox/templates/github/workflows/matrix-python.yml index 28a75d3c5..e83a91ad3 100644 --- a/exasol/toolbox/templates/github/workflows/matrix-python.yml +++ b/exasol/toolbox/templates/github/workflows/matrix-python.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/report.yml b/exasol/toolbox/templates/github/workflows/report.yml index 3e5345016..e58592cd5 100644 --- a/exasol/toolbox/templates/github/workflows/report.yml +++ b/exasol/toolbox/templates/github/workflows/report.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "(( minimum_python_version ))" poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/templates/github/workflows/slow-checks.yml b/exasol/toolbox/templates/github/workflows/slow-checks.yml index 634fb78f0..da1974bfc 100644 --- a/exasol/toolbox/templates/github/workflows/slow-checks.yml +++ b/exasol/toolbox/templates/github/workflows/slow-checks.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v6 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: ${{ matrix.python-version }} poetry-version: "(( dependency_manager_version ))" diff --git a/exasol/toolbox/version.py b/exasol/toolbox/version.py index c7c7c31ff..a1392f5a6 100644 --- a/exasol/toolbox/version.py +++ b/exasol/toolbox/version.py @@ -8,8 +8,8 @@ `poetry version X.Y.Z`. """ -MAJOR = 4 +MAJOR = 5 MINOR = 0 -PATCH = 1 +PATCH = 0 VERSION = f"{MAJOR}.{MINOR}.{PATCH}" __version__ = VERSION diff --git a/project-template/cookiecutter.json b/project-template/cookiecutter.json index 3aa430337..79925b560 100644 --- a/project-template/cookiecutter.json +++ b/project-template/cookiecutter.json @@ -9,7 +9,7 @@ "author_email": "opensource@exasol.com", "project_short_tag": "", "python_version_min": "3.10", - "exasol_toolbox_version_range": ">=4.0.1,<5", + "exasol_toolbox_version_range": ">=5.0.0,<6", "license_year": "{% now 'utc', '%Y' %}", "__repo_name_slug": "{{cookiecutter.package_name}}", "__package_name_slug": "{{cookiecutter.package_name}}", diff --git a/pyproject.toml b/pyproject.toml index d0a819736..9c449a64f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "exasol-toolbox" -version = "4.0.1" +version = "5.0.0" description = "Your one-stop solution for managing all standard tasks and core workflows of your Python project." authors = [ { name = "Nicola Coretti", email = "nicola.coretti@exasol.com" }, diff --git a/test/integration/project-template/conftest.py b/test/integration/project-template/conftest.py index d174349be..943b33ab8 100644 --- a/test/integration/project-template/conftest.py +++ b/test/integration/project-template/conftest.py @@ -28,13 +28,13 @@ def new_project(cwd): @pytest.fixture(scope="session", autouse=True) def poetry_install(run_command, poetry_path): - run_command([poetry_path, "install"]) # The tests want to verify the current branch of the PTB incl. its cookiecutter # template before releasing the PTB. The following command therefore modifies the # dependency to the PTB itself in the pyproject.toml file by replacing the latest # released PTB version with the current checked-out branch in # PROJECT_CONFIG.root_path: run_command([poetry_path, "add", "--group", "dev", PROJECT_CONFIG.root_path]) + run_command([poetry_path, "install"]) @pytest.fixture(scope="session") diff --git a/test/unit/tools/test_template.py b/test/unit/tools/test_template.py index c30e75582..354695805 100644 --- a/test/unit/tools/test_template.py +++ b/test/unit/tools/test_template.py @@ -1,15 +1,64 @@ from contextlib import ExitStack from inspect import cleandoc -from pathlib import Path import pytest from yaml.parser import ParserError from exasol.toolbox.tools.template import ( _render_template, - _templates, ) -from exasol.toolbox.tools.workflow import PKG + +TEMPLATE = """ +name: Publish Documentation + +on: + workflow_call: + workflow_dispatch: + +jobs: + + build-documentation: + runs-on: "(( os_version ))" + permissions: + contents: read + steps: + - name: SCM Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@v5 + with: + python-version: "(( minimum_python_version ))" + poetry-version: "(( dependency_manager_version ))" + + - name: Build Documentation + run: | + poetry run -- nox -s docs:multiversion + mv .html-documentation html-documentation + + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: html-documentation + + deploy-documentation: + needs: [ build-documentation ] + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: "(( os_version ))" + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + +""" RENDERED_TEMPLATE = """ name: Publish Documentation @@ -31,7 +80,7 @@ fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@v4 + uses: exasol/python-toolbox/.github/actions/python-environment@v5 with: python-version: "3.10" poetry-version: "2.3.0" @@ -83,13 +132,12 @@ class TestRenderTemplate: - pkg = PKG - template = "gh-pages" - - def test_works_as_expected(self): - src = Path(_templates(self.pkg)[self.template]) + @staticmethod + def test_works_as_expected(tmp_path): + file_path = tmp_path / "test.yml" + file_path.write_text(TEMPLATE) with ExitStack() as stack: - rendered_str = _render_template(src=src, stack=stack) + rendered_str = _render_template(src=file_path, stack=stack) assert rendered_str == cleandoc(RENDERED_TEMPLATE) + "\n" @staticmethod