Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: greenbone/python-gvm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v24.3.0
Choose a base ref
...
head repository: greenbone/python-gvm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 814 changed files with 32,806 additions and 22,572 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -16,11 +16,12 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
uses: greenbone/workflows/.github/workflows/lint-python.yml@main
with:
lint-packages: gvm tests
python-version: ${{ matrix.python-version }}
linter: ruff
linter: ruff check

test:
name: Run tests
@@ -31,10 +32,29 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
uses: greenbone/workflows/.github/workflows/test-python.yml@main
with:
python-version: ${{ matrix.python-version }}

mypy:
name: Check type hints
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Run mypy
uses: greenbone/actions/mypy-python@v3
with:
python-version: ${{ matrix.python-version }}

codecov:
name: Upload coverage to codecov.io
needs: test
@@ -45,6 +65,7 @@ jobs:
uses: greenbone/actions/coverage-python@v3
with:
python-version: "3.10"
token: ${{ secrets.CODECOV_TOKEN }}

build-docs:
name: Build the documentation
12 changes: 0 additions & 12 deletions .github/workflows/release-pontos.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -37,12 +37,22 @@ 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/).

**To use `python-gvm` with an old GMP version (7, 8, 9) you must use a release version**
**that is `<21.05`. In the `21.05` release the support of these versions have been dropped.**
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
> that is `<21.5`. In the `21.5` release the support of these versions has been
> dropped.
> [!IMPORTANT]
> To use `python-gvm` with GMP version 20.8 or 21.4 you must use a release version
> that is `<24.6`. In the `24.6` release the support of these versions has been
> dropped.
### Requirements

@@ -53,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()

@@ -125,11 +137,13 @@ 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

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).
3 changes: 0 additions & 3 deletions docs/api/connections.rst
Original file line number Diff line number Diff line change
@@ -10,15 +10,12 @@ Connections

.. autoclass:: SSHConnection
:members:
:inherited-members:

.. autoclass:: TLSConnection
:members:
:inherited-members:

.. autoclass:: UnixSocketConnection
:members:
:inherited-members:

.. autoclass:: DebugConnection
:members:
14 changes: 7 additions & 7 deletions docs/api/gmp.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. _gmp:

.. avoid TOCtree warning by marking this file as orphan
:orphan:

GMP
^^^
.. automodule:: gvm.protocols.gmp

Protocol
--------

.. autoclass:: Gmp
.. autoclass:: GMP
:members:

.. toctree::
:maxdepth: 1

gmpv224
gmpv225
116 changes: 0 additions & 116 deletions docs/api/gmpv208.rst

This file was deleted.

Loading