Skip to content

Commit

Permalink
deps: Remove click dependency
Browse files Browse the repository at this point in the history
click module is not available in some distros.
This commit removes it usage from the otk_osbuild code.
  • Loading branch information
elkoniu committed May 28, 2024
1 parent 54287bb commit 717d7d0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/otk_osbuild/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pathlib
import subprocess

import click
import argparse


def source_add(kind, data):
Expand Down Expand Up @@ -44,12 +44,6 @@ def source_add_curl(data, checksum, url):
data["context"]["sources"]["org.osbuild.curl"]["items"][checksum] = {"url": url}


@click.group()
def root():
pass


@root.command()
def depsolve_dnf4():
data = json.loads(sys.stdin.read())
tree = data["tree"]
Expand Down Expand Up @@ -118,7 +112,6 @@ def depsolve_dnf4():
)


@root.command()
def file_from_text():
data = json.loads(sys.stdin.read())

Expand Down Expand Up @@ -155,7 +148,6 @@ def file_from_text():
)


@root.command()
def file_from_path():
data = json.loads(sys.stdin.read())

Expand Down Expand Up @@ -191,3 +183,15 @@ def file_from_path():
}
)
)


def root():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()

(subparsers.add_parser('depsolve_dnf4')).set_defaults(func=depsolve_dnf4)
(subparsers.add_parser('file_from_text')).set_defaults(func=file_from_text)
(subparsers.add_parser('file_from_path')).set_defaults(func=file_from_path)

args = parser.parse_args()
args.func()

0 comments on commit 717d7d0

Please sign in to comment.