File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,20 @@ def requirements_hash(self) -> str:
119119 Returns a sha256 hash of the requirements.
120120 """
121121 requirements_hash = hashlib .sha256 ()
122+ # The first part of the hash should be the path to the tools executable
123+ requirements_hash .update (sys .argv [0 ].encode ())
124+ # The second, TOOLS_VIRTUALENV_CACHE_SEED env variable, if set
122125 hash_seed = os .environ .get ("TOOLS_VIRTUALENV_CACHE_SEED" , "" )
123126 requirements_hash .update (hash_seed .encode ())
127+ # Third, any custom pip cli argument defined
124128 if self .pip_args :
125129 for argument in self .pip_args :
126130 requirements_hash .update (argument .encode ())
131+ # Forth, each passed requirement
127132 if self .requirements :
128133 for requirement in sorted (self .requirements ):
129134 requirements_hash .update (requirement .encode ())
135+ # And, lastly, any requirements files passed in
130136 if self .requirements_files :
131137 for fpath in sorted (self .requirements_files ):
132138 with _cast_to_pathlib_path (fpath ).open ("rb" ) as rfh :
You can’t perform that action at this time.
0 commit comments