Add click for CLI, add __version__ to __init__.py

This commit is contained in:
Evie Litherland-Smith 2024-03-24 08:07:00 +00:00
parent 18b75ec9aa
commit a37788a97c
4 changed files with 17 additions and 3 deletions

2
poetry.lock generated
View file

@ -560,4 +560,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "5b5fb95836d5b3dd0fc9d398a46c468246d37709185164edd068c047d7564df2"
content-hash = "b0fa64239e05270bf23d15f90756b11b36793c9b53e02e7e8cf43377163005de"

View file

@ -19,6 +19,7 @@ speedtest-logging = "speedtest_logging.main:main"
python = "^3.10"
speedtest = "^0.0.1"
pandas = "^2.2.1"
click = "^8.1.7"
[tool.poetry.group.dev.dependencies]
mypy = "^1.9.0"

View file

@ -0,0 +1 @@
__version__ = "0.1.0"

View file

@ -1,10 +1,22 @@
from pathlib import Path
import click
import pandas as pd
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:
print(pd.__version__)
print(speedtest.__version__)
"""
Entry point to run speedtest logging script
"""
print(f"{pd.__version__ = }")
print(f"{speedtest.__version__ = }")
if __name__ == "__main__":