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
14aa5417
Commit
14aa5417
authored
May 19, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2955 from jarv/devel
pip module blowing up when name is not included in arg list
parents
7dfb29f8
daf4c358
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
library/packaging/pip
+19
-20
No files found.
library/packaging/pip
View file @
14aa5417
...
...
@@ -20,6 +20,7 @@
#
import
tempfile
import
os
DOCUMENTATION
=
'''
---
...
...
@@ -184,22 +185,6 @@ def main():
if
state
==
'latest'
and
version
is
not
None
:
module
.
fail_json
(
msg
=
'version is incompatible with state=latest'
)
# pip can accept a path to a local project or a VCS url beginning
# with svn+, git+, hg+, or bz+ and these sources usually do not qualify
# --use-mirrors. Furthermore, the -e option is applied only when
# source is a VCS url. Therefore, we will have branch cases for each
# type of sources.
#
# is_vcs includes those begin with svn+, git+, hg+ or bzr+
# is_tar ends with .zip, .tar.gz, or .tar.bz2
is_vcs
=
False
is_tar
=
False
if
name
.
endswith
(
'.tar.gz'
)
or
name
.
endswith
(
'.tar.bz2'
)
or
name
.
endswith
(
'.zip'
):
is_tar
=
True
elif
name
.
startswith
(
'svn+'
)
or
name
.
startswith
(
'git+'
)
or
\
name
.
startswith
(
'hg+'
)
or
name
.
startswith
(
'bzr+'
):
is_vcs
=
True
err
=
''
out
=
''
...
...
@@ -226,7 +211,24 @@ def main():
cmd
=
'
%
s
%
s'
%
(
pip
,
state_map
[
state
])
if
extra_args
:
cmd
+=
'
%
s'
%
extra_args
if
name
:
# pip can accept a path to a local project or a VCS url beginning
# with svn+, git+, hg+, or bz+ and these sources usually do not qualify
# --use-mirrors. Furthermore, the -e option is applied only when
# source is a VCS url. Therefore, we will have branch cases for each
# type of sources.
#
# is_vcs includes those begin with svn+, git+, hg+ or bzr+
# is_tar ends with .zip, .tar.gz, or .tar.bz2
is_vcs
=
False
is_tar
=
False
if
name
.
endswith
(
'.tar.gz'
)
or
name
.
endswith
(
'.tar.bz2'
)
or
name
.
endswith
(
'.zip'
):
is_tar
=
True
elif
name
.
startswith
(
'svn+'
)
or
name
.
startswith
(
'git+'
)
or
\
name
.
startswith
(
'hg+'
)
or
name
.
startswith
(
'bzr+'
):
is_vcs
=
True
# If is_vcs=True, we must add -e option (we assume users won't add that to extra_args).
if
is_vcs
:
args_list
=
[]
# used if extra_args is not used at all
...
...
@@ -240,9 +242,6 @@ def main():
is_package
=
is_vcs
or
is_tar
# just a shortcut for bool
if
not
is_package
and
state
!=
'absent'
and
use_mirrors
:
cmd
+=
' --use-mirrors'
if
extra_args
:
cmd
+=
'
%
s'
%
extra_args
if
name
:
cmd
+=
'
%
s'
%
_get_full_name
(
name
,
version
)
elif
requirements
:
cmd
+=
' -r
%
s'
%
requirements
...
...
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