-
Notifications
You must be signed in to change notification settings - Fork 175
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
Use vendorized portalocker for file locking. #1364
Conversation
For some reason this does not work on Windows out of the box ... 😞 |
My suspicion is that the Windows tests fail because of some incompatibility of pytest-runner with Not sure if @tbekolay were quicker to figure this one out. |
Note, that I can run the tests in a Windows VirtualBox by invoking |
I think I figured it out. Instead of using pytest-runner I had directly invoke py.test and change the install to a develop install to avoid the |
92b92ed
to
b961607
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit with some proposed changes, check them out and let me know what you think.
Another thought I had, which I thought you might be able to implement easier than me Jan, is whether the nengo/utils/lock.py
file is necessary anymore? It feels like a pretty thin wrapper over what portalocker provides, so if we can remove that file I say go for it.
Is there a possibility that we might modify vendorized packages in the future as workaround for bugs that haven't been fixed upstream?
Do you have a link for that? Just curious whether they provide a reason for that and what that reason is.
If that doesn't confuse It would be possible to install a different version of a vendorized package in the _vendor directory than given in
I thought about that, but the |
Maybe, but we're going to do that I would do the workaround by monkey-patching outside of the
There was some detailed discussion on the pytest-dev mailing list, but I can't find it at the moment... I found this post, and from googling there's this blog post and this SO answer. You can look at the pytest-dev mailing list archive for more.
Sure, but if someone is deep enough in the Nengo source that they're manually installing vendorized dependencies, they probably know they did that. Also,
OK, thanks for clarifying. |
The hope is that this solves some problems with non-released file locks when the Nengo process gets killed (which can happen often on HPC clusters).
Seems to be incompatible with multiprocessing and isn't used on Travis-CI either.
Motivation and context:
This PR does two things:
portalocker
library.The first point is motivated by the second point. The portalocker library uses the respective Windows and Unix API calls to do the file lock which ensures that the lock is released if the process is abnormally killed. Our file lock implementation tried to use the same code on all platforms which makes it hard to correctly handle abnormal terminations (see PR #1309 for a rejected approach).
The vendorizing of third-party libraries, might require us to add the license of those modules in certain places of the documentation, @tbekolay?
I also suspect that other want to chime in how exactly the vendorization workflow should look like. At the moment there is a
requirements-vendorized.txt
file to enter the vendorized modules into. It lives innengo/_vendor
, but maybe it should be moved to the root folder? Innengo/_vendor
is also a readme with instructions. Maybe there is a better place? Let me know what you think.Interactions with other PRs:
Supersedes #1309.
How has this been tested?
Added tests.
How long should this take to review?
Where should a reviewer start?
I'd recommend going commit by commit.
Types of changes:
Checklist:
Still to do: