Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
106fb10d
Commit
106fb10d
authored
Jan 29, 2013
by
Blair Zajac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
library/pip: add support for virtualenv's --system-site-packages.
parent
c1b63d15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
library/pip
+17
-2
No files found.
library/pip
View file @
106fb10d
...
@@ -47,6 +47,15 @@ options:
...
@@ -47,6 +47,15 @@ options:
- An optional path to a I(virtualenv) directory to install into
- An optional path to a I(virtualenv) directory to install into
required: false
required: false
default: null
default: null
virtualenv_site_packages:
description:
- Whether the virtual environment will inherit packages from the
global site-packages directory. Note that if this setting is
changed on an already existing virtual environment it will not
have any effect, the environment must be deleted and newly
created.
required: false
default: no
use_mirrors:
use_mirrors:
description:
description:
- Whether to use mirrors when installing python libraries. If using
- Whether to use mirrors when installing python libraries. If using
...
@@ -74,7 +83,9 @@ examples:
...
@@ -74,7 +83,9 @@ examples:
- code: "pip: name=flask version=0.8"
- code: "pip: name=flask version=0.8"
description: Install I(flask) python package on version 0.8.
description: Install I(flask) python package on version 0.8.
- code: "pip: name=flask virtualenv=/my_app/venv"
- code: "pip: name=flask virtualenv=/my_app/venv"
description: "Install I(Flask) (U(http://flask.pocoo.org/)) into the specified I(virtualenv)"
description: "Install I(Flask) (U(http://flask.pocoo.org/)) into the specified I(virtualenv), inheriting none of the globally installed modules"
- code: "pip: name=flask virtualenv=/my_app/venv virtualenv_site_packages=yes"
description: "Install I(Flask) (U(http://flask.pocoo.org/)) into the specified I(virtualenv), inheriting globally installed modules"
- code: "pip: requirements=/my_app/requirements.txt"
- code: "pip: requirements=/my_app/requirements.txt"
description: Install specified python requirements.
description: Install specified python requirements.
- code: "pip: requirements=/my_app/requirements.txt virtualenv=/my_app/venv"
- code: "pip: requirements=/my_app/requirements.txt virtualenv=/my_app/venv"
...
@@ -137,6 +148,7 @@ def main():
...
@@ -137,6 +148,7 @@ def main():
version
=
dict
(
default
=
None
,
required
=
False
),
version
=
dict
(
default
=
None
,
required
=
False
),
requirements
=
dict
(
default
=
None
,
required
=
False
),
requirements
=
dict
(
default
=
None
,
required
=
False
),
virtualenv
=
dict
(
default
=
None
,
required
=
False
),
virtualenv
=
dict
(
default
=
None
,
required
=
False
),
virtualenv_site_packages
=
dict
(
default
=
'no'
,
choices
=
BOOLEANS
),
use_mirrors
=
dict
(
default
=
'yes'
,
choices
=
BOOLEANS
),
use_mirrors
=
dict
(
default
=
'yes'
,
choices
=
BOOLEANS
),
extra_args
=
dict
(
default
=
None
,
required
=
False
),
extra_args
=
dict
(
default
=
None
,
required
=
False
),
),
),
...
@@ -164,7 +176,10 @@ def main():
...
@@ -164,7 +176,10 @@ def main():
if
env
:
if
env
:
virtualenv
=
module
.
get_bin_path
(
'virtualenv'
,
True
)
virtualenv
=
module
.
get_bin_path
(
'virtualenv'
,
True
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
env
,
'bin'
,
'activate'
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
env
,
'bin'
,
'activate'
)):
cmd
=
'
%
s
%
s'
%
(
virtualenv
,
env
)
if
module
.
boolean
(
module
.
params
[
'virtualenv_site_packages'
]):
cmd
=
'
%
s --system-site-packages
%
s'
%
(
virtualenv
,
env
)
else
:
cmd
=
'
%
s
%
s'
%
(
virtualenv
,
env
)
rc
,
out_venv
,
err_venv
=
module
.
run_command
(
cmd
)
rc
,
out_venv
,
err_venv
=
module
.
run_command
(
cmd
)
out
+=
out_venv
out
+=
out_venv
err
+=
err_venv
err
+=
err_venv
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment