Commit e8cf9ac2 authored by David Huss's avatar David Huss 💬
Browse files

Add -V, Update dependecies

parent 218a1b75
__version__ = '0.1.0' __version__ = '0.1.27'
...@@ -4,6 +4,8 @@ import os ...@@ -4,6 +4,8 @@ import os
import time import time
import json import json
import click import click
import toml
from pathlib import Path
# Local module imports # Local module imports
...@@ -19,6 +21,16 @@ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) ...@@ -19,6 +21,16 @@ CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
def get_version():
"""
Read version
"""
path = Path(__file__).resolve().parents[1] / 'pyproject.toml'
pyproject = toml.loads(open(str(path)).read())
return pyproject['tool']['poetry']['version']
class AliasedGroup(click.Group): class AliasedGroup(click.Group):
""" """
Subclass of Group to allow abbreviating commands like this: Subclass of Group to allow abbreviating commands like this:
...@@ -37,10 +49,11 @@ class AliasedGroup(click.Group): ...@@ -37,10 +49,11 @@ class AliasedGroup(click.Group):
ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) ctx.fail('Too many matches: %s' % ', '.join(sorted(matches)))
@click.group(context_settings=CONTEXT_SETTINGS, cls=AliasedGroup) @click.group(context_settings=CONTEXT_SETTINGS, cls=AliasedGroup, invoke_without_command=True)
@click.option('--userconfig', '-u', is_flag=True, help="Use user config even if on server") @click.option('--userconfig', '-u', is_flag=True, help="Use user config even if on server")
@click.option('--watch', '-w', help="Run repeatedly with the given interval in seconds", type=click.IntRange(2, 2147483647, clamp=True)) @click.option('--watch', '-w', help="Run repeatedly with the given interval in seconds", type=click.IntRange(2, 2147483647, clamp=True))
def main(userconfig, watch): @click.option('--version', '-V', is_flag=True, help="Show version")
def main(userconfig, watch, version):
"""BBBMON is a small CLI utility to monitor bbb usage """BBBMON is a small CLI utility to monitor bbb usage
\b \b
...@@ -49,7 +62,12 @@ def main(userconfig, watch): ...@@ -49,7 +62,12 @@ def main(userconfig, watch):
Internally bbbmon relies on the offical bbb-API, which means you need to have the server's secret in order to create a valid request. Create a new configuration with: bbbmon config --new Internally bbbmon relies on the offical bbb-API, which means you need to have the server's secret in order to create a valid request. Create a new configuration with: bbbmon config --new
""" """
pass __version__ = get_version()
if version:
print(__version__)
else:
pass
......
...@@ -84,7 +84,7 @@ description = "More routines for operating on iterables, beyond itertools" ...@@ -84,7 +84,7 @@ description = "More routines for operating on iterables, beyond itertools"
name = "more-itertools" name = "more-itertools"
optional = false optional = false
python-versions = ">=3.5" python-versions = ">=3.5"
version = "8.2.0" version = "8.3.0"
[[package]] [[package]]
category = "dev" category = "dev"
...@@ -92,7 +92,7 @@ description = "Core utilities for Python packages" ...@@ -92,7 +92,7 @@ description = "Core utilities for Python packages"
name = "packaging" name = "packaging"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "20.3" version = "20.4"
[package.dependencies] [package.dependencies]
pyparsing = ">=2.0.2" pyparsing = ">=2.0.2"
...@@ -148,7 +148,7 @@ description = "pytest: simple powerful testing with Python" ...@@ -148,7 +148,7 @@ description = "pytest: simple powerful testing with Python"
name = "pytest" name = "pytest"
optional = false optional = false
python-versions = ">=3.5" python-versions = ">=3.5"
version = "5.4.1" version = "5.4.2"
[package.dependencies] [package.dependencies]
atomicwrites = ">=1.0" atomicwrites = ">=1.0"
...@@ -196,7 +196,15 @@ description = "Python 2 and 3 compatibility utilities" ...@@ -196,7 +196,15 @@ description = "Python 2 and 3 compatibility utilities"
name = "six" name = "six"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
version = "1.14.0" version = "1.15.0"
[[package]]
category = "main"
description = "Python Library for Tom's Obvious, Minimal Language"
name = "toml"
optional = false
python-versions = "*"
version = "0.10.1"
[[package]] [[package]]
category = "main" category = "main"
...@@ -233,7 +241,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] ...@@ -233,7 +241,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"]
[metadata] [metadata]
content-hash = "7642a95ad74d3e1ffecca489d5cb42e7494a8fe6895a730f6158d96659dbf3b4" content-hash = "a83b9881a3285865e8351a75e707e006ec523a3604788c35f40448b1c5a75e1e"
python-versions = "^3.5" python-versions = "^3.5"
[metadata.files] [metadata.files]
...@@ -270,12 +278,12 @@ importlib-metadata = [ ...@@ -270,12 +278,12 @@ importlib-metadata = [
{file = "importlib_metadata-1.6.0.tar.gz", hash = "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e"}, {file = "importlib_metadata-1.6.0.tar.gz", hash = "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e"},
] ]
more-itertools = [ more-itertools = [
{file = "more-itertools-8.2.0.tar.gz", hash = "sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"}, {file = "more-itertools-8.3.0.tar.gz", hash = "sha256:558bb897a2232f5e4f8e2399089e35aecb746e1f9191b6584a151647e89267be"},
{file = "more_itertools-8.2.0-py3-none-any.whl", hash = "sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c"}, {file = "more_itertools-8.3.0-py3-none-any.whl", hash = "sha256:7818f596b1e87be009031c7653d01acc46ed422e6656b394b0f765ce66ed4982"},
] ]
packaging = [ packaging = [
{file = "packaging-20.3-py2.py3-none-any.whl", hash = "sha256:82f77b9bee21c1bafbf35a84905d604d5d1223801d639cf3ed140bd651c08752"}, {file = "packaging-20.4-py2.py3-none-any.whl", hash = "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"},
{file = "packaging-20.3.tar.gz", hash = "sha256:3c292b474fda1671ec57d46d739d072bfd495a4f51ad01a055121d81e952b7a3"}, {file = "packaging-20.4.tar.gz", hash = "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"},
] ]
pathlib2 = [ pathlib2 = [
{file = "pathlib2-2.3.5-py2.py3-none-any.whl", hash = "sha256:0ec8205a157c80d7acc301c0b18fbd5d44fe655968f5d947b6ecef5290fc35db"}, {file = "pathlib2-2.3.5-py2.py3-none-any.whl", hash = "sha256:0ec8205a157c80d7acc301c0b18fbd5d44fe655968f5d947b6ecef5290fc35db"},
...@@ -294,16 +302,20 @@ pyparsing = [ ...@@ -294,16 +302,20 @@ pyparsing = [
{file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"},
] ]
pytest = [ pytest = [
{file = "pytest-5.4.1-py3-none-any.whl", hash = "sha256:0e5b30f5cb04e887b91b1ee519fa3d89049595f428c1db76e73bd7f17b09b172"}, {file = "pytest-5.4.2-py3-none-any.whl", hash = "sha256:95c710d0a72d91c13fae35dce195633c929c3792f54125919847fdcdf7caa0d3"},
{file = "pytest-5.4.1.tar.gz", hash = "sha256:84dde37075b8805f3d1f392cc47e38a0e59518fb46a431cfdaf7cf1ce805f970"}, {file = "pytest-5.4.2.tar.gz", hash = "sha256:eb2b5e935f6a019317e455b6da83dd8650ac9ffd2ee73a7b657a30873d67a698"},
] ]
requests = [ requests = [
{file = "requests-2.23.0-py2.py3-none-any.whl", hash = "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee"}, {file = "requests-2.23.0-py2.py3-none-any.whl", hash = "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee"},
{file = "requests-2.23.0.tar.gz", hash = "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6"}, {file = "requests-2.23.0.tar.gz", hash = "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6"},
] ]
six = [ six = [
{file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"}, {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"},
{file = "six-1.14.0.tar.gz", hash = "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"}, {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"},
]
toml = [
{file = "toml-0.10.1-py2.py3-none-any.whl", hash = "sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"},
{file = "toml-0.10.1.tar.gz", hash = "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f"},
] ]
urllib3 = [ urllib3 = [
{file = "urllib3-1.25.9-py2.py3-none-any.whl", hash = "sha256:88206b0eb87e6d677d424843ac5209e3fb9d0190d0ee169599165ec25e9d9115"}, {file = "urllib3-1.25.9-py2.py3-none-any.whl", hash = "sha256:88206b0eb87e6d677d424843ac5209e3fb9d0190d0ee169599165ec25e9d9115"},
......
[tool.poetry] [tool.poetry]
name = "bbbmon" name = "bbbmon"
version = "0.1.26" version = "0.1.27"
description = "A small CLI utility to monitor bbb usage" description = "A small CLI utility to monitor bbb usage"
authors = ["David Huss <david.huss@hfbk-hamburg.de>"] authors = ["David Huss <david.huss@hfbk-hamburg.de>"]
maintainers = ["David Huss <david.huss@hfbk-hamburg.de>"] maintainers = ["David Huss <david.huss@hfbk-hamburg.de>"]
...@@ -23,6 +23,7 @@ classifiers = [ ...@@ -23,6 +23,7 @@ classifiers = [
python = "^3.5" python = "^3.5"
requests = "^2.23.0" requests = "^2.23.0"
click = "^7.1.2" click = "^7.1.2"
toml = "^0.10.1"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pytest = "^5.2" pytest = "^5.2"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment