From 1aa3be3cefa7b72cd4d355edd7a3cd414ebe7dab Mon Sep 17 00:00:00 2001 From: Dzmitry Pryskoka Date: Wed, 31 Jul 2024 12:38:40 +0300 Subject: [PATCH] Fix incorrect default configuration filename in package data --- changelog.md | 4 +--- pyproject.toml | 4 ++-- src/kataloger/cli/configuration_provider.py | 7 +++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index da9dd9c..ce5eecd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,3 @@ ### Changelog -* Added support for more library and plugin notations in catalog. -* Repositories configuration file replaced with kataloger configuration file, where beside repositories can be specified catalog paths and parameters. -* Minimum required python version lowered to 3.8. +* Fix: Default configuration file now correctly shipped. diff --git a/pyproject.toml b/pyproject.toml index e6a9be9..0293b17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "kataloger" -version = "0.3.0" +version = "0.3.1" dependencies = [ "aiohttp", "yarl", @@ -35,7 +35,7 @@ namespaces = false where = ["src"] [tool.setuptools.package-data] -kataloger = ["default.repositories.toml"] +kataloger = ["default.configuration.toml"] [project.scripts] kataloger = "kataloger.__main__:main" diff --git a/src/kataloger/cli/configuration_provider.py b/src/kataloger/cli/configuration_provider.py index 269d780..3fe6c0a 100644 --- a/src/kataloger/cli/configuration_provider.py +++ b/src/kataloger/cli/configuration_provider.py @@ -114,6 +114,9 @@ def load_configuration_data(configuration_path: Optional[Path]) -> Configuration if file_exists(configuration_candidate): configuration_path = configuration_candidate else: - configuration_path = get_package_file("default.configuration.toml") - + configuration_path = get_package_file("defaults.configuration.toml") + if not file_exists(configuration_path): + message: str = ("Can't find default configuration file. " + "Please specify configuration file with -c [PATH] argument.") + raise KatalogerConfigurationException(message) return load_configuration(configuration_path)