From 0e73a227822f30ad109a008e0bc53dd722df3d69 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 29 Apr 2026 11:02:51 +0200 Subject: [PATCH 1/2] Ensure pyproject.toml updated for release preparation --- doc/changes/changes_7.0.0.md | 4 ++++ exasol/toolbox/util/version.py | 2 +- test/integration/project-template/conftest.py | 9 ++++++++- test/integration/project-template/nox_test.py | 9 ++++++++- test/unit/util/version_test.py | 13 +++++++++++++ 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/doc/changes/changes_7.0.0.md b/doc/changes/changes_7.0.0.md index 2f4d33aecb..b156a99aec 100644 --- a/doc/changes/changes_7.0.0.md +++ b/doc/changes/changes_7.0.0.md @@ -31,3 +31,7 @@ of `main` and the transitive dependencies of `main`. * #800: Removed tbx security pretty-print, tbx lint pretty-print, and creation of .lint.txt, as superseded by Sonar and .lint.json usage * #791: Resolved Sonar concerns: accepted specific `subprocess` import usage, `subprocess` commands, & improved minor maintainability items * #629: Replace `version.py` with version from the `__init__.py` + +## Bug Fix + +* #808: Resolved `release:prepare` to update `pyproject.toml` diff --git a/exasol/toolbox/util/version.py b/exasol/toolbox/util/version.py index 1cde7ab5d2..5fae4f8bde 100644 --- a/exasol/toolbox/util/version.py +++ b/exasol/toolbox/util/version.py @@ -99,7 +99,7 @@ def from_poetry(): @poetry_command def upgrade_version_from_poetry(t: ReleaseTypes): output = subprocess.run( # nosec: B603, B607 - allow fixed poetry command - ["poetry", "version", str(t), "--dry-run", "--no-ansi", "--short"], + ["poetry", "version", str(t), "--no-ansi", "--short"], capture_output=True, text=True, ) diff --git a/test/integration/project-template/conftest.py b/test/integration/project-template/conftest.py index b5b452f4bd..da51b4a2a4 100644 --- a/test/integration/project-template/conftest.py +++ b/test/integration/project-template/conftest.py @@ -54,7 +54,14 @@ def poetry_install(run_command, poetry_path): # released PTB version with the current checked-out branch in # PROJECT_CONFIG.root_path: run_command( - [poetry_path, "add", "--group", "dev", "--editable", PROJECT_CONFIG.root_path] + [ + poetry_path, + "add", + "--group", + "dev", + "--editable", + str(PROJECT_CONFIG.root_path), + ] ) # This is needed due to pysonar hard-pinning requests. Without this addition, # the selected requests has an active vulnerability. diff --git a/test/integration/project-template/nox_test.py b/test/integration/project-template/nox_test.py index cc5767ad91..9313f28cba 100644 --- a/test/integration/project-template/nox_test.py +++ b/test/integration/project-template/nox_test.py @@ -1,3 +1,6 @@ +from exasol.toolbox.util.version import Version + + class TestSpecificNoxTasks: """ Within the PTB, we have nox tasks that are inherently dependent upon other ones @@ -58,7 +61,10 @@ def test_package_check(self, poetry_path, run_command): assert output.returncode == 0 - def test_release_prepare(self, poetry_path, run_command): + def test_release_prepare(self, poetry_path, run_command, new_project, monkeypatch): + monkeypatch.chdir(new_project) + assert Version.from_poetry() == Version(0, 1, 0) + release_prepare = self._command( poetry_path, task="release:prepare", @@ -67,6 +73,7 @@ def test_release_prepare(self, poetry_path, run_command): output = run_command(release_prepare) assert output.returncode == 0 + assert Version.from_poetry() == Version(0, 2, 0) def test_install_github_workflows(self, poetry_path, run_command): install_workflows = self._command( diff --git a/test/unit/util/version_test.py b/test/unit/util/version_test.py index ec6251d487..319a5d0450 100644 --- a/test/unit/util/version_test.py +++ b/test/unit/util/version_test.py @@ -5,6 +5,7 @@ from exasol.toolbox.error import ToolboxError from exasol.toolbox.util.version import ( + ReleaseTypes, Version, poetry_command, ) @@ -67,6 +68,18 @@ def test_version_from_poetry(poetry_version, version, expected): assert expected == actual +def test_upgrade_version_from_poetry_applies_version_change(tmp_path, monkeypatch): + (tmp_path / "pyproject.toml").write_text( + '[project]\nname = "sample-project"\nversion = "0.1.0"\n' + ) + monkeypatch.chdir(tmp_path) + assert Version.from_poetry() == Version(0, 1, 0) + + actual = Version.upgrade_version_from_poetry(ReleaseTypes.Minor) + + assert actual == Version(0, 2, 0) + + @patch("exasol.toolbox.util.version.which", return_value=None) def test_poetry_decorator_no_poetry_executable(mock): @poetry_command From 180414374a7acabdc17b5285b204495c0ebc2854 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 29 Apr 2026 11:03:18 +0200 Subject: [PATCH 2/2] Fix pyproject.toml for newest release being prepared --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b97c3fa5a4..516496220d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "exasol-toolbox" -version = "6.4.0" +version = "7.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" },