From 29e1103be8fa989aa725af4d8cbf63ebfbbf8307 Mon Sep 17 00:00:00 2001 From: Damien Garros Date: Thu, 18 Jul 2024 13:50:13 +0200 Subject: [PATCH] Properly remove typer cli and update documentation --- .../reference/infrahub-cli/infrahub-db.mdx | 4 +- poetry.lock | 22 +----- pyproject.toml | 3 +- python_sdk/poetry.lock | 78 +++++-------------- python_sdk/pyproject.toml | 3 +- 5 files changed, 27 insertions(+), 83 deletions(-) diff --git a/docs/docs/reference/infrahub-cli/infrahub-db.mdx b/docs/docs/reference/infrahub-cli/infrahub-db.mdx index b45fb5e992..1c93c09338 100644 --- a/docs/docs/reference/infrahub-cli/infrahub-db.mdx +++ b/docs/docs/reference/infrahub-cli/infrahub-db.mdx @@ -35,7 +35,7 @@ $ infrahub db constraint [OPTIONS] [ACTION]:[show|add|drop] [CONFIG_FILE] **Arguments**: -* `[ACTION]:[show|add|drop]`: [default: ConstraintAction.SHOW] +* `[ACTION]:[show|add|drop]`: [default: show] * `[CONFIG_FILE]`: [env var: INFRAHUB_CONFIG;default: infrahub.toml] **Options**: @@ -54,7 +54,7 @@ $ infrahub db index [OPTIONS] [ACTION]:[show|add|drop] [CONFIG_FILE] **Arguments**: -* `[ACTION]:[show|add|drop]`: [default: IndexAction.SHOW] +* `[ACTION]:[show|add|drop]`: [default: show] * `[CONFIG_FILE]`: [env var: INFRAHUB_CONFIG;default: infrahub.toml] **Options**: diff --git a/poetry.lock b/poetry.lock index f549bdb150..8aff34a251 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1828,12 +1828,12 @@ pytest = {version = "*", optional = true} pyyaml = {version = "^6", optional = true} rich = {version = "^13", optional = true} toml = {version = "^0.10", optional = true} -typer = {version = "^0", optional = true} +typer = {version = "^0.12.3", optional = true} ujson = "^5" [package.extras] -all = ["Jinja2 (>=3,<4)", "numpy (>=1.24.2,<2.0.0)", "numpy (>=1.26.2,<2.0.0)", "pyarrow (>=14,<15)", "pytest", "pyyaml (>=6,<7)", "rich (>=13,<14)", "toml (>=0.10,<0.11)", "typer (>=0,<1)"] -ctl = ["Jinja2 (>=3,<4)", "numpy (>=1.24.2,<2.0.0)", "numpy (>=1.26.2,<2.0.0)", "pyarrow (>=14,<15)", "pyyaml (>=6,<7)", "rich (>=13,<14)", "toml (>=0.10,<0.11)", "typer (>=0,<1)"] +all = ["Jinja2 (>=3,<4)", "numpy (>=1.24.2,<2.0.0)", "numpy (>=1.26.2,<2.0.0)", "pyarrow (>=14,<15)", "pytest", "pyyaml (>=6,<7)", "rich (>=13,<14)", "toml (>=0.10,<0.11)", "typer (>=0.12.3,<0.13.0)"] +ctl = ["Jinja2 (>=3,<4)", "numpy (>=1.24.2,<2.0.0)", "numpy (>=1.26.2,<2.0.0)", "pyarrow (>=14,<15)", "pyyaml (>=6,<7)", "rich (>=13,<14)", "toml (>=0.10,<0.11)", "typer (>=0.12.3,<0.13.0)"] tests = ["Jinja2 (>=3,<4)", "pytest", "pyyaml (>=6,<7)", "rich (>=13,<14)"] [package.source] @@ -4382,20 +4382,6 @@ rich = ">=10.11.0" shellingham = ">=1.3.0" typing-extensions = ">=3.7.4.3" -[[package]] -name = "typer-cli" -version = "0.12.3" -description = "Typer, build great CLIs. Easy to code. Based on Python type hints." -optional = false -python-versions = ">=3.7" -files = [ - {file = "typer_cli-0.12.3-py3-none-any.whl", hash = "sha256:33ee23585e3013804354e0db21b06880960056c6a52012bdaba62dbf6e9e46ed"}, - {file = "typer_cli-0.12.3.tar.gz", hash = "sha256:1f66684489ea15b08f613d76948c4f99d6b69c69de47010bbc0032d9de4d45b5"}, -] - -[package.dependencies] -typer = "0.12.3" - [[package]] name = "types-python-slugify" version = "8.0.2.20240310" @@ -5128,4 +5114,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.10, < 3.13" -content-hash = "7076dbde36634bbaaf935219f945ecddab717ba4326c0e39353bc66a6819fb13" +content-hash = "935c5560e88059897ddb9d4a1fefb4ee2a67745524c0543b8a5f791b0adbc634" diff --git a/pyproject.toml b/pyproject.toml index 723b08fde8..7c5a26eb9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ structlog = "24.1.0" boto3 = "1.34.129" email-validator = "~2.1" redis = { version = "^5.0.0", extras = ["hiredis"]} -typer = "~0.12" +typer = "0.12.3" # Dependencies specific to the API Server fastapi = "~0.111" @@ -76,7 +76,6 @@ pre-commit = "^2.20.0" types-toml = "*" types-ujson = "*" types-pyyaml = "*" -typer-cli = "*" ruff = "0.5.0" invoke = "2.2.0" pytest-benchmark = "^4.0.0" diff --git a/python_sdk/poetry.lock b/python_sdk/poetry.lock index c3beaa4464..31bfcfa40c 100644 --- a/python_sdk/poetry.lock +++ b/python_sdk/poetry.lock @@ -519,24 +519,6 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] -[[package]] -name = "importlib-metadata" -version = "1.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -files = [ - {file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"}, - {file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"}, -] - -[package.dependencies] -zipp = ">=0.5" - -[package.extras] -docs = ["rst.linker", "sphinx"] -testing = ["importlib-resources (>=1.3)", "packaging", "pep517"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -1643,6 +1625,17 @@ files = [ doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +[[package]] +name = "shellingham" +version = "1.5.4" +description = "Tool to Detect Surrounding Shell" +optional = true +python-versions = ">=3.7" +files = [ + {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"}, + {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, +] + [[package]] name = "six" version = "1.16.0" @@ -1745,39 +1738,21 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "typer" -version = "0.9.0" +version = "0.12.3" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = true -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "typer-0.9.0-py3-none-any.whl", hash = "sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee"}, - {file = "typer-0.9.0.tar.gz", hash = "sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2"}, + {file = "typer-0.12.3-py3-none-any.whl", hash = "sha256:070d7ca53f785acbccba8e7d28b08dcd88f79f1fbda035ade0aecec71ca5c914"}, + {file = "typer-0.12.3.tar.gz", hash = "sha256:49e73131481d804288ef62598d97a1ceef3058905aa536a1134f90891ba35482"}, ] [package.dependencies] -click = ">=7.1.1,<9.0.0" +click = ">=8.0.0" +rich = ">=10.11.0" +shellingham = ">=1.3.0" typing-extensions = ">=3.7.4.3" -[package.extras] -all = ["colorama (>=0.4.3,<0.5.0)", "rich (>=10.11.0,<14.0.0)", "shellingham (>=1.3.0,<2.0.0)"] -dev = ["autoflake (>=1.3.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "pre-commit (>=2.17.0,<3.0.0)"] -doc = ["cairosvg (>=2.5.2,<3.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=8.1.4,<9.0.0)", "pillow (>=9.3.0,<10.0.0)"] -test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6.0.0)", "mypy (==0.910)", "pytest (>=4.4.0,<8.0.0)", "pytest-cov (>=2.10.0,<5.0.0)", "pytest-sugar (>=0.9.4,<0.10.0)", "pytest-xdist (>=1.32.0,<4.0.0)", "rich (>=10.11.0,<14.0.0)", "shellingham (>=1.3.0,<2.0.0)"] - -[[package]] -name = "typer-cli" -version = "0.0.1" -description = "" -optional = false -python-versions = ">=3.6,<4.0" -files = [ - {file = "typer-cli-0.0.1.tar.gz", hash = "sha256:92384d25a322e6f0ee970c055c9112de77034ed66b6e64ace4cae9e99d576bd3"}, - {file = "typer_cli-0.0.1-py3-none-any.whl", hash = "sha256:cfbde8585d2aff510e7b7f84fdd281d172da72c792b21e3ac346ef8845ddbd01"}, -] - -[package.dependencies] -importlib_metadata = ">=1.5,<2.0" - [[package]] name = "types-python-slugify" version = "8.0.2.20240310" @@ -1984,21 +1959,6 @@ pyyaml = "*" [package.extras] dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"] -[[package]] -name = "zipp" -version = "3.19.2" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.8" -files = [ - {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, - {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, -] - -[package.extras] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] - [extras] all = ["Jinja2", "numpy", "numpy", "pyarrow", "pytest", "pyyaml", "rich", "toml", "typer"] ctl = ["Jinja2", "numpy", "numpy", "pyarrow", "pyyaml", "rich", "toml", "typer"] @@ -2007,4 +1967,4 @@ tests = ["Jinja2", "pytest", "pyyaml", "rich"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e8be7682a954b971f5bb8023f19348d73882c3e08e71239d08da473f01321041" +content-hash = "eb3e409b617c9427e3958b14314fb34141acd9c922fc038a9ec222bce2a79f31" diff --git a/python_sdk/pyproject.toml b/python_sdk/pyproject.toml index 028bfe07d1..1347d9a5c8 100644 --- a/python_sdk/pyproject.toml +++ b/python_sdk/pyproject.toml @@ -43,7 +43,7 @@ numpy = [ pyarrow = { version = "^14", optional = true } rich = { version = "^13", optional = true } toml = { version = "^0.10", optional = true } -typer = { version = "^0", optional = true } +typer = { version = "^0.12.3", optional = true } pytest = { version = "*", optional = true } pyyaml = { version = "^6", optional = true } @@ -62,7 +62,6 @@ pre-commit = "^2.20.0" types-toml = "*" types-ujson = "*" types-pyyaml = "*" -typer-cli = "*" ruff = "0.5.0" pytest-xdist = "^3.3.1" types-python-slugify = "^8.0.0.3"