Commit 25bf1c77 authored by Felix Delattre's avatar Felix Delattre
Browse files

Renamed rcli to rabotai

parent ca959b4f
Pipeline #22540 passed with stage
in 3 minutes and 2 seconds
......@@ -19,7 +19,7 @@ test:
coverage:
script:
- pytest --cov=rcli/ tests/
- pytest --cov=rabotai/ tests/
- coverage xml
artifacts:
reports:
......
......@@ -28,15 +28,15 @@ from .argument_factory import ArgumentFactory
logger = logging.getLogger(__name__)
class RCLI:
"""The Rabotnik Command-Line Interface (RCLI).
class RABOTAI:
"""The Rabotnik Command-Line Interface (RABOTAI).
Communicate with nodes running within the `rabotnik` ecosystem via the `message_bus`.
Args:
parser: Creates and parses command line arguments.
Attributes:
arguments: The arguments that are made available in the rcli.
arguments: The arguments that are made available in the rabotai.
"""
def __init__(self, parser: argparse.ArgumentParser):
......@@ -73,7 +73,7 @@ class RCLI:
def main(args: list = None, message_bus: MessageBus = None):
"""RCLI entry point.
"""RABOTAI entry point.
Args:
args: List of arguments. If not provided, read arguments from commandline
......@@ -88,8 +88,8 @@ def main(args: list = None, message_bus: MessageBus = None):
args = args or sys.argv[1:]
parser = argparse.ArgumentParser()
rcli = RCLI(parser=parser)
rcli.setup_parser()
rabotai = RABOTAI(parser=parser)
rabotai.setup_parser()
group = parser.add_argument_group("message bus")
......@@ -131,9 +131,9 @@ def main(args: list = None, message_bus: MessageBus = None):
)
)
rcli.set_message_bus(message_bus)
rabotai.set_message_bus(message_bus)
# Parse `args` to dictionary.
args_dict = vars(args)
loop.run_until_complete(rcli.execute(args_dict))
loop.run_until_complete(rabotai.execute(args_dict))
......@@ -17,12 +17,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from setuptools import setup, find_packages
with open(os.path.join("VERSION")) as version_file:
version = version_file.read().strip()
tests_require = [
"pytest",
"pytest-asyncio",
......@@ -33,18 +29,18 @@ tests_require = [
linters_require = ["pylint", "pre-commit"]
setup(
name="rcli",
version=version,
name="rabotai",
version="0.0.3",
description="Rabotnik command-line interface",
author="Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ",
license="AGPLv3+",
install_requires=["rabotnik==0.0.2"],
install_requires=["rabotnik==0.0.3"],
tests_require=tests_require,
extras_require={
"tests": tests_require,
"linters": linters_require,
},
entry_points={"console_scripts": ["rcli = rcli.rcli:main"]},
entry_points={"console_scripts": ["rabotai = rabotai.rabotai:main"]},
packages=find_packages(),
python_requires=">=3.6",
)
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
from rcli.argument_base import ArgumentBase
from rabotai.argument_base import ArgumentBase
def test_get_format_argument():
......
......@@ -20,7 +20,7 @@ import asyncio
import pytest
import argparse
from rcli.rcli import RCLI
from rabotai.rabotai import RABOTAI
class MockMessageBus:
......@@ -34,19 +34,19 @@ class MockMessageBus:
@pytest.mark.asyncio
async def test_rcli():
async def test_rabotai():
message_bus = MockMessageBus()
parser = argparse.ArgumentParser()
rcli = RCLI(parser=parser)
rcli.set_message_bus(message_bus)
rabotai = RABOTAI(parser=parser)
rabotai.set_message_bus(message_bus)
rcli.setup_parser()
rabotai.setup_parser()
help_formatted = parser.format_help()
assert help_formatted.startswith("usage:")
arguments = {"building_id": "1"}
await rcli.execute(arguments)
await rabotai.execute(arguments)
assert message_bus.calls == [((), {"message": "building", "payload": {"building_id": "1"}})]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment