From 9f8cf48b83c198907d7e064c86420fdeb36e3520 Mon Sep 17 00:00:00 2001 From: Nicolas Roche Date: Fri, 16 Aug 2024 09:47:17 +0200 Subject: [PATCH] Pypi-closure computation fixed - Ensure correct identifier is passed to PyPICandidate - Adjust parsing of egg information --- src/e3/python/pypi.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/e3/python/pypi.py b/src/e3/python/pypi.py index 5019df4d..8a159b9c 100644 --- a/src/e3/python/pypi.py +++ b/src/e3/python/pypi.py @@ -217,7 +217,7 @@ def fetch_candidates( for link in project_links: try: c = PyPICandidate( - identifier=identifier, + identifier=identifier.split("@", 1)[0], link=link, extras=extras, cache_dir=os.path.join(self.cache_dir, "resources"), @@ -379,9 +379,14 @@ def requirements(self, env: dict[str, str]) -> set[Requirement]: elif line and not line.startswith("#"): # Non empty lines that are not comments should be # considered as requirements - self._reqs.add( - Requirement(f"{line};{current_marker}") - ) + if current_marker: + self._reqs.add( + Requirement(f"{line};{current_marker}") + ) + else: + # Don't emit a final ; if the marker is empty + # as this is not accepted by the syntax + self._reqs.add(Requirement(line)) elif requirements_txt in archive_members: # Check if there is a requirements.txt (this is a fallback)