mirror of https://github.com/zulip/zulip.git
setup_venv: Fix handling of Git requirements.
get_package_names did not correctly strip the GitHub URLs from package names, resulting in the "package names" for our dependencies installed from Git being tracked with the complete sha1sum included in the name. This meant that upgrading our virtualenvs incorrectly ended up resorting to creating an entirely new virtualenv whenever we changed a dependency that had previously been installed from GitHub URLs.
This commit is contained in:
parent
e37b6488b8
commit
fcde846b58
|
@ -45,6 +45,13 @@ def get_package_names(requirements_file):
|
||||||
cleaned = []
|
cleaned = []
|
||||||
operators = ['~=', '==', '!=', '<', '>']
|
operators = ['~=', '==', '!=', '<', '>']
|
||||||
for package in packages:
|
for package in packages:
|
||||||
|
if package.startswith("git+https://") and '#egg=' in package:
|
||||||
|
split_package = package.split("#egg=")
|
||||||
|
if len(split_package) != 2:
|
||||||
|
raise Exception("Unexpected duplicate #egg in package %s" % (package,))
|
||||||
|
# Extract the package name from Git requirements entries
|
||||||
|
package = split_package[1]
|
||||||
|
|
||||||
for operator in operators:
|
for operator in operators:
|
||||||
if operator in package:
|
if operator in package:
|
||||||
package = package.split(operator)[0]
|
package = package.split(operator)[0]
|
||||||
|
|
Loading…
Reference in New Issue