From a5af6436fc18b79dcb7be29d93edead4355360f3 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Tue, 26 Mar 2024 16:11:50 +0000 Subject: [PATCH] Update for whey 0.0.25 --- requirements.txt | 2 +- .../test_build_additional_files.txt | 2 +- .../test_build_complete_COMPLETE_A_.txt | 2 +- .../test_build_complete_COMPLETE_B_.txt | 2 +- .../test_build_complete_WHEY_NO_PTH_.txt | 2 +- ...est_build_complete_foreman_COMPLETE_A_.txt | 2 +- ...est_build_complete_foreman_COMPLETE_B_.txt | 2 +- ...st_build_complete_foreman_WHEY_NO_PTH_.txt | 2 +- whey_pth/__init__.py | 19 +++++++++++++++---- 9 files changed, 23 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8d00458..ecd978f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ dom-toml>=0.4.0 -whey>=0.0.15 +whey>=0.0.25 diff --git a/tests/test_whey_pth_/test_build_additional_files.txt b/tests/test_whey_pth_/test_build_additional_files.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_additional_files.txt +++ b/tests/test_whey_pth_/test_build_additional_files.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/tests/test_whey_pth_/test_build_complete_COMPLETE_A_.txt b/tests/test_whey_pth_/test_build_complete_COMPLETE_A_.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_complete_COMPLETE_A_.txt +++ b/tests/test_whey_pth_/test_build_complete_COMPLETE_A_.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/tests/test_whey_pth_/test_build_complete_COMPLETE_B_.txt b/tests/test_whey_pth_/test_build_complete_COMPLETE_B_.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_complete_COMPLETE_B_.txt +++ b/tests/test_whey_pth_/test_build_complete_COMPLETE_B_.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/tests/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.txt b/tests/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.txt +++ b/tests/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.txt b/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.txt +++ b/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.txt b/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.txt +++ b/tests/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/tests/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.txt b/tests/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.txt index 1fa8229..e63f285 100644 --- a/tests/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.txt +++ b/tests/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.txt @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: whey Version: 2021.0.0 Summary: A simple Python wheel builder for simple projects. diff --git a/whey_pth/__init__.py b/whey_pth/__init__.py index d449735..2081fa4 100644 --- a/whey_pth/__init__.py +++ b/whey_pth/__init__.py @@ -32,6 +32,7 @@ # 3rd party import dom_toml from dom_toml.parser import TOML_TYPES, AbstractConfigParser, BadConfigError +from whey import additional_files from whey.builder import WheelBuilder __author__: str = "Dominic Davis-Foster" @@ -121,7 +122,10 @@ def parse_pth_content(self, config: Dict[str, TOML_TYPES]) -> str: return pth_content - def parse_additional_wheel_files(self, config: Dict[str, TOML_TYPES]) -> List[str]: + def parse_additional_wheel_files( + self, + config: Dict[str, TOML_TYPES], + ) -> List[additional_files.AdditionalFilesEntry]: """ Parse the ``additional-wheel-files`` key. @@ -131,12 +135,19 @@ def parse_additional_wheel_files(self, config: Dict[str, TOML_TYPES]) -> List[st :param config: The unparsed TOML config for the ``[tool.whey-pth]`` table. """ - additional_files = config["additional-wheel-files"] + entries = config["additional-wheel-files"] - for idx, file in enumerate(additional_files): + for idx, file in enumerate(entries): self.assert_indexed_type(file, str, ["tool", "whey", "additional-wheel-files"], idx=idx) - return additional_files + parsed_additional_files = [] + + for entry in entries: + parsed_entry = additional_files.from_entry(entry) + if parsed_entry is not None: + parsed_additional_files.append(parsed_entry) + + return parsed_additional_files @property def keys(self) -> List[str]: