Skip to content

0.4: Fix #6 use sha1 instead of hash function result

Latest
Compare
Choose a tag to compare
@signalpillar signalpillar released this 28 Apr 06:56
· 12 commits to master since this release
Problem
-------
Plug-in fails to read value from .previous file as its format has changed.
In the version before 0.2.1 the file contained requirements file copy. Now it
keeps integer value, result of 'hash' function on serialized set of parsed
requirements.

Solution
--------
Use SHA1 to describe unique set of the requirements. This function is more
reliable than Python 'hash' function. 'hash' function may produce different
values for the same input as it depends on a seed or depends on PYTHONHASHSEED
value.
Side-effect of using SHA1 that even if file is in the old format it will be just
rewritten with a new hash value and environment is rebuilt.

Testing
-------
Updated existing test-case to ensure that SHA1 is saved in the .previous file.