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

[WIP/PoC] Attempt to use the fasteners library #114

Closed
wants to merge 1 commit into from

Conversation

dstufft
Copy link
Contributor

@dstufft dstufft commented Jan 19, 2016

No description provided.

@@ -79,13 +100,21 @@ def _fn(self, name):
parts = list(hashed[:5]) + [hashed]
return os.path.join(self.directory, *parts)

def _lockname(self, name):
if isinstance(self.lock_class, PYLockFileBase):
return self.name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 'name', not 'self.name'

if isinstance(self.lock_class, PYLockFileBase):
return self.name
else:
return self.name + ".lock"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

with open(name, 'rb') as fh:
return fh.read()
with self.lock_class(self._lockname(name)):
if not os.path.exists(name):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be refactored as a try/except block, instead of testing for path existence?

@kloczek
Copy link

kloczek commented Jan 18, 2022

To be able test that PR it would be necessary to modify module metadata to statr require on install time fasteners instead lockfile.
Is it possible to add that part ot the PR as well?

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

Successfully merging this pull request may close these issues.

3 participants