From be2882654551ae0a9900445cb74dfb9bd4690c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 29 Jan 2025 13:41:29 +0100 Subject: [PATCH 1/6] Change: Use semver instead of calver for python-gvm releases We decided to use semantic instead if calendar versioning with the next release. This will allow to declare API compatibility constrains with every release. --- .github/workflows/release-pontos.yml | 12 ------------ .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) delete mode 100644 .github/workflows/release-pontos.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-pontos.yml b/.github/workflows/release-pontos.yml deleted file mode 100644 index 561396165..000000000 --- a/.github/workflows/release-pontos.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Release Python package - -on: - pull_request: - types: [closed] - workflow_dispatch: - -jobs: - build-and-release: - name: Create a new release - uses: greenbone/workflows/.github/workflows/release-python.yml@main - secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..6b14adf0c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release python-gvm + +on: + pull_request: + types: [closed] + workflow_dispatch: + inputs: + release-type: + type: choice + description: "Release type. One of patch, minor or major" + options: + - patch + - minor + - major + release-version: + description: "Set an explicit version, that will overwrite release-type. Fails if version is not compliant." + type: string + +jobs: + build-and-release: + name: Create a new release + uses: greenbone/workflows/.github/workflows/release-generic.yml@main + with: + versioning-scheme: semver + release-type: ${{ inputs.release-type }} + release-version: ${{ inputs.release-version }} + secrets: inherit From 3820e3e422511c37ea5dd12b64132fe875b302b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 29 Jan 2025 13:45:21 +0100 Subject: [PATCH 2/6] Change: Update README about versioning and semver usage Extend the version chapter in the README to explain our release choices. --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1d29610d0..874bb9952 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,12 @@ Please always take a look at the documentation for further details. This ### Version -Please consider to always use the **newest** version of `gvm-tools` and `python-gvm`. -We frequently update this projects to add features and keep them free from bugs. -This is why installing `python-gvm` using pip is recommended. +`python-gvm` uses [semantic versioning](https://semver.org/). + +Versions prior to 26.0.0 used [calendar versioning](https://calver.org/). + +Please consider to always use the **newest** releases of `gvm-tools` and `python-gvm`. +We frequently update these projects to add features and keep them free from bugs. > [!IMPORTANT] > To use `python-gvm` with GMP version of 7, 8 or 9 you must use a release version From 80ddf6ca6cd5398dfa162b7807bf0d81fb347b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 29 Jan 2025 13:46:26 +0100 Subject: [PATCH 3/6] Update API example in our README Use all upper case naming for GMP. Some time in the past we agreed on using all upper case naming for abbreviations. --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 874bb9952..94e2c766f 100644 --- a/README.md +++ b/README.md @@ -63,20 +63,22 @@ Python 3.9 and later is supported. You can install the latest stable release of python-gvm from the Python Package Index using [pip](https://pip.pypa.io/): - python3 -m pip install --user python-gvm +```shell +python3 -m pip install --user python-gvm +``` ## Example ```python3 from gvm.connections import UnixSocketConnection -from gvm.protocols.gmp import Gmp +from gvm.protocols.gmp import GMP from gvm.transforms import EtreeTransform from gvm.xml import pretty_print connection = UnixSocketConnection() transform = EtreeTransform() -with Gmp(connection, transform=transform) as gmp: +with GMP(connection, transform=transform) as gmp: # Retrieve GMP version supported by the remote daemon version = gmp.get_version() From cecf0f4dcd19d15ac7fbb96d8ef415203f5e9d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 29 Jan 2025 13:47:37 +0100 Subject: [PATCH 4/6] Use consistent code block style in README Don't mix indentation and tripple quotes for code blocks in the README and use a single style only. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94e2c766f..a0a3fa61f 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,10 @@ The python-gvm repository uses [autohooks](https://github.com/greenbone/autohook to apply linting and auto formatting via git hooks. Please ensure the git hooks are active. - $ poetry install - $ poetry run autohooks activate --force +```shell +poetry install +poetry run autohooks activate --force +``` ## License From 96f1e35e5299600016565ce77ad46953a823ecd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 29 Jan 2025 13:48:51 +0100 Subject: [PATCH 5/6] Change: Update copyright year in README We have 2025 now. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0a3fa61f..52fec8f1f 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,6 @@ poetry run autohooks activate --force ## License -Copyright (C) 2017-2024 [Greenbone AG](https://www.greenbone.net/) +Copyright (C) 2017-2025 [Greenbone AG](https://www.greenbone.net/) Licensed under the [GNU General Public License v3.0 or later](LICENSE). From 9048f23c76c67d7d1fae33d9827fabc8e6c61efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 29 Jan 2025 13:49:29 +0100 Subject: [PATCH 6/6] Fix: Support Python 3.9 and 3.10 for linting too Run the linter with Python >= 3.9 as the target. This wasn't an issue yet but might have caused problems with running ruff with older Python version ins future. Until the end of the year we still support Python 3.9. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c09c7bc90..157d623bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ exclude = ''' [tool.ruff] line-length = 80 -target-version = "py311" +target-version = "py39" [tool.ruff.lint] extend-select = ["I", "PLE", "PLW"]