-
Notifications
You must be signed in to change notification settings - Fork 0
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
A couple of small fixes that I noticed #2
Conversation
@property | ||
@lru_cache | ||
def abspath_hash(self): | ||
hash_ = hashlib.sha512() | ||
hash_.update(self.abspath.encode("utf8")) | ||
return hash_.hexdigest() |
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.
It was using a hash of the absolute path to the requirements file as the cache key. There's no need: just use the absolute path directly as the cache key.
@@ -75,7 +68,6 @@ def pip_sync_maybe(src_files, args): | |||
|
|||
def entry_point(): # pragma: nocover | |||
parser = ArgumentParser() | |||
parser.add_argument("-n", "--dry-run", action="store_true") |
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.
--dry-run
was unused
@property | ||
@lru_cache | ||
def path(self): | ||
return self._path |
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.
The path
property was unnecessary, can just use a path
attribute (as long as no one ever mutates path
as that would invalidate the cached abspath
and contents_hash
properties, but this is really a very small script)
No description provided.