From 141275a28d09f26420eef576c8c301c3104451e0 Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Mon, 6 Jan 2025 15:07:57 -0300 Subject: [PATCH] Normalize the folder name to command-line-assistant (#96) There were a couple of instances where we used the name command_line_assistant instead of command-line-assistant --- command_line_assistant/config/__init__.py | 2 +- packaging/command-line-assistant.spec | 6 +++--- tests/config/test_config.py | 4 ++-- tests/conftest.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/command_line_assistant/config/__init__.py b/command_line_assistant/config/__init__.py index bbd6e8a..0772c8b 100644 --- a/command_line_assistant/config/__init__.py +++ b/command_line_assistant/config/__init__.py @@ -23,7 +23,7 @@ CONFIG_FILE_DEFINITION: tuple[str, str] = ( - "command_line_assistant", + "command-line-assistant", "config.toml", ) #: Define the config file path. diff --git a/packaging/command-line-assistant.spec b/packaging/command-line-assistant.spec index e0f42d7..15d6faa 100644 --- a/packaging/command-line-assistant.spec +++ b/packaging/command-line-assistant.spec @@ -43,7 +43,7 @@ A simple wrapper to interact with RAG # Create needed directories in buildroot %{__install} -d %{buildroot}/%{_sbindir} -%{__install} -d %{buildroot}/%{_sysconfdir}/xdg/%{python_package_src} +%{__install} -d %{buildroot}/%{_sysconfdir}/xdg/%{name} %{__install} -d %{buildroot}/%{_sharedstatedir}/%{name} %{__install} -d %{buildroot}/%{_mandir}/man1 %{__install} -d %{buildroot}/%{_mandir}/man8 @@ -61,7 +61,7 @@ A simple wrapper to interact with RAG %{__install} -D -m 0644 data/release/dbus/com.redhat.lightspeed.history.service %{buildroot}/%{_datadir}/dbus-1/system-services/com.redhat.lightspeed.history.service # Config file -%{__install} -D -m 0644 data/release/xdg/config.toml %{buildroot}/%{_sysconfdir}/xdg/%{python_package_src}/config.toml +%{__install} -D -m 0644 data/release/xdg/config.toml %{buildroot}/%{_sysconfdir}/xdg/%{name}/config.toml # History file %{__install} -D -m 0644 data/release/xdg/history.json %{buildroot}/%{_sharedstatedir}/%{name}/history.json @@ -102,7 +102,7 @@ LICENSE %{_datadir}/dbus-1/system-services/com.redhat.lightspeed.history.service # Config file -%config %{_sysconfdir}/xdg/%{python_package_src}/config.toml +%config %{_sysconfdir}/xdg/%{name}/config.toml # History file %{_sharedstatedir}/%{name}/history.json diff --git a/tests/config/test_config.py b/tests/config/test_config.py index 66f0b5f..ab2fecb 100644 --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -42,7 +42,7 @@ def get_config_template(tmp_path) -> str: def test_load_config_file(tmp_path, monkeypatch, get_config_template): config_file_path = tmp_path - config_file = config_file_path / "command_line_assistant" / "config.toml" + config_file = config_file_path / "command-line-assistant" / "config.toml" config_file.parent.mkdir() config_file.write_text(get_config_template) @@ -65,7 +65,7 @@ def test_load_config_file_not_found(tmp_path, monkeypatch): def test_load_config_file_decoded_error(tmp_path, monkeypatch): config_file_path = tmp_path - config_file = config_file_path / "command_line_assistant" / "config.toml" + config_file = config_file_path / "command-line-assistant" / "config.toml" config_file.parent.mkdir() config_file.write_text(""" [output] diff --git a/tests/conftest.py b/tests/conftest.py index 9055355..b53a6c9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -41,7 +41,7 @@ def mock_config(tmp_path): """Fixture to create a mock configuration""" cert_file = tmp_path / "cert.pem" key_file = tmp_path / "key.pem" - history_file = tmp_path / "command_line_assistant" / "history.json" + history_file = tmp_path / "command-line-assistant" / "history.json" cert_file.write_text("cert") key_file.write_text("key")