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:
Greg Price
2017-08-08 15:44:40 -07:00
parent b0e4233d3f
commit d3a69da829
7 changed files with 13 additions and 33 deletions

View File

@@ -406,10 +406,6 @@ bot_handler.update_message(dict(
``` ```
source /srv/zulip-py3-venv/bin/activate 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. * My bot works only on some streams.
* Subscribe your bot to other streams, as described [here](#how-to-run-a-bot). * Subscribe your bot to other streams, as described [here](#how-to-run-a-bot).

View File

@@ -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! Congrats, you're now inside the Zulip development environment!
You can confirm this by looking at the command prompt, which starts 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 provisioning failed and you should look at the
[troubleshooting section](#troubleshooting-common-errors). [troubleshooting section](#troubleshooting-common-errors).
Next, start the Zulip server: Next, start the Zulip server:
``` ```
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~ (zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~
$ cd zulip $ cd zulip
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip (zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip
$ ./tools/run-dev.py $ ./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 ?) 2016-05-04 18:33:13,330 INFO 127.0.0.1 GET 200 92ms /register/ (unauth via ?)
^C ^C
KeyboardInterrupt KeyboardInterrupt
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip$ exit (zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip$ exit
logout logout
Connection to 127.0.0.1 closed. Connection to 127.0.0.1 closed.
christie@win10 ~/zulip christie@win10 ~/zulip
@@ -571,10 +571,10 @@ christie@win10 ~/zulip
$ vagrant up $ vagrant up
$ vagrant ssh $ vagrant ssh
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~ (zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~
$ cd zulip $ cd zulip
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip (zulip-py3-venv)vagrant@vagrant-ubuntu-trusty-64:~/zulip
$ ./tools/run-dev.py $ ./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 The output of `tools/diagnose` run inside the Vagrant guest is also
usually helpful. 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 This is caused by provisioning failing to complete successfully. You
can see the errors in `var/log/provision.log`; it should end with 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: Once you've provisioned successfully, you'll get output like this:
``` ```
Zulip development environment setup succeeded! 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 installation failed the first time before the Zulip virtualenv was
created. You can fix this by just closing the shell and running 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 Finally, if you encounter any issues that weren't caused by your
Internet connection, please report them! We try hard to keep Zulip Internet connection, please report them! We try hard to keep Zulip

View File

@@ -18,7 +18,7 @@ can do that by just running:
``` ```
# From a clone of zulip.git # From a clone of zulip.git
./tools/provision ./tools/provision
source /srv/zulip-venv/bin/activate source /srv/zulip-py3-venv/bin/activate
./tools/run-dev.py # starts the development server ./tools/run-dev.py # starts the development server
``` ```

View File

@@ -224,13 +224,3 @@ installed).
To run `check-py3` on just the Python files in a particular directory, you 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 can change the current working directory (e.g. `cd zerver/`) and run
`check-py3` from there. `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`

View File

@@ -63,7 +63,7 @@ def check_django():
Make sure your shell does this at init time: 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? Or maybe you forget to run inside your VM?
''') ''')

View File

@@ -16,5 +16,5 @@ def check_venv(filename):
if user_name != 'vagrant' and user_name != 'zulipdev': if user_name != 'vagrant' and user_name != 'zulipdev':
print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.") print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.")
else: 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) sys.exit(1)

View File

@@ -8,12 +8,6 @@ if [ ! -d /srv/zulip-py3-venv ]; then
./tools/setup/setup_venvs.py ./tools/setup/setup_venvs.py
fi 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 source /srv/zulip-py3-venv/bin/activate # Activate python3 virtualenv
pip-compile --output-file requirements/py3_common_lock.txt requirements/py3_common.txt pip-compile --output-file requirements/py3_common_lock.txt requirements/py3_common.txt
# Remove the editable flag in the lock file for safer build # Remove the editable flag in the lock file for safer build