mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	The reason that `pip-tools` running on Python 3 didn’t detect the right requirements for `thumbor` on Python 2 is simply that some of them are conditional on the Python version. As for the requirements that had been manually added as a workaround: `backports-abc` and `singledispatch` are now correctly detected, while `backports.ssl-match-hostname` was vendored into `urllib3` some time ago and `certifi` is no longer necessary. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			933 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			933 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env python3
 | 
						|
 | 
						|
import os
 | 
						|
import sys
 | 
						|
 | 
						|
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 | 
						|
if ZULIP_PATH not in sys.path:
 | 
						|
    sys.path.append(ZULIP_PATH)
 | 
						|
 | 
						|
from scripts.lib.setup_venv import setup_virtualenv
 | 
						|
from scripts.lib.zulip_tools import overwrite_symlink
 | 
						|
 | 
						|
VENV_PATH = "/srv/zulip-py3-venv"
 | 
						|
 | 
						|
DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "dev.txt")
 | 
						|
THUMBOR_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "thumbor-dev.txt")
 | 
						|
 | 
						|
def main() -> None:
 | 
						|
    setup_virtualenv("/srv/zulip-thumbor-venv", THUMBOR_REQS_FILE,
 | 
						|
                     patch_activate_script=True, virtualenv_args=['-p', 'python2.7'])
 | 
						|
    cached_venv_path = setup_virtualenv(
 | 
						|
        VENV_PATH, DEV_REQS_FILE, patch_activate_script=True,
 | 
						|
        virtualenv_args=['-p', 'python3'])
 | 
						|
    overwrite_symlink(cached_venv_path, os.path.join(ZULIP_PATH, "zulip-py3-venv"))
 | 
						|
 | 
						|
if __name__ == "__main__":
 | 
						|
    main()
 |