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
37 changes: 37 additions & 0 deletions .github/workflows/test_cli_macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Simvue-CLI (macOS)
on:
push:
branches: ["main", "dev"]
pull_request:
branches: ["main", "dev"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test_build:
name: Test CLI
timeout-minutes: 20
runs-on: ["macos-latest"]
steps:
- name: Retrieve Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Dependencies
run: |
python -m pip install pytest pytest-cov
python -m pip install .
- name: Run Tests
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: |
python -m pytest -x --cov=simvue_cli --cov-report=term --cov-report=xml -c /dev/null -p no:warnings -v
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Poetry
run: pip install poetry
- name: Install Dependencies
run: |
python -m pip install pytest pytest-cov
python -m pip install .
- name: Run Tests
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: |
export SIMVUE_URL=${{ secrets.SIMVUE_URL }}
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
poetry install
poetry run pytest -x --cov=simvue_cli --cov-report=term

python -m pytest -x --cov=simvue_cli --cov-report=term --cov-report=xml -c /dev/null -p no:warnings -v
37 changes: 37 additions & 0 deletions .github/workflows/test_cli_windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Simvue-CLI (Windows)
on:
push:
branches: ["main", "dev"]
pull_request:
branches: ["main", "dev"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test_build:
name: Test CLI
timeout-minutes: 20
runs-on: ["windows-latest"]
steps:
- name: Retrieve Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Dependencies
run: |
python -m pip install pytest pytest-cov
python -m pip install .
- name: Run Tests
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: |
python -m pytest -x --cov=simvue_cli --cov-report=term --cov-report=xml -c /dev/null -p no:warnings -v -m "not unix"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,9 @@ poetry.toml
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/python

# Simvue
simvue.ini
simvue.toml

.sourcery.yaml
39 changes: 39 additions & 0 deletions Coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Coverage
As `ClickRunner` does not support coverage with `pytest-cov` this table provides an overview of what commands currently have tests, and which still need to be created:

|**Command**|**Has test?**|
|-------|---------|
|`run list` |✅|
|`run json`|✅|
|`run create`|✅|
|`run remove`|✅|
|`run close`|✅|
|`run abort`|✅|
|`run metadata`|✅|
|`run log.metrics`|✅|
|`run log.event`|✅|
|`purge`|✅|
|`alert create`|✅|
|`alert list`|✅|
|`alert json`|✅|
|`alert remove`|✅|
|`folder list`|✅|
|`tag list`|✅|
|`artifact list`|✅|
|`admin tenant list`|✅|
|`admin tenant add`|✅|
|`admin tenant json`|✅|
|`admin tenant remove`|✅|
|`admin user list`|✅|
|`admin user json`|✅|
|`admin user add`|✅|
|`admin user remove`|✅|
|`storage add s3`|✅|
|`storage remove`|✅|
|`storage list`|✅|
|`storage json`|✅|
|`config`|✅|
|`ping`|✅|
|`about`|✅|
|`monitor`|✅|
|`whoami`|✅|
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ simvue run json <run-id> | jq
The `json` command is also designed to support piping, we can retrieve the latest run and query it:

```sh
simvue run list --count 1 | simvue run json | jq
simvue run list --count 1 | simvue run json | jq
```

### Creating runs
Expand Down
1,871 changes: 0 additions & 1,871 deletions poetry.lock

This file was deleted.

100 changes: 69 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,84 @@
[tool.poetry]
[project]
name = "simvue-cli"
version = "0.1.0"
description = ""
authors = ["Kristian Zarębski <kristian.zarebski@ukaea.uk>"]
version = "1.0.0"
description = "Command Line Interface for interaction with a Simvue v3 server"
authors = [
{name = "Simvue Development Team", email = "info@simvue.io"}
]
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.10,<3.14"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: System :: Monitoring",
"Topic :: Utilities",
"Typing :: Typed"
]
keywords = [
"tracking",
"monitoring",
"metrics",
"alerting",
"metrics-gathering"
]
dependencies = [
"click-option-group>=0.5.7",
"click>=8.1.8",
"simvue>=2.1.0",
"click-log>=0.4.0",
"click-params>=0.5.0",
"toml>=0.10.2",
"tabulate>=0.9.0",
"regex>=2024.11.6",
"requests>=2.32.3",
]

[tool.poetry.dependencies]
python = "^3.12"
simvue = "^1.1.1"
click = "^8.1.7"
click-option-group = "^0.5.6"
click-log = "^0.4.0"
click-params = "^0.5.0"
click-man = "^0.4.1"
pytermgui = "^7.7.1"
tabulate = "^0.9.0"
toml = "^0.10.2"

[tool.poetry.scripts]
simvue = "simvue_cli.cli:simvue"


[tool.poetry.group.testing.dependencies]
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
pytest-sugar = "^1.0.0"

[project.urls]
homepage = "https://simvue.io"
repository = "https://github.com/simvue-io/simvue-cli"
documentation = "https://docs.simvue.io"

[tool.poetry.group.lint.dependencies]
ruff = "^0.6.9"
[project.scripts]
simvue = "simvue_cli.cli:simvue"

[tool.ruff]
lint.extend-select = ["C901", "T201"]
lint.extend-select = ["C901"]
lint.mccabe.max-complexity = 11
extend-exclude = ["tests", "examples", "notebooks"]
extend-exclude = ["tests"]

[tool.pytest.ini_options]
addopts = "--no-cov"
testpaths = [
"tests"
]
markers = [
"unix: UNIX only tests"
]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
"pytest-cov>=6.0.0",
"pytest>=8.3.5",
]
lint = [
"ruff>=0.11.2",
]

[tool.mypy]
ignore_missing_imports = true
Loading
Loading