diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..b60eeb4 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +extend-ignore = E203,E701 diff --git a/.gitignore b/.gitignore index 4f43375..1fa587f 100644 --- a/.gitignore +++ b/.gitignore @@ -175,4 +175,4 @@ pyrightconfig.json # End of https://www.toptal.com/developers/gitignore/api/python -out \ No newline at end of file +out diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..79d9956 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +repos: + - repo: https://github.com/crashappsec/pre-commit-sync + rev: 04b0e02eefa7c41bedca7456ad542e60b67c16c6 + hooks: + - id: pre-commit-sync + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/netromdk/vermin + rev: v1.6.0 + hooks: + - id: vermin + args: ['-t=3.10-', '--violations'] + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 # sync:isort:poetry.lock + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 24.10.0 # sync:black:poetry.lock + hooks: + - id: black + - repo: https://github.com/PyCQA/flake8 + rev: 7.1.1 # sync:flake8:poetry.lock + hooks: + - id: flake8 + additional_dependencies: + - flake8-type-checking + - repo: https://github.com/PyCQA/bandit + rev: 1.8.0 # sync:bandit:poetry.lock + hooks: + - id: bandit + args: ["-c", "pyproject.toml"] diff --git a/aides_spec/__init__.py b/aides_spec/__init__.py new file mode 100644 index 0000000..163499e --- /dev/null +++ b/aides_spec/__init__.py @@ -0,0 +1,3 @@ +from aides_spec.main import main + +__all__ = ["main"] diff --git a/aides_spec/__main__.py b/aides_spec/__main__.py new file mode 100644 index 0000000..8ab68f4 --- /dev/null +++ b/aides_spec/__main__.py @@ -0,0 +1,3 @@ +from aides_spec.main import main + +main() diff --git a/aides_spec/commands/build.py b/aides_spec/commands/build.py new file mode 100644 index 0000000..80c47b4 --- /dev/null +++ b/aides_spec/commands/build.py @@ -0,0 +1,59 @@ +import os +import subprocess + +import typer + +app = typer.Typer() + +IMAGE = "ghcr.io/aides-infra/worker-alt-sisyphus-x86_64:0.0.4" +BUILD_COMMAND = "cd /app && /bin/aides-update-cache && " +"(yes | /bin/alr build -s $(pwd)/alr.sh)" + + +@app.command() +def build( + no_cache: bool = typer.Option(False, "--no-cache", help="Disable cache") +): + command = f"source {os.getcwd()}/alr.sh && echo $name" + + result = subprocess.run( + command, shell=True, capture_output=True, text=True + ) + + if result.returncode != 0: + exit(-1) + + package_name = result.stdout.strip() + + cache_dir = os.path.join( + os.environ.get("XDG_CACHE_HOME", os.path.expanduser("~/.cache")), + "aides-spec", + "builds", + package_name, + ) + + try: + command = [ + "docker", + "run", + "-it", + "--rm", + "--cap-add=SYS_ADMIN", + "-v", + f"{os.getcwd()}:/app", + ] + + if not no_cache: + alr_cache = os.path.join(cache_dir, "alr") + os.makedirs(alr_cache, exist_ok=True) + command.extend(["-v", f"{alr_cache}:/home/buildbot/.cache/alr"]) + + command.extend([IMAGE, "/bin/sh", "-c", BUILD_COMMAND]) + + print(" ".join(command)) + + subprocess.run(command, check=True) + except subprocess.CalledProcessError as e: + typer.echo(f"Error while running docker: {e}") + except FileNotFoundError: + typer.echo("Docker is not installed or not in PATH.") diff --git a/aides_spec/commands/create.py b/aides_spec/commands/create.py new file mode 100644 index 0000000..ba6dce9 --- /dev/null +++ b/aides_spec/commands/create.py @@ -0,0 +1,34 @@ +import sys +from typing import Annotated, Optional + +import typer + +from aides_spec.utils.from_pkgbuild import ( + create_from_pkgbuild, + download_pkgbuild, +) + +app = typer.Typer() + + +@app.command() +def create( + from_aur: Annotated[Optional[str], typer.Option()] = None, + from_pkgbuild: Annotated[Optional[str], typer.Option()] = None, + output_file: Annotated[str, typer.Option("--output", "-o")] = "alr.sh", +): + if from_aur: + print(f"Загружаем PKGBUILD для пакета '{from_aur}' из AUR...") + content = download_pkgbuild(from_aur) + create_from_pkgbuild(content, output_file) + elif from_pkgbuild: + print(f"Читаем PKGBUILD из локального файла '{from_pkgbuild}'...") + try: + with open(from_pkgbuild, "rb") as f: + content = f.read() + create_from_pkgbuild(content, output_file) + except IOError as e: + print(f"Ошибка чтения файла '{from_pkgbuild}': {e}") + sys.exit(1) + else: + sys.exit(1) diff --git a/aides_spec/main.py b/aides_spec/main.py new file mode 100644 index 0000000..88cdd36 --- /dev/null +++ b/aides_spec/main.py @@ -0,0 +1,17 @@ +import typer + +from aides_spec.commands.build import app as build_app +from aides_spec.commands.create import app as create_app + +app = typer.Typer() + +app.add_typer(create_app) +app.add_typer(build_app) + + +def main(): + app() + + +if __name__ == "__main__": + main() diff --git a/alr_spec/replacers/__init__.py b/aides_spec/replacers/__init__.py similarity index 100% rename from alr_spec/replacers/__init__.py rename to aides_spec/replacers/__init__.py diff --git a/alr_spec/replacers/arch_replacer.py b/aides_spec/replacers/arch_replacer.py similarity index 97% rename from alr_spec/replacers/arch_replacer.py rename to aides_spec/replacers/arch_replacer.py index 20732b3..44c2a8c 100644 --- a/alr_spec/replacers/arch_replacer.py +++ b/aides_spec/replacers/arch_replacer.py @@ -1,4 +1,4 @@ -from alr_spec.replacers.base import BaseReplacer +from aides_spec.replacers.base import BaseReplacer class ArchReplacer(BaseReplacer): diff --git a/alr_spec/replacers/base.py b/aides_spec/replacers/base.py similarity index 100% rename from alr_spec/replacers/base.py rename to aides_spec/replacers/base.py diff --git a/alr_spec/replacers/checksums_replacer.py b/aides_spec/replacers/checksums_replacer.py similarity index 100% rename from alr_spec/replacers/checksums_replacer.py rename to aides_spec/replacers/checksums_replacer.py diff --git a/alr_spec/replacers/simple_replacer.py b/aides_spec/replacers/simple_replacer.py similarity index 94% rename from alr_spec/replacers/simple_replacer.py rename to aides_spec/replacers/simple_replacer.py index 09bc92b..208720c 100644 --- a/alr_spec/replacers/simple_replacer.py +++ b/aides_spec/replacers/simple_replacer.py @@ -1,4 +1,4 @@ -from alr_spec.replacers.base import BaseReplacer +from aides_spec.replacers.base import BaseReplacer class SimpleReplacer(BaseReplacer): diff --git a/alr_spec/replacers/sources_replacer.py b/aides_spec/replacers/sources_replacer.py similarity index 90% rename from alr_spec/replacers/sources_replacer.py rename to aides_spec/replacers/sources_replacer.py index 2f1a458..1f5a151 100644 --- a/alr_spec/replacers/sources_replacer.py +++ b/aides_spec/replacers/sources_replacer.py @@ -1,7 +1,7 @@ import re -from alr_spec.replacers.arch_replacer import ArchReplacer -from alr_spec.replacers.base import BaseReplacer +from aides_spec.replacers.arch_replacer import ArchReplacer +from aides_spec.replacers.base import BaseReplacer class SourcesReplacer(BaseReplacer): diff --git a/aides_spec/utils/from_pkgbuild.py b/aides_spec/utils/from_pkgbuild.py new file mode 100644 index 0000000..a0450f6 --- /dev/null +++ b/aides_spec/utils/from_pkgbuild.py @@ -0,0 +1,56 @@ +import sys + +import requests +import tree_sitter_bash as tsbash +from tree_sitter import Language, Parser + +from aides_spec.replacers.arch_replacer import ArchReplacer +from aides_spec.replacers.simple_replacer import SimpleReplacer +from aides_spec.replacers.sources_replacer import SourcesReplacer + +parser_ts = None + + +def download_pkgbuild(pkgname): + aur_url = ( + f"https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h={pkgname}" + ) + try: + response = requests.get(aur_url, timeout=300) + response.raise_for_status() + return response.content + except requests.RequestException as e: + print(f"Ошибка загрузки PKGBUILD из AUR: {e}") + sys.exit(1) + + +def process_file(content, tree, replacers): + for replacer_class in replacers: + replacer = replacer_class(content, tree) + content = replacer.process() + tree = parser_ts.parse(content, tree) + return content + + +def create_from_pkgbuild(content, output_file): + global parser_ts + BASH_LANGUAGE = Language(tsbash.language()) + parser_ts = Parser(BASH_LANGUAGE) + + tree = parser_ts.parse(content) + + replacers = [ + SimpleReplacer, + ArchReplacer, + SourcesReplacer, + ] + + new_content = process_file(content, tree, replacers) + + try: + with open(output_file, "wb") as f: + f.write(new_content) + print(f"Файл успешно записан в {output_file}.") + except IOError as e: + print(f"Ошибка при записи файла: {e}") + sys.exit(1) diff --git a/alr_spec/__init__.py b/alr_spec/__init__.py deleted file mode 100644 index 3b76b3c..0000000 --- a/alr_spec/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from alr_spec.main import main - -__all__ = ["main"] diff --git a/alr_spec/__main__.py b/alr_spec/__main__.py deleted file mode 100644 index d7671f6..0000000 --- a/alr_spec/__main__.py +++ /dev/null @@ -1,3 +0,0 @@ -from alr_spec.main import main - -main() diff --git a/alr_spec/main.py b/alr_spec/main.py deleted file mode 100644 index 55432a6..0000000 --- a/alr_spec/main.py +++ /dev/null @@ -1,99 +0,0 @@ -import argparse -import sys -from typing import Annotated, Optional -import requests -import typer - -import tree_sitter_bash as tsbash -from tree_sitter import Language, Parser - -from alr_spec.replacers.arch_replacer import ArchReplacer -from alr_spec.replacers.simple_replacer import SimpleReplacer -from alr_spec.replacers.sources_replacer import SourcesReplacer - - -def download_pkgbuild(pkgname): - aur_url = ( - f"https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h={pkgname}" - ) - try: - response = requests.get(aur_url) - response.raise_for_status() - return response.content - except requests.RequestException as e: - print(f"Ошибка загрузки PKGBUILD из AUR: {e}") - sys.exit(1) - - -parser_ts = None - - -def process_file(content, tree, replacers): - for replacer_class in replacers: - replacer = replacer_class(content, tree) - content = replacer.process() - tree = parser_ts.parse(content, tree) - return content - - -def create_from_pkgbuild(content, output_file): - global parser_ts - BASH_LANGUAGE = Language(tsbash.language()) - parser_ts = Parser(BASH_LANGUAGE) - - tree = parser_ts.parse(content) - - replacers = [ - SimpleReplacer, - ArchReplacer, - SourcesReplacer, - ] - - new_content = process_file(content, tree, replacers) - - try: - with open(output_file, "wb") as f: - f.write(new_content) - print(f"Файл успешно записан в {output_file}.") - except IOError as e: - print(f"Ошибка при записи файла: {e}") - sys.exit(1) - - -app = typer.Typer() - - -@app.command() -def lint(name: str): - print(f"Hello {name}") - - -@app.command() -def create( - from_aur: Annotated[Optional[str], typer.Option()] = None, - from_pkgbuild: Annotated[Optional[str], typer.Option()] = None, - output_file: Annotated[str, typer.Option("--output", "-o")] = "alr.sh", -): - if from_aur: - print(f"Загружаем PKGBUILD для пакета '{from_aur}' из AUR...") - content = download_pkgbuild(from_aur) - create_from_pkgbuild(content, output_file) - elif from_pkgbuild: - print(f"Читаем PKGBUILD из локального файла '{from_pkgbuild}'...") - try: - with open(from_pkgbuild, "rb") as f: - content = f.read() - create_from_pkgbuild(content, output_file) - except IOError as e: - print(f"Ошибка чтения файла '{from_pkgbuild}': {e}") - sys.exit(1) - else: - sys.exit(1) - - -def main(): - app() - - -if __name__ == "__main__": - main() diff --git a/poetry.lock b/poetry.lock index 16f03a7..82a97be 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,28 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. + +[[package]] +name = "bandit" +version = "1.8.0" +description = "Security oriented static analyser for python code." +optional = false +python-versions = ">=3.9" +files = [ + {file = "bandit-1.8.0-py3-none-any.whl", hash = "sha256:b1a61d829c0968aed625381e426aa378904b996529d048f8d908fa28f6b13e38"}, + {file = "bandit-1.8.0.tar.gz", hash = "sha256:b5bfe55a095abd9fe20099178a7c6c060f844bfd4fe4c76d28e35e4c52b9d31e"}, +] + +[package.dependencies] +colorama = {version = ">=0.3.9", markers = "platform_system == \"Windows\""} +PyYAML = ">=5.3.1" +rich = "*" +stevedore = ">=1.20.0" + +[package.extras] +baseline = ["GitPython (>=3.1.30)"] +sarif = ["jschema-to-python (>=1.2.3)", "sarif-om (>=1.0.4)"] +test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)"] +toml = ["tomli (>=1.1.0)"] +yaml = ["PyYAML"] [[package]] name = "black" @@ -55,6 +79,17 @@ files = [ {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, ] +[[package]] +name = "cfgv" +version = "3.4.0" +description = "Validate configuration and produce human readable error messages." +optional = false +python-versions = ">=3.8" +files = [ + {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, + {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, +] + [[package]] name = "charset-normalizer" version = "3.4.0" @@ -194,6 +229,63 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "distlib" +version = "0.3.9" +description = "Distribution utilities" +optional = false +python-versions = "*" +files = [ + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, +] + +[[package]] +name = "filelock" +version = "3.16.1" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.8" +files = [ + {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, + {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] +typing = ["typing-extensions (>=4.12.2)"] + +[[package]] +name = "flake8" +version = "7.1.1" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" + +[[package]] +name = "identify" +version = "2.6.4" +description = "File identification library for Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "identify-2.6.4-py2.py3-none-any.whl", hash = "sha256:993b0f01b97e0568c179bb9196391ff391bfb88a99099dbf5ce392b68f42d0af"}, + {file = "identify-2.6.4.tar.gz", hash = "sha256:285a7d27e397652e8cafe537a6cc97dd470a970f48fb2e9d979aa38eae5513ac"}, +] + +[package.extras] +license = ["ukkonen"] + [[package]] name = "idna" version = "3.10" @@ -246,6 +338,17 @@ profiling = ["gprof2dot"] rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -268,6 +371,17 @@ files = [ {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] +[[package]] +name = "nodeenv" +version = "1.9.1" +description = "Node.js virtual environment builder" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, +] + [[package]] name = "packaging" version = "24.2" @@ -290,6 +404,17 @@ files = [ {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] +[[package]] +name = "pbr" +version = "6.1.0" +description = "Python Build Reasonableness" +optional = false +python-versions = ">=2.6" +files = [ + {file = "pbr-6.1.0-py2.py3-none-any.whl", hash = "sha256:a776ae228892d8013649c0aeccbb3d5f99ee15e005a4cbb7e61d55a067b28a2a"}, + {file = "pbr-6.1.0.tar.gz", hash = "sha256:788183e382e3d1d7707db08978239965e8b9e4e5ed42669bf4758186734d5f24"}, +] + [[package]] name = "platformdirs" version = "4.3.6" @@ -306,6 +431,46 @@ docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-a test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] type = ["mypy (>=1.11.2)"] +[[package]] +name = "pre-commit" +version = "4.0.1" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +optional = false +python-versions = ">=3.9" +files = [ + {file = "pre_commit-4.0.1-py2.py3-none-any.whl", hash = "sha256:efde913840816312445dc98787724647c65473daefe420785f885e8ed9a06878"}, + {file = "pre_commit-4.0.1.tar.gz", hash = "sha256:80905ac375958c0444c65e9cebebd948b3cdb518f335a091a670a89d652139d2"}, +] + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" + +[[package]] +name = "pycodestyle" +version = "2.12.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, +] + +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + [[package]] name = "pygments" version = "2.18.0" @@ -320,6 +485,68 @@ files = [ [package.extras] windows-terminal = ["colorama (>=0.4.6)"] +[[package]] +name = "pyyaml" +version = "6.0.2" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, +] + [[package]] name = "requests" version = "2.32.3" @@ -370,6 +597,20 @@ files = [ {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, ] +[[package]] +name = "stevedore" +version = "5.4.0" +description = "Manage dynamic plugins for Python applications" +optional = false +python-versions = ">=3.9" +files = [ + {file = "stevedore-5.4.0-py3-none-any.whl", hash = "sha256:b0be3c4748b3ea7b854b265dcb4caa891015e442416422be16f8b31756107857"}, + {file = "stevedore-5.4.0.tar.gz", hash = "sha256:79e92235ecb828fe952b6b8b0c6c87863248631922c8e8e0fa5b17b232c4514d"}, +] + +[package.dependencies] +pbr = ">=2.0.0" + [[package]] name = "tree-sitter" version = "0.23.2" @@ -446,13 +687,13 @@ core = ["tree-sitter (>=0.22,<1.0)"] [[package]] name = "typer" -version = "0.14.0" +version = "0.15.1" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.7" files = [ - {file = "typer-0.14.0-py3-none-any.whl", hash = "sha256:f476233a25770ab3e7b2eebf7c68f3bc702031681a008b20167573a4b7018f09"}, - {file = "typer-0.14.0.tar.gz", hash = "sha256:af58f737f8d0c0c37b9f955a6d39000b9ff97813afcbeef56af5e37cf743b45a"}, + {file = "typer-0.15.1-py3-none-any.whl", hash = "sha256:7994fb7b8155b64d3402518560648446072864beefd44aa2dc36972a5972e847"}, + {file = "typer-0.15.1.tar.gz", hash = "sha256:a0588c0a7fa68a1978a069818657778f86abe6ff5ea6abf472f940a08bfe4f0a"}, ] [package.dependencies] @@ -489,7 +730,27 @@ h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "virtualenv" +version = "20.28.0" +description = "Virtual Python Environment builder" +optional = false +python-versions = ">=3.8" +files = [ + {file = "virtualenv-20.28.0-py3-none-any.whl", hash = "sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0"}, + {file = "virtualenv-20.28.0.tar.gz", hash = "sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa"}, +] + +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<5" + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] + [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "f0968058d314d8d894e6693386e59f640ce7c6342211868c2889cf105cc77241" +content-hash = "fdfdf68234bf3f97b5eb66fb3d38a5069c489004693376e4a379bd821b460068" diff --git a/pyproject.toml b/pyproject.toml index 9d6ffdb..9738702 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] -name = "alr-spec" +name = "aides-spec" version = "0.1.0" description = "" authors = ["Maxim Slipenko "] readme = "README.md" [tool.poetry.scripts] -alr-spec = "alr_spec:main" +aides-spec = "aides_spec:main" [tool.black] line-length = 79 @@ -17,16 +17,26 @@ line_length = 79 multi_line_output = 3 skip_gitignore = true +[tool.bandit] +skips = [ + "B404", + "B602", + "B603" +] + [tool.poetry.dependencies] python = "^3.12" tree-sitter = "^0.23.2" tree-sitter-bash = "^0.23.3" requests = "^2.32.3" -typer = "^0.14.0" +typer = "^0.15.1" [tool.poetry.group.dev.dependencies] black = "^24.10.0" isort = "^5.13.2" +pre-commit = "^4.0.1" +flake8 = "^7.1.1" +bandit = "^1.8.0" [build-system] requires = ["poetry-core"]