capistrano-pyenv 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -0
- data/lib/capistrano-pyenv/deploy.rb +20 -3
- data/lib/capistrano-pyenv/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -35,6 +35,9 @@ Following options are available to manage your pyenv.
|
|
35
35
|
* `:pyenv_repository` - repository URL of pyenv.
|
36
36
|
* `:pyenv_python_dependencies` - depedency packages.
|
37
37
|
* `:pyenv_python_version` - the python version to install. install `2.7.3` by default.
|
38
|
+
* `:pyenv_use_virtualenv` - create new virtualenv from `:pyenv_virtualenv_python_version`. `false` by default. `:pyenv_python_version` will be treated as the name of the virtualenv if this is turned `true`.
|
39
|
+
* `:pyenv_virtualenv_python_version` - the python version to create virtualenv. `2.7.3` by default.
|
40
|
+
* `:pyenv_virtualenv_options` - command-line options for virtualenv.
|
38
41
|
|
39
42
|
## Contributing
|
40
43
|
|
@@ -38,6 +38,9 @@ module Capistrano
|
|
38
38
|
}
|
39
39
|
|
40
40
|
_cset(:pyenv_python_version, '2.7.3')
|
41
|
+
_cset(:pyenv_use_virtualenv, false)
|
42
|
+
_cset(:pyenv_virtualenv_python_version, '2.7.3')
|
43
|
+
_cset(:pyenv_virtualenv_options, %w(--distribute --quiet --system-site-packages))
|
41
44
|
|
42
45
|
desc("Setup pyenv.")
|
43
46
|
task(:setup, :except => { :no_release => true }) {
|
@@ -91,7 +94,7 @@ module Capistrano
|
|
91
94
|
File.join(pyenv_configure_home, basename)
|
92
95
|
}
|
93
96
|
else
|
94
|
-
bash_profile File.join(pyenv_configure_home, '.bash_profile')
|
97
|
+
bash_profile = File.join(pyenv_configure_home, '.bash_profile')
|
95
98
|
profile = File.join(pyenv_configure_home, '.profile')
|
96
99
|
case File.basename(pyenv_configure_shell)
|
97
100
|
when /bash/
|
@@ -180,9 +183,23 @@ module Capistrano
|
|
180
183
|
desc("Build python within pyenv.")
|
181
184
|
task(:build, :except => { :no_release => true }) {
|
182
185
|
python = fetch(:pyenv_python_cmd, 'python')
|
183
|
-
if
|
184
|
-
|
186
|
+
if pyenv_use_virtualenv
|
187
|
+
if pyenv_virtualenv_python_version != 'system'
|
188
|
+
# build python for virtualenv
|
189
|
+
run("#{pyenv_bin} whence #{python} | fgrep -q #{pyenv_virtualenv_python_version} || " +
|
190
|
+
"#{pyenv_bin} install #{pyenv_virtualenv_python_version}")
|
191
|
+
end
|
192
|
+
if pyenv_python_version != 'system'
|
193
|
+
# create virtualenv
|
194
|
+
run("#{pyenv_bin} whence #{python} | fgrep -q #{pyenv_python_version} || " +
|
195
|
+
"#{pyenv_bin} virtualenv #{pyenv_virtualenv_options.join(' ')} #{pyenv_virtualenv_python_version} #{pyenv_python_version}")
|
196
|
+
end
|
197
|
+
else
|
198
|
+
if pyenv_python_version != 'system'
|
199
|
+
run("#{pyenv_bin} whence #{python} | fgrep -q #{pyenv_python_version} || #{pyenv_bin} install #{pyenv_python_version}")
|
200
|
+
end
|
185
201
|
end
|
202
|
+
|
186
203
|
run("#{pyenv_cmd} exec #{python} --version && #{pyenv_cmd} global #{pyenv_python_version}")
|
187
204
|
}
|
188
205
|
}
|