diff --git a/.github/workflows/test-clir.yml b/.github/workflows/test-clir.yml index bb2d5cf..ea2fd6c 100644 --- a/.github/workflows/test-clir.yml +++ b/.github/workflows/test-clir.yml @@ -1,4 +1,4 @@ -name: Python package +name: Test Clir on: pull_request: diff --git a/clir/cli.py b/clir/cli.py index b8076fa..0ba2df7 100644 --- a/clir/cli.py +++ b/clir/cli.py @@ -2,8 +2,8 @@ import os import subprocess from rich.prompt import Prompt -from clir.utils.objects import Command -from clir.utils.objects import CommandTable +from clir.command import Command +from clir.command import CommandTable @click.group() def cli(): @@ -23,17 +23,19 @@ def init(): os.makedirs(dir_path, exist_ok=True) # Define the file path and name - file_path = os.path.join(dir_path, 'commands.json') + files = ['commands.json', 'credentials.json'] # Check if the file already exists - if not os.path.exists(file_path): - # Create the file - with open(file_path, 'w') as file: - file.write('{}') + for file in files: + file_path = os.path.join(dir_path, file) + if not os.path.exists(file_path): + # Create the file + with open(file_path, 'w') as file_object: + file_object.write('{}') - print(f'File "{file_path}" created successfully.') - else: - print(f'A clir environment already exists in "{dir_path}".') + print(f'File "{file_path}" created successfully.') + else: + print(f'A clir environment already exists in "{dir_path}".') @cli.command(help="Save new command 💾") @click.option('-c', '--command', help="Command to be saved", prompt=True) diff --git a/clir/utils/objects.py b/clir/command.py similarity index 100% rename from clir/utils/objects.py rename to clir/command.py diff --git a/clir/utils/__init__.py b/clir/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/poetry.lock b/poetry.lock index 9bd350f..edb0c71 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "click" @@ -13,7 +13,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -27,24 +26,24 @@ files = [ ] [[package]] -name = "importlib-metadata" -version = "6.7.0" -description = "Read metadata from Python packages" +name = "linkify-it-py" +version = "2.0.3" +description = "Links recognition library with FULL unicode support." optional = false python-versions = ">=3.7" files = [ - {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, - {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, + {file = "linkify-it-py-2.0.3.tar.gz", hash = "sha256:68cda27e162e9215c17d786649d1da0021a451bdc436ef9e0fa0ba5234b9b048"}, + {file = "linkify_it_py-2.0.3-py3-none-any.whl", hash = "sha256:6bcbc417b0ac14323382aef5c5192c0075bf8a9d6b41820a2b66371eac6b6d79"}, ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" +uc-micro-py = "*" [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] +benchmark = ["pytest", "pytest-benchmark"] +dev = ["black", "flake8", "isort", "pre-commit", "pyproject-flake8"] +doc = ["myst-parser", "sphinx", "sphinx-book-theme"] +test = ["coverage", "pytest", "pytest-cov"] [[package]] name = "markdown-it-py" @@ -58,8 +57,9 @@ files = [ ] [package.dependencies] +linkify-it-py = {version = ">=1,<3", optional = true, markers = "extra == \"linkify\""} +mdit-py-plugins = {version = "*", optional = true, markers = "extra == \"plugins\""} mdurl = ">=0.1,<1.0" -typing_extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} [package.extras] benchmarking = ["psutil", "pytest", "pytest-benchmark"] @@ -71,6 +71,25 @@ profiling = ["gprof2dot"] rtd = ["attrs", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] +[[package]] +name = "mdit-py-plugins" +version = "0.4.0" +description = "Collection of plugins for markdown-it-py" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mdit_py_plugins-0.4.0-py3-none-any.whl", hash = "sha256:b51b3bb70691f57f974e257e367107857a93b36f322a9e6d44ca5bf28ec2def9"}, + {file = "mdit_py_plugins-0.4.0.tar.gz", hash = "sha256:d8ab27e9aed6c38aa716819fedfde15ca275715955f8a185a8e1cf90fb1d2c1b"}, +] + +[package.dependencies] +markdown-it-py = ">=1.0.0,<4.0.0" + +[package.extras] +code-style = ["pre-commit"] +rtd = ["myst-parser", "sphinx-book-theme"] +testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] + [[package]] name = "mdurl" version = "0.1.2" @@ -128,13 +147,31 @@ files = [ [package.dependencies] click = ">=7" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} rich = ">=10.7.0" typing-extensions = "*" [package.extras] dev = ["flake8", "flake8-docstrings", "mypy", "packaging", "pre-commit", "pytest", "pytest-cov", "types-setuptools"] +[[package]] +name = "textual" +version = "0.47.1" +description = "Modern Text User Interface framework" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "textual-0.47.1-py3-none-any.whl", hash = "sha256:da79df2e138f6de51bda84a1ee1460936bb2ecf5527ca2d47b9b59c584323327"}, + {file = "textual-0.47.1.tar.gz", hash = "sha256:4b82e317884bb1092f693f474c319ceb068b5a0b128b121f1aa53a2d48b4b80c"}, +] + +[package.dependencies] +markdown-it-py = {version = ">=2.1.0", extras = ["linkify", "plugins"]} +rich = ">=13.3.3" +typing-extensions = ">=4.4.0,<5.0.0" + +[package.extras] +syntax = ["tree-sitter (>=0.20.1,<0.21.0)", "tree_sitter_languages (>=1.7.0)"] + [[package]] name = "typing-extensions" version = "4.7.1" @@ -147,21 +184,20 @@ files = [ ] [[package]] -name = "zipp" -version = "3.15.0" -description = "Backport of pathlib-compatible object wrapper for zip files" +name = "uc-micro-py" +version = "1.0.3" +description = "Micro subset of unicode data files for linkify-it-py projects." optional = false python-versions = ">=3.7" files = [ - {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, - {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, + {file = "uc-micro-py-1.0.3.tar.gz", hash = "sha256:d321b92cff673ec58027c04015fcaa8bb1e005478643ff4a500882eaab88c48a"}, + {file = "uc_micro_py-1.0.3-py3-none-any.whl", hash = "sha256:db1dffff340817673d7b466ec86114a9dc0e9d4d9b5ba229d9d60e5c12600cd5"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +test = ["coverage", "pytest", "pytest-cov"] [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "3b3e9c2206575a8f9f1e1e3173b22d1d0aeb6e0f838179ab878f19fc16d1a92a" +python-versions = "^3.8" +content-hash = "393800358513a477d8db04111e2cb814381d2c0b072bf81c21d44ac60e7b261f" diff --git a/pyproject.toml b/pyproject.toml index 0f40099..3f370f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,11 @@ repository = "https://github.com/elkinaguas/clir" "Bug Tracker" = "https://github.com/elkinaguas/clir/issues" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" rich = "^13.5.2" click = "^8.1.7" rich-click = "^1.7.0" +textual = "^0.47.1" [build-system] requires = ["poetry-core"]