conda / conda-package-handling

Create and extract conda packages of various formats
https://conda.github.io/conda-package-handling/
BSD 3-Clause "New" or "Revised" License
26 stars 37 forks source link

Regex in info_order is confusing #180

Closed wolfv closed 9 months ago

wolfv commented 1 year ago

The code contains a regex to modify the file extension for hashing / sorting:

_, ext = os.path.splitext(f)
# Strip any .dylib.* and .so.* and rename .dylib to .so
ext = re.sub(r'(\.dylib|\.so).*$', r'.so', ext)

It looks like the regex is supposed to do a great deal of things, but if I am not mistaken splitext will always cut off after the first dot from the right. So one could write just as well:

if ext == '.dylib':
     ext = '.so'
github-actions[bot] commented 10 months ago

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    • What OS and version you reproduced the issue on
    • What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

wolfv commented 9 months ago

We're in the process of cleaning up most of the confusing code in rattler-build: https://github.com/prefix-dev/rattler-build/