Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace fasteners #4797

Open
orbeckst opened this issue Nov 22, 2024 · 4 comments · May be fixed by #4800
Open

replace fasteners #4797

orbeckst opened this issue Nov 22, 2024 · 4 comments · May be fixed by #4800

Comments

@orbeckst
Copy link
Member

The fasteners package is licensed under the Apache 2.0 license, which is incompatible with our target license LGPLv2.1+. We therefore need to replace it with a compatible alternative.

Reason

Further background on why this change is necessary:
https://www.mdanalysis.org/2023/09/22/licensing-update/#why-the-interim-gpl-v3-and-lgpl-v3-package-licenses-the-issue-with-apache-20

Alternatives to fasteners

One possibility is py-filelock but others could be explored, too.

Background

@orbeckst
Copy link
Member Author

orbeckst commented Nov 22, 2024

When someone is looking at the XDR offsets code, please scrutinize the line

warnings.warn(f"Cannot write lock/offset file in same location as "
f"{self.filename}. Using slow offset calculation.")
self._read_offsets(store=True)
Is it possible that this ought to be

self._read_offsets(store=False) 

because we just determined that we cannot write to the location? This may save a warning from _read_offsets. However, I only briefly glanced at the code and because this is all subtle, I don't want to jump to conclusions. Just look at it carefully.

@talagayev
Copy link
Member

I would tackle this one if it is fine :)

py-filelock does work from local testing, as for alternatives I looked portalocker looks
also as an option, but would need more code refactoring, so I would tend towards py-filelock, other than that didn't find any good alternatives.

@orbeckst
Copy link
Member Author

Put up a PR! Thanks!

@talagayev talagayev linked a pull request Nov 22, 2024 that will close this issue
5 tasks
@yuxuanzhuang
Copy link
Contributor

When someone is looking at the XDR offsets code, please scrutinize the line

warnings.warn(f"Cannot write lock/offset file in same location as "
f"{self.filename}. Using slow offset calculation.")
self._read_offsets(store=True)

Is it possible that this ought to be

self._read_offsets(store=False) 

because we just determined that we cannot write to the location? This may save a warning from _read_offsets. However, I only briefly glanced at the code and because this is all subtle, I don't want to jump to conclusions. Just look at it carefully.

Yes. I think self._read_offsets(store=False) makes much more sense and is not breaking anything here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants