mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	py3: Fix or remove (almost) all references to Python 2 venv in docs.
I think soon we'll put the Python 3 venv at `/srv/zulip-venv` and make `/srv/zulip-py3-venv` just an alias to that (then remove the alias too), but for now the old name is helpful for spotting places that need an update. The `/srv/zulip-venv` name still appears in codepaths used by Travis tests.
This commit is contained in:
		@@ -406,10 +406,6 @@ bot_handler.update_message(dict(
 | 
			
		||||
      ```
 | 
			
		||||
      source /srv/zulip-py3-venv/bin/activate
 | 
			
		||||
      ```
 | 
			
		||||
      Note that you can switch back to a Python 2 environment as follows:
 | 
			
		||||
      ```
 | 
			
		||||
      source /srv/zulip-venv/bin/activate
 | 
			
		||||
      ```
 | 
			
		||||
 | 
			
		||||
* My bot works only on some streams.
 | 
			
		||||
    * Subscribe your bot to other streams, as described [here](#how-to-run-a-bot).
 | 
			
		||||
 
 | 
			
		||||
@@ -379,17 +379,17 @@ Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 4.4.0-21-generic x86_64)
 | 
			
		||||
Congrats, you're now inside the Zulip development environment!
 | 
			
		||||
 | 
			
		||||
You can confirm this by looking at the command prompt, which starts
 | 
			
		||||
with `(zulip-venv)vagrant@`.  If it just starts with `vagrant@`, your
 | 
			
		||||
with `(zulip-py3-venv)vagrant@`.  If it just starts with `vagrant@`, your
 | 
			
		||||
provisioning failed and you should look at the
 | 
			
		||||
[troubleshooting section](#troubleshooting-common-errors).
 | 
			
		||||
 | 
			
		||||
Next, start the Zulip server:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~
 | 
			
		||||
(zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~
 | 
			
		||||
$ cd zulip
 | 
			
		||||
 | 
			
		||||
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip
 | 
			
		||||
(zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip
 | 
			
		||||
$ ./tools/run-dev.py
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@@ -535,7 +535,7 @@ From the window where run-dev.py is running:
 | 
			
		||||
2016-05-04 18:33:13,330 INFO     127.0.0.1       GET     200  92ms /register/ (unauth via ?)
 | 
			
		||||
^C
 | 
			
		||||
KeyboardInterrupt
 | 
			
		||||
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip$ exit
 | 
			
		||||
(zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip$ exit
 | 
			
		||||
logout
 | 
			
		||||
Connection to 127.0.0.1 closed.
 | 
			
		||||
christie@win10 ~/zulip
 | 
			
		||||
@@ -571,10 +571,10 @@ christie@win10 ~/zulip
 | 
			
		||||
$ vagrant up
 | 
			
		||||
$ vagrant ssh
 | 
			
		||||
 | 
			
		||||
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~
 | 
			
		||||
(zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~
 | 
			
		||||
$ cd zulip
 | 
			
		||||
 | 
			
		||||
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip
 | 
			
		||||
(zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip
 | 
			
		||||
$ ./tools/run-dev.py
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@@ -617,7 +617,7 @@ When reporting your issue, please include the following information:
 | 
			
		||||
The output of `tools/diagnose` run inside the Vagrant guest is also
 | 
			
		||||
usually helpful.
 | 
			
		||||
 | 
			
		||||
#### Vagrant guest doesn't show (zulip-venv) at start of prompt
 | 
			
		||||
#### Vagrant guest doesn't show (zulip-py3-venv) at start of prompt
 | 
			
		||||
 | 
			
		||||
This is caused by provisioning failing to complete successfully.  You
 | 
			
		||||
can see the errors in `var/log/provision.log`; it should end with
 | 
			
		||||
@@ -863,13 +863,13 @@ environment to use it](#specifying-a-proxy).
 | 
			
		||||
Once you've provisioned successfully, you'll get output like this:
 | 
			
		||||
```
 | 
			
		||||
Zulip development environment setup succeeded!
 | 
			
		||||
(zulip-venv) vagrant@vagrant-base-trusty-amd64:~/zulip$
 | 
			
		||||
(zulip-py3-venv) vagrant@vagrant-base-trusty-amd64:~/zulip$
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
If the `(zulip-venv)` part is missing, this is because your
 | 
			
		||||
If the `(zulip-py3-venv)` part is missing, this is because your
 | 
			
		||||
installation failed the first time before the Zulip virtualenv was
 | 
			
		||||
created.  You can fix this by just closing the shell and running
 | 
			
		||||
`vagrant ssh` again, or using `source /srv/zulip-venv/bin/activate`.
 | 
			
		||||
`vagrant ssh` again, or using `source /srv/zulip-py3-venv/bin/activate`.
 | 
			
		||||
 | 
			
		||||
Finally, if you encounter any issues that weren't caused by your
 | 
			
		||||
Internet connection, please report them!  We try hard to keep Zulip
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ can do that by just running:
 | 
			
		||||
```
 | 
			
		||||
# From a clone of zulip.git
 | 
			
		||||
./tools/provision
 | 
			
		||||
source /srv/zulip-venv/bin/activate
 | 
			
		||||
source /srv/zulip-py3-venv/bin/activate
 | 
			
		||||
./tools/run-dev.py  # starts the development server
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -224,13 +224,3 @@ installed).
 | 
			
		||||
To run `check-py3` on just the Python files in a particular directory, you
 | 
			
		||||
can change the current working directory (e.g. `cd zerver/`) and run
 | 
			
		||||
`check-py3` from there.
 | 
			
		||||
 | 
			
		||||
Also, if you're using Vagrant or if you set up virtualenvs in the
 | 
			
		||||
[non-Vagrant setup](dev-setup-non-vagrant.html#all-systems), you should
 | 
			
		||||
have two different virtualenvs: one for Python 2 (which is the one used by
 | 
			
		||||
default), and another one for Python 3. This is useful if you want to do
 | 
			
		||||
some manual testing using either version.
 | 
			
		||||
 | 
			
		||||
To switch between both virtualenvs, run:
 | 
			
		||||
 - Use Python 2: `source /srv/zulip-venv/bin/activate`
 | 
			
		||||
 - Use Python 3: `source /srv/zulip-py3-venv/bin/activate`
 | 
			
		||||
 
 | 
			
		||||
@@ -63,7 +63,7 @@ def check_django():
 | 
			
		||||
 | 
			
		||||
            Make sure your shell does this at init time:
 | 
			
		||||
 | 
			
		||||
            source /srv/zulip-venv/bin/activate
 | 
			
		||||
            source /srv/zulip-py3-venv/bin/activate
 | 
			
		||||
 | 
			
		||||
            Or maybe you forget to run inside your VM?
 | 
			
		||||
            ''')
 | 
			
		||||
 
 | 
			
		||||
@@ -16,5 +16,5 @@ def check_venv(filename):
 | 
			
		||||
        if user_name != 'vagrant' and user_name != 'zulipdev':
 | 
			
		||||
            print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.")
 | 
			
		||||
        else:
 | 
			
		||||
            print("You can `source /srv/zulip-venv/bin/activate` to enter the Zulip development environment.")
 | 
			
		||||
            print("You can `source /srv/zulip-py3-venv/bin/activate` to enter the Zulip development environment.")
 | 
			
		||||
        sys.exit(1)
 | 
			
		||||
 
 | 
			
		||||
@@ -8,12 +8,6 @@ if [ ! -d /srv/zulip-py3-venv ]; then
 | 
			
		||||
    ./tools/setup/setup_venvs.py
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
source /srv/zulip-venv/bin/activate # Activate python2 virtualenv
 | 
			
		||||
pip-compile --output-file requirements/py2_common_lock.txt requirements/py2_common.txt
 | 
			
		||||
# Remove the editable flag in the lock file for safer build
 | 
			
		||||
sed -i 's/-e //' requirements/py2_common_lock.txt
 | 
			
		||||
deactivate
 | 
			
		||||
 | 
			
		||||
source /srv/zulip-py3-venv/bin/activate # Activate python3 virtualenv
 | 
			
		||||
pip-compile --output-file requirements/py3_common_lock.txt requirements/py3_common.txt
 | 
			
		||||
# Remove the editable flag in the lock file for safer build
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user