From c9779c4415bc16efb3be3e5786aa60d0123415e2 Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Wed, 24 Jan 2024 21:14:30 +0000 Subject: [PATCH 01/10] Move main clir functions to modules.py --- clir/{utils/objects.py => modules.py} | 0 clir/utils/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename clir/{utils/objects.py => modules.py} (100%) delete mode 100644 clir/utils/__init__.py diff --git a/clir/utils/objects.py b/clir/modules.py similarity index 100% rename from clir/utils/objects.py rename to clir/modules.py diff --git a/clir/utils/__init__.py b/clir/utils/__init__.py deleted file mode 100644 index e69de29..0000000 From 3f0b14aba0d2b232e78778b83102a873c8fdc78d Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Wed, 24 Jan 2024 21:15:06 +0000 Subject: [PATCH 02/10] Change call to clir modules --- clir/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clir/cli.py b/clir/cli.py index 871689b..df3dfc6 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.modules import Command +from clir.modules import CommandTable @click.group() def cli(): From 68b9257d1530a9f47200456bb7f213dab17b3577 Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Wed, 24 Jan 2024 21:17:03 +0000 Subject: [PATCH 03/10] Change task name --- .github/workflows/test-clir.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-clir.yml b/.github/workflows/test-clir.yml index 520198d..73b9111 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: From 1e3cce3e5d3226948e81375b7f0dd8bf53b610b0 Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Wed, 24 Jan 2024 21:20:55 +0000 Subject: [PATCH 04/10] Move main clir functions file name to command.py --- clir/{modules.py => command.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename clir/{modules.py => command.py} (100%) diff --git a/clir/modules.py b/clir/command.py similarity index 100% rename from clir/modules.py rename to clir/command.py From 7a62b857937f88ad769c819b8736101eb9dd98c7 Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Wed, 24 Jan 2024 21:21:17 +0000 Subject: [PATCH 05/10] Change call to clir modules to clir.command --- clir/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clir/cli.py b/clir/cli.py index df3dfc6..ae5c703 100644 --- a/clir/cli.py +++ b/clir/cli.py @@ -2,8 +2,8 @@ import os import subprocess from rich.prompt import Prompt -from clir.modules import Command -from clir.modules import CommandTable +from clir.command import Command +from clir.command import CommandTable @click.group() def cli(): From 888843cae7b02161f66396be2e82991e062e1e9b Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Thu, 25 Jan 2024 22:25:34 +0000 Subject: [PATCH 06/10] Add support to create multiple files for clir config --- clir/cli.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/clir/cli.py b/clir/cli.py index ae5c703..4e06db6 100644 --- a/clir/cli.py +++ b/clir/cli.py @@ -22,17 +22,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) @@ -83,4 +85,10 @@ def cp(tag: str = "", grep: str = ""): @click.option('-g', '--grep', help="Search by grep") def tags(grep: str = ""): table = CommandTable(grep=grep) - table.show_tags() \ No newline at end of file + table.show_tags() + +@cli.command(help="Back up commands 🗄") +@click.option('-n', '--now', is_flag=True, help="Backup commands right away") +def backup(now): + if now: + print("Do backup now") \ No newline at end of file From 9e20358214870b68e571895ecc41cbf7b226febd Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Wed, 31 Jan 2024 22:53:29 +0000 Subject: [PATCH 07/10] Add textual in dependencies --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0f40099..4b2fa89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ python = "^3.7" rich = "^13.5.2" click = "^8.1.7" rich-click = "^1.7.0" +textual = "^0.47.1" [build-system] requires = ["poetry-core"] From ad74286b3c69ca316b51547f310e1171e2c966ac Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Fri, 15 Mar 2024 21:13:12 +0100 Subject: [PATCH 08/10] Remove backup cli entry --- clir/cli.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/clir/cli.py b/clir/cli.py index dfe9f82..0ba2df7 100644 --- a/clir/cli.py +++ b/clir/cli.py @@ -86,10 +86,4 @@ def cp(tag: str = "", grep: str = ""): @click.option('-g', '--grep', help="Search by grep") def tags(grep: str = ""): table = CommandTable(grep=grep) - table.show_tags() - -@cli.command(help="Back up commands 🗄") -@click.option('-n', '--now', is_flag=True, help="Backup commands right away") -def backup(now): - if now: - print("Do backup now") \ No newline at end of file + table.show_tags() \ No newline at end of file From 63c27e76030bd666f3e4f4aa3a01372b906788cd Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Thu, 25 Apr 2024 22:18:54 +0200 Subject: [PATCH 09/10] Petry --- poetry.lock | 82 ++++++++++++++++++++++++++++++++++++-------------- pyproject.toml | 2 +- 2 files changed, 60 insertions(+), 24 deletions(-) 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 4b2fa89..3f370f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ 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" From f771d2418b04782bbc9069a42cb376f52db6ae52 Mon Sep 17 00:00:00 2001 From: Elkin Aguas Date: Thu, 25 Apr 2024 22:24:03 +0200 Subject: [PATCH 10/10] Remove python 7 from tests --- .github/workflows/test-clir.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-clir.yml b/.github/workflows/test-clir.yml index 73b9111..ea2fd6c 100644 --- a/.github/workflows/test-clir.yml +++ b/.github/workflows/test-clir.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.7","3.8","3.9","3.10"] + python-version: ["3.8","3.9","3.10"] steps: - uses: actions/checkout@v4