changeset 8193:89e9aef9b983

py3: use "python3 -m venv" instead of virtualenv package
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 03 Feb 2020 16:30:08 +0100
parents b7caa806cf6e
children 502d2fcbe434
files Jenkinsfile README.rst docs/contributing.rst docs/index.rst docs/installation.rst docs/installation_win.rst docs/installation_win_old.rst docs/overview.rst docs/setup.rst docs/upgrade.rst docs/usage/troubleshooting.rst scripts/make-release scripts/validate-commits scripts/validate-minimum-dependency-versions
diffstat 14 files changed, 20 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/Jenkinsfile	Wed Dec 25 17:07:35 2019 +0100
+++ b/Jenkinsfile	Mon Feb 03 16:30:08 2020 +0100
@@ -9,10 +9,10 @@
                               daysToKeepStr: '',
                               numToKeepStr: '']]]);
     if (isUnix()) {
-        createvirtualenv = 'rm -r $JENKINS_HOME/venv/$JOB_NAME || true && virtualenv $JENKINS_HOME/venv/$JOB_NAME'
+        createvirtualenv = 'rm -r $JENKINS_HOME/venv/$JOB_NAME || true && python3 -m venv $JENKINS_HOME/venv/$JOB_NAME'
         activatevirtualenv = '. $JENKINS_HOME/venv/$JOB_NAME/bin/activate'
     } else {
-        createvirtualenv = 'rmdir /s /q %JENKINS_HOME%\\venv\\%JOB_NAME% || true && virtualenv %JENKINS_HOME%\\venv\\%JOB_NAME%'
+        createvirtualenv = 'rmdir /s /q %JENKINS_HOME%\\venv\\%JOB_NAME% || true && python3 -m venv %JENKINS_HOME%\\venv\\%JOB_NAME%'
         activatevirtualenv = 'call %JENKINS_HOME%\\venv\\%JOB_NAME%\\Scripts\\activate.bat'
     }
 
--- a/README.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/README.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -25,7 +25,7 @@
 ------------
 
 Kallithea requires Python_ 2.7 and it is recommended to install it in a
-virtualenv_. Official releases of Kallithea can be installed with::
+virtualenv. Official releases of Kallithea can be installed with::
 
     pip install kallithea
 
@@ -173,7 +173,6 @@
 of Kallithea.
 
 
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 .. _Python: http://www.python.org/
 .. _Sphinx: http://sphinx.pocoo.org/
 .. _Mercurial: http://mercurial.selenic.com/
--- a/docs/contributing.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/contributing.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -32,7 +32,7 @@
 
         hg clone https://kallithea-scm.org/repos/kallithea
         cd kallithea
-        virtualenv ../kallithea-venv
+        python3 -m venv ../kallithea-venv
         source ../kallithea-venv/bin/activate
         pip install --upgrade pip setuptools
         pip install --upgrade -e . -r dev_requirements.txt python-ldap python-pam
--- a/docs/index.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/index.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -78,7 +78,6 @@
    dev/dbmigrations
 
 
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 .. _python: http://www.python.org/
 .. _django: http://www.djangoproject.com/
 .. _mercurial: https://www.mercurial-scm.org/
--- a/docs/installation.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/installation.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -48,12 +48,12 @@
 Installation from repository source
 -----------------------------------
 
-To install Kallithea in a virtualenv_ using the stable branch of the development
+To install Kallithea in a virtualenv using the stable branch of the development
 repository, follow the instructions below::
 
         hg clone https://kallithea-scm.org/repos/kallithea -u stable
         cd kallithea
-        virtualenv ../kallithea-venv
+        python3 -m venv ../kallithea-venv
         . ../kallithea-venv/bin/activate
         pip install --upgrade pip setuptools
         pip install --upgrade -e .
@@ -67,18 +67,18 @@
 Installing a released version in a virtualenv
 ---------------------------------------------
 
-It is highly recommended to use a separate virtualenv_ for installing Kallithea.
+It is highly recommended to use a separate virtualenv for installing Kallithea.
 This way, all libraries required by Kallithea will be installed separately from your
 main Python installation and other applications and things will be less
 problematic when upgrading the system or Kallithea.
-An additional benefit of virtualenv_ is that it doesn't require root privileges.
+An additional benefit of virtualenv is that it doesn't require root privileges.
 
-- Assuming you have installed virtualenv_, create a new virtual environment
-  for example, in `/srv/kallithea/venv`, using the virtualenv command::
+- Assuming you have installed virtualenv, create a new virtual environment
+  for example, in `/srv/kallithea/venv`, using the venv command::
 
-    virtualenv /srv/kallithea/venv
+    python3 -m venv /srv/kallithea/venv
 
-- Activate the virtualenv_ in your current shell session and make sure the
+- Activate the virtualenv in your current shell session and make sure the
   basic requirements are up-to-date by running::
 
     . /srv/kallithea/venv/bin/activate
@@ -133,6 +133,3 @@
     pip install --user kallithea
 
 You can now proceed to :ref:`setup`.
-
-
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
--- a/docs/installation_win.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/installation_win.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -108,15 +108,9 @@
    A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
    It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa.
 
-In a command prompt type::
-
-  pip install virtualenv
-
-Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
-
 To create a virtual environment, run::
 
-  virtualenv C:\Kallithea\Env
+  python3 -m venv C:\Kallithea\Env
 
 Step 7 -- Install Kallithea
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
--- a/docs/installation_win_old.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/installation_win_old.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -139,22 +139,10 @@
 Step 6 -- Install virtualenv
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Install Virtual Env for Python
-
-Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
-Right click on "virtualenv.py" file and choose "Save link as...".
-Download to C:\\Kallithea (or whatever you want)
-(the file is located at
-https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
+Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
+do so, open a CMD (Python Path should be included in Step3), and write::
 
-Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
-do so, open a CMD (Python Path should be included in Step3), navigate
-where you downloaded "virtualenv.py", and write::
-
-  python2 virtualenv.py C:\Kallithea\Env
-
-(--no-site-packages is now the default behaviour of virtualenv, no need
-to include it)
+  python3 -m venv C:\Kallithea\Env
 
 Step 7 -- Install Kallithea
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
--- a/docs/overview.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/overview.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -30,7 +30,7 @@
 - Packages could also be installed in ``~/.local`` ... but that is probably
   only a good idea if using a dedicated user per application or instance.
 
-- Finally, it can be installed in a virtualenv_. That is a very lightweight
+- Finally, it can be installed in a virtualenv. That is a very lightweight
   "container" where each Kallithea instance can get its own dedicated and
   self-contained virtual environment.
 
@@ -165,7 +165,6 @@
 .. _Python: http://www.python.org/
 .. _Gunicorn: http://gunicorn.org/
 .. _Waitress: http://waitress.readthedocs.org/en/latest/
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 .. _Gearbox: http://turbogears.readthedocs.io/en/latest/turbogears/gearbox.html
 .. _PyPI: https://pypi.python.org/pypi
 .. _Apache httpd: http://httpd.apache.org/
--- a/docs/setup.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/setup.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -624,7 +624,6 @@
 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
 
 
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 .. _python: http://www.python.org/
 .. _Python regular expression documentation: https://docs.python.org/2/library/re.html
 .. _Mercurial: https://www.mercurial-scm.org/
--- a/docs/upgrade.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/upgrade.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -241,6 +241,3 @@
 .. note::
     Kallithea does not use hooks on Mercurial repositories. This step is thus
     not necessary if you only have Mercurial repositories.
-
-
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
--- a/docs/usage/troubleshooting.rst	Wed Dec 25 17:07:35 2019 +0100
+++ b/docs/usage/troubleshooting.rst	Mon Feb 03 16:30:08 2020 +0100
@@ -67,7 +67,6 @@
     you have installed the latest Windows patches (especially KB2789397).
 
 
-.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 .. _python: http://www.python.org/
 .. _mercurial: https://www.mercurial-scm.org/
 .. _celery: http://celeryproject.org/
--- a/scripts/make-release	Wed Dec 25 17:07:35 2019 +0100
+++ b/scripts/make-release	Mon Feb 03 16:30:08 2020 +0100
@@ -15,7 +15,7 @@
 trap cleanup EXIT
 
 echo "Setting up a fresh virtualenv in $venv"
-virtualenv -p python3 "$venv"
+python3 -m venv "$venv"
 . "$venv/bin/activate"
 
 echo "Install/verify tools needed for building and uploading stuff"
--- a/scripts/validate-commits	Wed Dec 25 17:07:35 2019 +0100
+++ b/scripts/validate-commits	Mon Feb 03 16:30:08 2020 +0100
@@ -34,7 +34,7 @@
     hg update "$rev"
 
     cleanup
-    virtualenv -p "$(command -v python3)" "$venv"
+    python3 -m venv "$venv"
     source "$venv/bin/activate"
     pip install --upgrade pip setuptools
     pip install -e . -r dev_requirements.txt python-ldap python-pam
--- a/scripts/validate-minimum-dependency-versions	Wed Dec 25 17:07:35 2019 +0100
+++ b/scripts/validate-minimum-dependency-versions	Mon Feb 03 16:30:08 2020 +0100
@@ -28,7 +28,7 @@
 sed -n 's/.*"\(.*\)>=\(.*\)".*/\1==\2/p' setup.py > "$min_requirements"
 sed 's/>=/==/p' dev_requirements.txt >> "$min_requirements"
 
-virtualenv -p "$(command -v python3)" "$venv"
+python3 -m venv "$venv"
 source "$venv/bin/activate"
 pip install --upgrade pip setuptools
 pip install -e . -r "$min_requirements" python-ldap python-pam 2> >(tee "$log" >&2)