Skip to content

Commit

Permalink
Make code Python 3.8+ compatible and bump version to 0.0.3
Browse files Browse the repository at this point in the history
The `|` operator in type hints was introduced in 3.10, so we use
`typing.Optional` instead.

Also run tests for all Python version >=3.8.
  • Loading branch information
jherbel committed Jul 29, 2024
1 parent cd212d3 commit aa3f89f
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 40 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ on:
jobs:
tests:
uses: ./.github/workflows/tests.yaml

check_success:
runs-on: ubuntu-latest
needs:
- tests
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
7 changes: 6 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
python-version: ${{ matrix.python_version }}

- run: python3 -m pip install poetry

Expand Down
3 changes: 2 additions & 1 deletion RobotmkLibrary/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# pylint: disable=invalid-name, missing-module-docstring
import logging
from typing import Optional


def monitor_subsequent_keyword_runtime( # pylint: disable=missing-function-docstring
*,
discover_as: str | None = None,
discover_as: Optional[str] = None,
) -> None:
logging.info(
"The subsequent keyword will be discovered in Checkmk using its own name"
Expand Down
72 changes: 36 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "robotframework-robotmklibrary"
version = "0.0.2"
version = "0.0.3"
description = "A Robot Framework keyword library intended to be used with Robotmk."
authors = ["Jörg Herbel <joerg.herbel@checkmk.com>"]
packages = [
Expand All @@ -9,7 +9,7 @@ packages = [
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8" # "^3" would be sufficient for our code, but fails to resolve
python = "^3.8" # anything lower than 3.8 fails to resolve

[tool.poetry.group.dev]
optional = true
Expand Down

0 comments on commit aa3f89f

Please sign in to comment.