Skip to content

Commit

Permalink
Fix native packages detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
amdei committed Apr 10, 2023
1 parent 16b5a4f commit a9a1434
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/fpm/package/pyfpm_wheel/get_metadata_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ def __wheel_root_is_pure(self):
for name in names:
if name.endswith('.dist-info/WHEEL'):
for line in archive.read(name).split(b"\n"):
line_lower = str(line).lower().strip()
if line_lower.startswith('root-is-purelib') and \
line_lower.endswith('true'):
line_lower = str(line.decode()).lower().strip()
if line_lower.startswith('root-is-purelib') and line_lower.endswith('true'):
return True

return False
Expand All @@ -76,10 +75,11 @@ def run(self, output_path):
data["url"] = self.get_home_url(fpm_wheel.project_urls)

# @todo Can anyone provide a package, where fpm_wheel.requires_external is 'true'?
if fpm_wheel.requires_external or not self.__wheel_root_is_pure():
data["architecture"] = "native"
else:
# print('REQ-TOML EXTERNAL:', fpm_wheel.requires_external, file=sys.stderr)
if self.__wheel_root_is_pure() and not fpm_wheel.requires_external:
data["architecture"] = "all"
else:
data["architecture"] = "native"

# print('REQ-TOML:', fpm_wheel.requires, file=sys.stderr)
# print('REQ-TOML DIST:', fpm_wheel.requires_dist, file=sys.stderr)
Expand Down

0 comments on commit a9a1434

Please sign in to comment.