##// END OF EJS Templates
py3: use "python3 -m venv" instead of virtualenv package
Mads Kiilerich -
r8073:89e9aef9 default
parent child Browse files
Show More
@@ -9,10 +9,10 b' node {'
9 daysToKeepStr: '',
9 daysToKeepStr: '',
10 numToKeepStr: '']]]);
10 numToKeepStr: '']]]);
11 if (isUnix()) {
11 if (isUnix()) {
12 createvirtualenv = 'rm -r $JENKINS_HOME/venv/$JOB_NAME || true && virtualenv $JENKINS_HOME/venv/$JOB_NAME'
12 createvirtualenv = 'rm -r $JENKINS_HOME/venv/$JOB_NAME || true && python3 -m venv $JENKINS_HOME/venv/$JOB_NAME'
13 activatevirtualenv = '. $JENKINS_HOME/venv/$JOB_NAME/bin/activate'
13 activatevirtualenv = '. $JENKINS_HOME/venv/$JOB_NAME/bin/activate'
14 } else {
14 } else {
15 createvirtualenv = 'rmdir /s /q %JENKINS_HOME%\\venv\\%JOB_NAME% || true && virtualenv %JENKINS_HOME%\\venv\\%JOB_NAME%'
15 createvirtualenv = 'rmdir /s /q %JENKINS_HOME%\\venv\\%JOB_NAME% || true && python3 -m venv %JENKINS_HOME%\\venv\\%JOB_NAME%'
16 activatevirtualenv = 'call %JENKINS_HOME%\\venv\\%JOB_NAME%\\Scripts\\activate.bat'
16 activatevirtualenv = 'call %JENKINS_HOME%\\venv\\%JOB_NAME%\\Scripts\\activate.bat'
17 }
17 }
18
18
@@ -25,7 +25,7 b' Installation'
25 ------------
25 ------------
26
26
27 Kallithea requires Python_ 2.7 and it is recommended to install it in a
27 Kallithea requires Python_ 2.7 and it is recommended to install it in a
28 virtualenv_. Official releases of Kallithea can be installed with::
28 virtualenv. Official releases of Kallithea can be installed with::
29
29
30 pip install kallithea
30 pip install kallithea
31
31
@@ -173,7 +173,6 b' database from RhodeCode to Kallithea, be'
173 of Kallithea.
173 of Kallithea.
174
174
175
175
176 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
177 .. _Python: http://www.python.org/
176 .. _Python: http://www.python.org/
178 .. _Sphinx: http://sphinx.pocoo.org/
177 .. _Sphinx: http://sphinx.pocoo.org/
179 .. _Mercurial: http://mercurial.selenic.com/
178 .. _Mercurial: http://mercurial.selenic.com/
@@ -32,7 +32,7 b' To get started with Kallithea developmen'
32
32
33 hg clone https://kallithea-scm.org/repos/kallithea
33 hg clone https://kallithea-scm.org/repos/kallithea
34 cd kallithea
34 cd kallithea
35 virtualenv ../kallithea-venv
35 python3 -m venv ../kallithea-venv
36 source ../kallithea-venv/bin/activate
36 source ../kallithea-venv/bin/activate
37 pip install --upgrade pip setuptools
37 pip install --upgrade pip setuptools
38 pip install --upgrade -e . -r dev_requirements.txt python-ldap python-pam
38 pip install --upgrade -e . -r dev_requirements.txt python-ldap python-pam
@@ -78,7 +78,6 b' Developer guide'
78 dev/dbmigrations
78 dev/dbmigrations
79
79
80
80
81 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
82 .. _python: http://www.python.org/
81 .. _python: http://www.python.org/
83 .. _django: http://www.djangoproject.com/
82 .. _django: http://www.djangoproject.com/
84 .. _mercurial: https://www.mercurial-scm.org/
83 .. _mercurial: https://www.mercurial-scm.org/
@@ -48,12 +48,12 b' reasonable set of dependencies is instal'
48 Installation from repository source
48 Installation from repository source
49 -----------------------------------
49 -----------------------------------
50
50
51 To install Kallithea in a virtualenv_ using the stable branch of the development
51 To install Kallithea in a virtualenv using the stable branch of the development
52 repository, follow the instructions below::
52 repository, follow the instructions below::
53
53
54 hg clone https://kallithea-scm.org/repos/kallithea -u stable
54 hg clone https://kallithea-scm.org/repos/kallithea -u stable
55 cd kallithea
55 cd kallithea
56 virtualenv ../kallithea-venv
56 python3 -m venv ../kallithea-venv
57 . ../kallithea-venv/bin/activate
57 . ../kallithea-venv/bin/activate
58 pip install --upgrade pip setuptools
58 pip install --upgrade pip setuptools
59 pip install --upgrade -e .
59 pip install --upgrade -e .
@@ -67,18 +67,18 b' You can now proceed to :ref:`setup`.'
67 Installing a released version in a virtualenv
67 Installing a released version in a virtualenv
68 ---------------------------------------------
68 ---------------------------------------------
69
69
70 It is highly recommended to use a separate virtualenv_ for installing Kallithea.
70 It is highly recommended to use a separate virtualenv for installing Kallithea.
71 This way, all libraries required by Kallithea will be installed separately from your
71 This way, all libraries required by Kallithea will be installed separately from your
72 main Python installation and other applications and things will be less
72 main Python installation and other applications and things will be less
73 problematic when upgrading the system or Kallithea.
73 problematic when upgrading the system or Kallithea.
74 An additional benefit of virtualenv_ is that it doesn't require root privileges.
74 An additional benefit of virtualenv is that it doesn't require root privileges.
75
75
76 - Assuming you have installed virtualenv_, create a new virtual environment
76 - Assuming you have installed virtualenv, create a new virtual environment
77 for example, in `/srv/kallithea/venv`, using the virtualenv command::
77 for example, in `/srv/kallithea/venv`, using the venv command::
78
78
79 virtualenv /srv/kallithea/venv
79 python3 -m venv /srv/kallithea/venv
80
80
81 - Activate the virtualenv_ in your current shell session and make sure the
81 - Activate the virtualenv in your current shell session and make sure the
82 basic requirements are up-to-date by running::
82 basic requirements are up-to-date by running::
83
83
84 . /srv/kallithea/venv/bin/activate
84 . /srv/kallithea/venv/bin/activate
@@ -133,6 +133,3 b' To install as a regular user in ``~/.loc'
133 pip install --user kallithea
133 pip install --user kallithea
134
134
135 You can now proceed to :ref:`setup`.
135 You can now proceed to :ref:`setup`.
136
137
138 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
@@ -108,15 +108,9 b' Step 6 -- Install virtualenv'
108 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
108 A python virtual environment will allow for isolation between the Python packages of your system and those used for Kallithea.
109 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa.
109 It is strongly recommended to use it to ensure that Kallithea does not change a dependency that other software uses or vice versa.
110
110
111 In a command prompt type::
112
113 pip install virtualenv
114
115 Virtualenv will now be inside your Python Scripts path (C:\\Python27\\Scripts or similar).
116
117 To create a virtual environment, run::
111 To create a virtual environment, run::
118
112
119 virtualenv C:\Kallithea\Env
113 python3 -m venv C:\Kallithea\Env
120
114
121 Step 7 -- Install Kallithea
115 Step 7 -- Install Kallithea
122 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
116 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -139,22 +139,10 b' Create the following folder structure::'
139 Step 6 -- Install virtualenv
139 Step 6 -- Install virtualenv
140 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141
141
142 Install Virtual Env for Python
142 Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
143
143 do so, open a CMD (Python Path should be included in Step3), and write::
144 Navigate to: http://www.virtualenv.org/en/latest/index.html#installation
145 Right click on "virtualenv.py" file and choose "Save link as...".
146 Download to C:\\Kallithea (or whatever you want)
147 (the file is located at
148 https://raw.github.com/pypa/virtualenv/master/virtualenv.py)
149
144
150 Create a virtual Python environment in C:\\Kallithea\\Env (or similar). To
145 python3 -m venv C:\Kallithea\Env
151 do so, open a CMD (Python Path should be included in Step3), navigate
152 where you downloaded "virtualenv.py", and write::
153
154 python2 virtualenv.py C:\Kallithea\Env
155
156 (--no-site-packages is now the default behaviour of virtualenv, no need
157 to include it)
158
146
159 Step 7 -- Install Kallithea
147 Step 7 -- Install Kallithea
160 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
148 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -30,7 +30,7 b' environment used for running Kallithea.'
30 - Packages could also be installed in ``~/.local`` ... but that is probably
30 - Packages could also be installed in ``~/.local`` ... but that is probably
31 only a good idea if using a dedicated user per application or instance.
31 only a good idea if using a dedicated user per application or instance.
32
32
33 - Finally, it can be installed in a virtualenv_. That is a very lightweight
33 - Finally, it can be installed in a virtualenv. That is a very lightweight
34 "container" where each Kallithea instance can get its own dedicated and
34 "container" where each Kallithea instance can get its own dedicated and
35 self-contained virtual environment.
35 self-contained virtual environment.
36
36
@@ -165,7 +165,6 b' continuous hammering from the internet.'
165 .. _Python: http://www.python.org/
165 .. _Python: http://www.python.org/
166 .. _Gunicorn: http://gunicorn.org/
166 .. _Gunicorn: http://gunicorn.org/
167 .. _Waitress: http://waitress.readthedocs.org/en/latest/
167 .. _Waitress: http://waitress.readthedocs.org/en/latest/
168 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
169 .. _Gearbox: http://turbogears.readthedocs.io/en/latest/turbogears/gearbox.html
168 .. _Gearbox: http://turbogears.readthedocs.io/en/latest/turbogears/gearbox.html
170 .. _PyPI: https://pypi.python.org/pypi
169 .. _PyPI: https://pypi.python.org/pypi
171 .. _Apache httpd: http://httpd.apache.org/
170 .. _Apache httpd: http://httpd.apache.org/
@@ -624,7 +624,6 b' the ``init.d`` directory of the Kallithe'
624 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
624 .. __: https://kallithea-scm.org/repos/kallithea/files/tip/init.d/ .
625
625
626
626
627 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
628 .. _python: http://www.python.org/
627 .. _python: http://www.python.org/
629 .. _Python regular expression documentation: https://docs.python.org/2/library/re.html
628 .. _Python regular expression documentation: https://docs.python.org/2/library/re.html
630 .. _Mercurial: https://www.mercurial-scm.org/
629 .. _Mercurial: https://www.mercurial-scm.org/
@@ -241,6 +241,3 b' To update the hooks of your Git reposito'
241 .. note::
241 .. note::
242 Kallithea does not use hooks on Mercurial repositories. This step is thus
242 Kallithea does not use hooks on Mercurial repositories. This step is thus
243 not necessary if you only have Mercurial repositories.
243 not necessary if you only have Mercurial repositories.
244
245
246 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
@@ -67,7 +67,6 b' Troubleshooting'
67 you have installed the latest Windows patches (especially KB2789397).
67 you have installed the latest Windows patches (especially KB2789397).
68
68
69
69
70 .. _virtualenv: http://pypi.python.org/pypi/virtualenv
71 .. _python: http://www.python.org/
70 .. _python: http://www.python.org/
72 .. _mercurial: https://www.mercurial-scm.org/
71 .. _mercurial: https://www.mercurial-scm.org/
73 .. _celery: http://celeryproject.org/
72 .. _celery: http://celeryproject.org/
@@ -15,7 +15,7 b' venv=$(mktemp -d --tmpdir kallithea-rele'
15 trap cleanup EXIT
15 trap cleanup EXIT
16
16
17 echo "Setting up a fresh virtualenv in $venv"
17 echo "Setting up a fresh virtualenv in $venv"
18 virtualenv -p python3 "$venv"
18 python3 -m venv "$venv"
19 . "$venv/bin/activate"
19 . "$venv/bin/activate"
20
20
21 echo "Install/verify tools needed for building and uploading stuff"
21 echo "Install/verify tools needed for building and uploading stuff"
@@ -34,7 +34,7 b' for rev in $(hg log -r "$1" -T \'{node}\\n'
34 hg update "$rev"
34 hg update "$rev"
35
35
36 cleanup
36 cleanup
37 virtualenv -p "$(command -v python3)" "$venv"
37 python3 -m venv "$venv"
38 source "$venv/bin/activate"
38 source "$venv/bin/activate"
39 pip install --upgrade pip setuptools
39 pip install --upgrade pip setuptools
40 pip install -e . -r dev_requirements.txt python-ldap python-pam
40 pip install -e . -r dev_requirements.txt python-ldap python-pam
@@ -28,7 +28,7 b' mkdir -p "$venv"'
28 sed -n 's/.*"\(.*\)>=\(.*\)".*/\1==\2/p' setup.py > "$min_requirements"
28 sed -n 's/.*"\(.*\)>=\(.*\)".*/\1==\2/p' setup.py > "$min_requirements"
29 sed 's/>=/==/p' dev_requirements.txt >> "$min_requirements"
29 sed 's/>=/==/p' dev_requirements.txt >> "$min_requirements"
30
30
31 virtualenv -p "$(command -v python3)" "$venv"
31 python3 -m venv "$venv"
32 source "$venv/bin/activate"
32 source "$venv/bin/activate"
33 pip install --upgrade pip setuptools
33 pip install --upgrade pip setuptools
34 pip install -e . -r "$min_requirements" python-ldap python-pam 2> >(tee "$log" >&2)
34 pip install -e . -r "$min_requirements" python-ldap python-pam 2> >(tee "$log" >&2)
General Comments 0
You need to be logged in to leave comments. Login now