Add click for CLI, add __version__ to __init__.py
This commit is contained in:
parent
18b75ec9aa
commit
a37788a97c
2
poetry.lock
generated
2
poetry.lock
generated
|
@ -560,4 +560,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = "^3.10"
|
python-versions = "^3.10"
|
||||||
content-hash = "5b5fb95836d5b3dd0fc9d398a46c468246d37709185164edd068c047d7564df2"
|
content-hash = "b0fa64239e05270bf23d15f90756b11b36793c9b53e02e7e8cf43377163005de"
|
||||||
|
|
|
@ -19,6 +19,7 @@ speedtest-logging = "speedtest_logging.main:main"
|
||||||
python = "^3.10"
|
python = "^3.10"
|
||||||
speedtest = "^0.0.1"
|
speedtest = "^0.0.1"
|
||||||
pandas = "^2.2.1"
|
pandas = "^2.2.1"
|
||||||
|
click = "^8.1.7"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
mypy = "^1.9.0"
|
mypy = "^1.9.0"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
__version__ = "0.1.0"
|
|
@ -1,10 +1,22 @@
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import click
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import speedtest
|
import speedtest
|
||||||
|
|
||||||
|
from . import __version__
|
||||||
|
|
||||||
|
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
|
||||||
|
|
||||||
|
|
||||||
|
@click.command(context_settings=CONTEXT_SETTINGS)
|
||||||
|
@click.version_option(version=__version__)
|
||||||
def main(*args, **kwargs) -> None:
|
def main(*args, **kwargs) -> None:
|
||||||
print(pd.__version__)
|
"""
|
||||||
print(speedtest.__version__)
|
Entry point to run speedtest logging script
|
||||||
|
"""
|
||||||
|
print(f"{pd.__version__ = }")
|
||||||
|
print(f"{speedtest.__version__ = }")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue