diff --git a/cpl.json b/cpl.json index 37a06db5..586d13c7 100644 --- a/cpl.json +++ b/cpl.json @@ -26,7 +26,8 @@ "termcolor==1.1.0", "watchdog==2.0.2" ], - "PythonVersion": ">=3.8" + "PythonVersion": ">=3.8", + "Classifiers": [] }, "BuildSettings": { "SourcePath": "src", diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index c680b2d8..33728f8a 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -66,7 +66,8 @@ class NewService(CommandABC): ProjectSettingsNameEnum.dependencies.value: [ f'sh_cpl=={version.parse(cpl.__version__)}' ], - ProjectSettingsNameEnum.python_version.value: f'>={sys.version.split(" ")[0]}' + ProjectSettingsNameEnum.python_version.value: f'>={sys.version.split(" ")[0]}', + ProjectSettingsNameEnum.classifiers.value: [] } self._project.from_dict(self._project_dict) diff --git a/src/cpl_cli/configuration/project_settings.py b/src/cpl_cli/configuration/project_settings.py index e6cf7fad..7c2d8082 100644 --- a/src/cpl_cli/configuration/project_settings.py +++ b/src/cpl_cli/configuration/project_settings.py @@ -26,6 +26,7 @@ class ProjectSettings(ConfigurationModelABC): self._license_description: Optional[str] = None self._dependencies: Optional[list[str]] = None self._python_version: Optional[str] = None + self._classifiers: Optional[list[str]] = None @property def name(self): @@ -79,6 +80,10 @@ class ProjectSettings(ConfigurationModelABC): def python_version(self) -> str: return self._python_version + @property + def classifiers(self) -> list[str]: + return self._classifiers + def from_dict(self, settings: dict): try: self._name = settings[ProjectSettingsNameEnum.name.value] @@ -94,6 +99,7 @@ class ProjectSettings(ConfigurationModelABC): self._license_description = settings[ProjectSettingsNameEnum.license_description.value] self._dependencies = settings[ProjectSettingsNameEnum.dependencies.value] self._python_version = settings[ProjectSettingsNameEnum.python_version.value] + self._classifiers = settings[ProjectSettingsNameEnum.classifiers.value] except Exception as e: Console.set_foreground_color(ForegroundColorEnum.red) Console.write_line( diff --git a/src/cpl_cli/configuration/project_settings_name_enum.py b/src/cpl_cli/configuration/project_settings_name_enum.py index 33a2ce2d..a2cfc4db 100644 --- a/src/cpl_cli/configuration/project_settings_name_enum.py +++ b/src/cpl_cli/configuration/project_settings_name_enum.py @@ -2,7 +2,6 @@ from enum import Enum class ProjectSettingsNameEnum(Enum): - name = 'Name' version = 'Version' author = 'Author' @@ -16,3 +15,4 @@ class ProjectSettingsNameEnum(Enum): license_description = 'LicenseDescription' dependencies = 'Dependencies' python_version = 'PythonVersion' + classifiers = 'Classifiers' diff --git a/src/cpl_cli/publish/publisher_service.py b/src/cpl_cli/publish/publisher_service.py index 8a080850..9409b862 100644 --- a/src/cpl_cli/publish/publisher_service.py +++ b/src/cpl_cli/publish/publisher_service.py @@ -103,15 +103,19 @@ class PublisherService(PublisherABC): relative_path = os.path.relpath(r) file_path = os.path.join(relative_path, os.path.relpath(sub_file)) + print(file_path) self._included_files.append(os.path.relpath(file_path)) elif os.path.isfile(rel_path): + print(rel_path) self._included_files.append(rel_path) for r, d, f in os.walk(self._build_settings.source_path): for file in f: relative_path = os.path.relpath(r) file_path = os.path.join(relative_path, os.path.relpath(file)) + if self._is_path_excluded(relative_path): + break if len(d) > 0: for directory in d: @@ -243,7 +247,7 @@ class PublisherService(PublisherABC): except Exception as e: Console.error('Could not find entry point', str(e)) - if main is None: + if main is None or not hasattr(main, 'main'): Console.error('Could not find entry point') return diff --git a/src/tests/custom/general/cpl.json b/src/tests/custom/general/cpl.json index 5ae65fb3..dd30bce5 100644 --- a/src/tests/custom/general/cpl.json +++ b/src/tests/custom/general/cpl.json @@ -18,7 +18,8 @@ "Dependencies": [ "sh_cpl==2021.4.1" ], - "PythonVersion": ">=3.8" + "PythonVersion": ">=3.8", + "Classifiers": [] }, "BuildSettings": { "SourcePath": "",