Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | builders/wheel: Ensure dist-info is written determinisically |
| 2 | |
| 3 | glob() returns values in "on disk" order. To make the RECORD file |
| 4 | deterministic and consistent between builds we need to sort the |
| 5 | data before adding to the records list. |
| 6 | |
| 7 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 8 | |
| 9 | Upstream-Status: Submitted [https://github.com/python-poetry/poetry-core/pull/545] |
| 10 | |
| 11 | Index: builders/wheel.py |
| 12 | =================================================================== |
| 13 | --- a/src/poetry/core/masonry/builders/wheel.py |
| 14 | +++ b/src/poetry/core/masonry/builders/wheel.py |
| 15 | @@ -294,7 +294,7 @@ class WheelBuilder(Builder): |
| 16 | |
| 17 | def _copy_dist_info(self, wheel: zipfile.ZipFile, source: Path) -> None: |
| 18 | dist_info = Path(self.dist_info) |
| 19 | - for file in source.glob("**/*"): |
| 20 | + for file in sorted(source.glob("**/*") ): |
| 21 | if not file.is_file(): |
| 22 | continue |
| 23 | |