DataDog / riot

A Python virtual env builder and command runner
https://ddriot.readthedocs.io/
Apache License 2.0
23 stars 15 forks source link

fix: change how Venvs are hashed #203

Closed emmettbutler closed 1 year ago

emmettbutler commented 1 year ago

This change removes self from the seed used to generate Venv hashes. This is because recent changes to the requirements installation logic mutated self between installation and pythonpath generation in such a way as to change the resulting hash. This meant that the virtualenv pointed to in the pythonpath was not the same one that had been generated for the current command run.

Basing the hash solely on attributes that don't change during execution keeps it stable per run.

This has been tested on dd-trace-py https://github.com/DataDog/dd-trace-py/pull/5227/commits/492fc0d8b21e537541befce36ac77478c6ed4f29

emmettbutler commented 1 year ago

@ZStriker19 I had to dismiss your review to sign all of the commits on this branch. If you could re-approve when you get a moment, I'd appreciate it!