Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Build & Check Package

on:
push:
# branches:
# - main
paths:
- '**.py'
- pyproject.toml
pull_request:
paths:
- '**.py'
- pyproject.toml

jobs:
ruff-linter:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Hatch
run: pip install hatch

- name: Install dependencies
run: hatch env create dev

- name: Run ruff lint
run: hatch run dev:lint

check-python-compatibility:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
run: pip install hatch

- name: Install dependencies
run: hatch env create dev

- name: Build wheel with Hatch
run: hatch build

- name: Install built wheel
run: pip install dist/*.whl

- name: Test import
run: python -c "import Visualizer"

run-acceptance-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Hatch
run: pip install hatch

- name: Install dependencies
run: hatch env create dev

- name: Build wheel with Hatch
run: hatch build

- name: Run robot framework acceptance-tests
run: hatch run dev:atest

# run-unit-tests:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.12'

# - name: Install Hatch
# run: pip install hatch

# - name: Install dependencies
# run: hatch env create dev

# - name: Build wheel with Hatch
# run: hatch build

# - name: Run unit tests with pytest
# run: hatch run dev:utest
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Bump Version From PR Title

on:
pull_request:
types: [closed]
branches: [main]

jobs:
bump-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Hatch
run: pip install hatch

- name: Install dependencies
run: hatch env create dev

- name: Determine bump level and bump version
id: bump
run: |
TITLE="${{ github.event.pull_request.title }}"
echo "PR Title: $TITLE"

if [[ "$TITLE" == major:* ]]; then
hatch version major
echo "bump=true" >> $GITHUB_OUTPUT
elif [[ "$TITLE" == minor:* ]]; then
hatch version minor
echo "bump=true" >> $GITHUB_OUTPUT
elif [[ "$TITLE" == patch:* ]]; then
hatch version patch
echo "bump=true" >> $GITHUB_OUTPUT
else
echo "No version bump (chore or other)."
echo "bump=false" >> $GITHUB_OUTPUT
fi

- name: Commit and push version
if: steps.bump.outputs.bump == 'true'
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git add src/Visualizer/__about__.py
git commit -m "chore: bump version"
git push

- name: Build wheel with Hatch
run: hatch build

# - name: Publish to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# run: twine upload dist/*

# - name: Publish to Test PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
# run: |
# pip install twine
# twine upload --repository-url https://test.pypi.org/legacy/ dist/*

- name: Get new version
if: steps.bump.outputs.bump == 'true'
id: version
run: |
VERSION=$(grep '__version__' src/Visualizer/__about__.py | cut -d '"' -f2)
echo "version=v$VERSION" >> $GITHUB_OUTPUT

- name: Create Git Tag
if: steps.bump.outputs.bump == 'true'
run: |
git tag ${{ steps.version.outputs.version }}
git push origin ${{ steps.version.outputs.version }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Robot Framework
results/**
log.html
report.html
output.xml
graph*.png
.vscode/**

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# robot-visualizer
Keywords from this repository can visualize CSV data as graph within the robotframework test results.
Keywords from this repository can visualize CSV data as graph within the robotframework log file.

## Statistics

[![Release Pipeline](https://github.com/MarvKler/robotframework-visualizer/actions/workflows/release.yml/badge.svg)](https://github.com/MarvKler/robotframework-visualizer/actions/workflows/release.yml)
[![PyPI - Version](https://img.shields.io/pypi/v/robotframework-visualizer.svg)](https://pypi.org/project/robotframework-visualizer)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/robotframework-visualizer.svg)](https://pypi.org/project/robotframework-visualizer)
[![PyPI Downloads - Total](https://static.pepy.tech/badge/robotframework-visualizer)](https://pepy.tech/projects/robotframework-visualizer)
[![PyPI Downloads - Monthly](https://static.pepy.tech/badge/robotframework-visualizer/month)](https://pepy.tech/projects/robotframework-visualizer)
90 changes: 90 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "robotframework-visualizer"
dynamic = ["version"]
description = "A Robot Framework library providing keywords for the visualization of 'date / value' objects."
readme = "README.md"
requires-python = ">=3.8"
authors = [
{ name = "Marvin Klerx", email = "[email protected]" }
]
license = { text = "Apache-2.0" }
classifiers = [
"Development Status :: 1 - Planning",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"overrides",
"robotframework",
"robotframework-pythonlibcore",
"pandas",
"matplotlib"
]


[project.optional-dependencies]
dev = [
"hatch",
"ruff",
"pytest"
]

[project.urls]
Repository = "https://github.com/MarvKler/robotframework-visualizer"
Documentation = "https://github.com/MarvKler/robotframework-visualizer#readme"
Issues = "https://github.com/MarvKler/robotframework-visualizer/issues"

[tool.hatch.build.targets.wheel]
require-runtime-dependencies = true
only-include = ["src/Visualizer"]
sources = ["src"]

[tool.hatch.version]
path = "src/Visualizer/__about__.py"

[tool.hatch.build]
dev-mode-dirs = ["src"]

[tool.hatch.envs.types]
extra-dependencies = [
"mypy>=1.0.0",
]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/Visualizer tests}"

[tool.coverage.run]
source_pkgs = ["Visualizer", "tests"]
branch = true
parallel = true
omit = [
"src/Visualizer/__about__.py",
]

[tool.coverage.paths]
robotframework_visualizer = ["src/Visualizer", "*/src/Visualizer"]
tests = ["tests", "*/robotframework-tablelibrary/tests"]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.hatch.envs.dev]
dependencies = [
"ruff",
"pytest"
]
[tool.hatch.envs.dev.scripts]
lint = "ruff check ."
atest = "robot tests/atest/"
utest = "pytest"
1 change: 1 addition & 0 deletions src/Visualizer/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.0"
32 changes: 32 additions & 0 deletions src/Visualizer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

from robot.api.deco import library
from robotlibcore import HybridCore
from .__about__ import __version__

from .keywords import (
Keywords
)

@library(
scope='GLOBAL',
version=__version__
)
class Visualizer(HybridCore):
"""
Visualizer Library for creating visual diagrams as embedded 'png' images in the Robot Framework log file.\n

= Current Implementation =
The initial idea of the library was to create diagrams with the date time series on the x-axis & the raw value on the y-axis.\n
Currently, you need to pass the CSV header names into keyword to visualize the correct data.

= Future Implementation =
The future implementation idea is, to pass multiple CSV header names into the keyword to visualize more than one value time series on the y-axis.
The x-axis should be kept reserved for the datetime time-series.
"""

def __init__(self):

libraries = [
Keywords()
]
super().__init__(libraries)
5 changes: 5 additions & 0 deletions src/Visualizer/keywords/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .keywords import Keywords

__all__ = [
"Keywords"
]
Loading
Loading