Skip to content

Commit

Permalink
Merge pull request #61 from jefvantongerloo/bugfix-textfsm-broken-rel…
Browse files Browse the repository at this point in the history
…ease-1.1.3

Bugfix textfsm broken release 1.1.3
  • Loading branch information
jefvantongerloo authored Jul 7, 2022
2 parents 9a42d5c + 8438e6e commit b686555
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Textfsm-aos release notes

## [1.1.1] - 07-07-2022

### Fixed

- textfsm package release 1.1.3 is broken, due to missing wheel in distribution. [GitHub textfsm issue](https://github.com/google/textfsm/issues/105)

## [1.1.0] - 28-06-2022

### Added CLI commands
Expand Down
8 changes: 4 additions & 4 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 = "textfsm_aos"
version = "1.1.0"
version = "1.1.1"
description = "Alcatel-Lucent Enterprise AOS CLI parsing (TextFSM)"
authors = ["Jef Vantongerloo <jefvantongerloo@gmail.com>"]
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ keywords = ["network automation", "textfsm", "scraping", "Alcatel-Lucent Enterpr

[tool.poetry.dependencies]
python = ">=3.8"
textfsm = "^1.1.2"
textfsm = "1.1.2"
PyYAML = "^6.0"

[tool.poetry.dev-dependencies]
Expand Down
6 changes: 4 additions & 2 deletions tests/test_parsed_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def _get_raw(platform: str, command: str) -> str:
with open(
"tests/" + platform + "_" + command + "/" + platform + "_" + command + ".txt",
"r",
encoding="utf-8",
) as structured:
raw = structured.read()
return raw
Expand All @@ -23,6 +24,7 @@ def _get_benchmark(platform: str, command: str) -> dict:
with open(
"tests/" + platform + "_" + command + "/" + platform + "_" + command + ".yml",
"r",
encoding="utf-8",
) as structured:
benchmark_parsed = yaml.safe_load(structured.read())
return benchmark_parsed
Expand All @@ -37,7 +39,7 @@ def test_parsed_data(template: dict):
)
benchmark_data = _get_benchmark(template["platform"], template["command"])

print("Parsed data: \n {0} \n".format(parsed_data))
print("Benchmark data: \n {0} \n".format(benchmark_data))
print(f"Parsed data: \n {parsed_data} \n")
print(f"Benchmark data: \n {benchmark_data} \n")

assert parsed_data == benchmark_data
6 changes: 5 additions & 1 deletion tests/test_template_index_count.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"""Pytests for TextFSM_aos project."""

import importlib.resources as pkg_resources
import textfsm_aos
from textfsm_aos import templates
import importlib.resources as pkg_resources


def test_template_index_count():
"""Check template index count"""

len_template_files = 0

template_index = textfsm_aos.parser._get_template_index()
Expand Down
6 changes: 5 additions & 1 deletion tests/test_template_index_names.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"""Pytests for TextFSM_aos project."""

import importlib.resources as pkg_resources
import textfsm_aos
from textfsm_aos import templates
import importlib.resources as pkg_resources


def test_template_index_names():
"""Check index names"""

template_files_ale = []
template_index_ale = []
template_files = pkg_resources.contents(templates)
Expand Down
2 changes: 1 addition & 1 deletion textfsm_aos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Textfsm_aos - Parse scli output and return structured data."""
from textfsm_aos import parser # noqa

__version__ = "0.1.0"
__version__ = "1.1.1"
__author__ = "Jef Vantongerloo"
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ commands = pylama textfsm_aos tests

[testenv:yamllint]
deps = yamllint
commands = yamllint tests
commands = yamllint textfsm_aos tests

[testenv:pylint]
deps = pylint
commands = pylint textfsm_aos
deps =
poetry
pylint
commands =
poetry install
pylint --disable=W0212 textfsm_aos tests

0 comments on commit b686555

Please sign in to comment.