mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Factor out venv-installing code into a module.
Factor out the code in tools/provision.py which installs a python2 and python3 venv into a module (tools/setup/setup_venvs.py) which can also be used as a script.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							2930a769a9
						
					
				
				
					commit
					6548f1dd1c
				
			
							
								
								
									
										22
									
								
								tools/setup/setup_venvs.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										22
									
								
								tools/setup/setup_venvs.py
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
#!/usr/bin/env python
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
from os.path import dirname, abspath
 | 
			
		||||
 | 
			
		||||
ZULIP_PATH = dirname(dirname(dirname(abspath(__file__))))
 | 
			
		||||
if ZULIP_PATH not in sys.path:
 | 
			
		||||
    sys.path.append(ZULIP_PATH)
 | 
			
		||||
 | 
			
		||||
from scripts.lib.setup_venv import setup_virtualenv
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    # type: () -> None
 | 
			
		||||
    PY2_DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py2_dev.txt")
 | 
			
		||||
    setup_virtualenv("/srv/zulip-venv", PY2_DEV_REQS_FILE)
 | 
			
		||||
 | 
			
		||||
    PY3_DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "py3_dev.txt")
 | 
			
		||||
    setup_virtualenv("/srv/zulip-py3-venv", PY3_DEV_REQS_FILE, virtualenv_args=['-p', 'python3'])
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
		Reference in New Issue
	
	Block a user