Skip to content

Commit

Permalink
Initial 2.9.0 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tmikuska committed Nov 21, 2024
1 parent 22693cd commit 366c4c2
Show file tree
Hide file tree
Showing 9 changed files with 743 additions and 773 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,43 @@
name: CI

on:

# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
- dev
pull_request:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

- "3.13"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: matrix.python-version != '3.8'
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: Lint with flake8
if: matrix.python-version != '3.8'
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
if: matrix.python-version != '3.8'
run: |
pytest
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
rev: v0.7.4
hooks:
- id: ruff
args: [ --fix ]
Expand All @@ -21,7 +21,7 @@ repos:
- id: isort
args: [--profile, black]
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
language_version: python3
1,453 changes: 719 additions & 734 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "virl2_client"
version = "2.8.0"
version = "2.9.0-dev0"
description = "VIRL2 Client Library"
authors = ["Simon Knight <simknigh@cisco.com>", "Ralph Schmieder <rschmied@cisco.com>"]
license = "Apache-2.0"
Expand All @@ -25,21 +25,21 @@ httpx = "^0.27.0"

# https://github.com/python-poetry/poetry/pull/606 -- no support for optional dev-deps
# optional package for events
aiohttp = {version = "^3.8", optional = true}
aiohttp = {version = "^3.11", optional = true}

# optional pyATS package
# (this pulls in a lot more dependencies)
# it does not pull in genie, need to specify extras=["full"] for pyATS.
pyats = {version = "^24", optional = true}

# optional packages for documentation build
sphinx_rtd_theme = {version="^2", optional = true}
sphinx_rtd_theme = {version="^3", optional = true}
# version 8 is available but requires python>=3.10
sphinx = {version="^7", optional = true}

[tool.poetry.group.dev.dependencies]
flake8 = "^7"
pre-commit = "^3"
pre-commit = "^4"
pytest = "*"
respx = "^0.21.0"

Expand Down
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ junit_family=xunit1
asyncio_mode=auto
asyncio_default_fixture_loop_scope=function

filterwarnings =
# pyats needs to support python 3.12
ignore: pkg_resources is deprecated.*:DeprecationWarning
ignore: Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning

# start pytest with --log-level=info
# log_cli=True

Expand Down
5 changes: 0 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ def client_library_server_2_0_0():
yield from client_library_patched_system_info(version="2.0.0")


@pytest.fixture
def client_library_server_2_9_0():
yield from client_library_patched_system_info(version="2.9.0")


@pytest.fixture
def client_library_server_2_19_0():
yield from client_library_patched_system_info(version="2.19.0")
Expand Down
14 changes: 7 additions & 7 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
anyio==4.6.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
anyio==4.6.2.post1 ; python_version >= "3.9" and python_full_version < "4.0.0"
certifi==2024.8.30 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
cfgv==3.4.0 ; python_version >= "3.9" and python_full_version < "4.0.0"
colorama==0.4.6 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0" and sys_platform == "win32"
Expand All @@ -7,23 +7,23 @@ exceptiongroup==1.2.2 ; python_version >= "3.9" and python_version < "3.11"
filelock==3.16.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
flake8==7.1.1 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
h11==0.14.0 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
httpcore==1.0.6 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
httpcore==1.0.7 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
httpx==0.27.2 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
identify==2.6.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
identify==2.6.2 ; python_version >= "3.9" and python_full_version < "4.0.0"
idna==3.10 ; python_version >= "3.9" and python_full_version < "4.0.0"
iniconfig==2.0.0 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
mccabe==0.7.0 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
nodeenv==1.9.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
packaging==24.1 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
packaging==24.2 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
platformdirs==4.3.6 ; python_version >= "3.9" and python_full_version < "4.0.0"
pluggy==1.5.0 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
pre-commit==3.8.0 ; python_version >= "3.9" and python_full_version < "4.0.0"
pre-commit==4.0.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
pycodestyle==2.12.1 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
pyflakes==3.2.0 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
pytest==8.3.3 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
pyyaml==6.0.2 ; python_version >= "3.9" and python_full_version < "4.0.0"
respx==0.21.1 ; python_full_version >= "3.9.0" and python_full_version < "4.0.0"
sniffio==1.3.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
tomli==2.0.2 ; python_full_version >= "3.9.0" and python_version < "3.11"
tomli==2.1.0 ; python_full_version >= "3.9.0" and python_version < "3.11"
typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "3.11"
virtualenv==20.26.6 ; python_version >= "3.9" and python_full_version < "4.0.0"
virtualenv==20.27.1 ; python_version >= "3.9" and python_full_version < "4.0.0"
12 changes: 1 addition & 11 deletions tests/test_client_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,7 @@ def test_client_minor_version_gt_nowarn(client_library_server_current, caplog):
)


def test_client_minor_version_lt_warn(client_library_server_2_9_0, caplog):
with caplog.at_level(logging.WARNING):
client_library = ClientLibrary("somehost", "virl2", password="virl2")
assert client_library is not None
assert (
f"Please ensure the client version is compatible with the controller version. "
f"Client {CURRENT_VERSION}, controller 2.9.0." in caplog.text
)


def test_client_minor_version_lt_warn_1(client_library_server_2_19_0, caplog):
def test_client_minor_version_lt_warn(client_library_server_2_19_0, caplog):
with caplog.at_level(logging.WARNING):
client_library = ClientLibrary("somehost", "virl2", password="virl2")
assert client_library is not None
Expand Down
4 changes: 3 additions & 1 deletion virl2_client/virl2_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ClientLibrary:
"""Python bindings for the REST API of a CML controller."""

# current client version
VERSION = Version("2.8.0")
VERSION = Version("2.9.0")
# list of Version objects
INCOMPATIBLE_CONTROLLER_VERSIONS = [
Version("2.0.0"),
Expand All @@ -183,6 +183,8 @@ class ClientLibrary:
Version("2.4.1"),
Version("2.5.0"),
Version("2.5.1"),
Version("2.6.0"),
Version("2.6.1"),
]
_URL_TEMPLATES = {
"auth_test": "authok",
Expand Down

0 comments on commit 366c4c2

Please sign in to comment.