Commit Graph

67 Commits (f536944e3ab31af18c9eff7b24731e3236e9236e)

Author SHA1 Message Date
AndyG e5664c45a5 Update pip.py (#47568)
adding the option to install pip modules via  proxy, as per https://github.com/ansible/ansible/issues/36333#issuecomment-366374083
2018-10-25 15:29:01 -04:00
Zhikang Zhang b697da39c8 Fix problem where pip module cannot accept multiple extras
PR #46937
Fixes #46519
2018-10-22 22:21:45 +02:00
Zhikang Zhang 501503f4cb
Allow version specifiers for pip install (#41792)
Allow version specifiers for pip install.
2018-08-17 11:46:53 -04:00
Till Maas bb85bbceeb pip: combine chdir and env only when env is set (#40793)
* pip: combine chdir and env only when env is set

This fixes an AttributeError when chdir without virtualenv is specified:

 File "/tmp/ansible_2UAFsZ/ansible_module_pip.py", line 387, in main
    env = os.path.join(chdir, env)
 File "/usr/lib64/python2.7/posixpath.py", line 75, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

* Add test for pip with chdir

Signed-off-by: Till Maas <opensource@till.name>
2018-08-13 19:59:01 +02:00
Arnaud Venturi 130824c3e1 Correct a typo in pip module error message (#43784) 2018-08-07 19:53:19 +02:00
Kevin Mooney 7a0c28cc37 Put umask value in quotation marks (#41409)
The given example causes the pip module to fail. If the umask is given as an octal string without quotation marks, the pip module converts it into an integer (i.e., an invalid umask). 

+label: docsite_pr
2018-07-13 10:35:23 -04:00
David Moreau Simard 89a9fb79da Add RETURN docs for the pip module (#39907)
The pip module returns some things. Let's document them.
2018-06-19 13:34:14 -04:00
David Moreau Simard 828e33f419 Do not consider an empty version string as a version (#41044)
When using an empty string as the version argument, the module would
before attempt to run something akin to:

    pip install module==""

This changes the behavior to:

    pip install module

Fixes #41043
2018-06-06 09:52:43 +02:00
Robin Roth d6e711b1de Allow empty list of names in pip module (#38789)
pip 10 gives exit code 1 for empty argument lists (pip < 10 gave exit 0)
see also https://github.com/pypa/pip/pull/4210

To still allow playbooks to pass when giving empty lists, don't call
pip in that case, but show a warning.
2018-05-14 14:51:10 +02:00
Robin Roth 42953c40ce Pip: Make main method smaller (#38788) 2018-05-14 14:49:41 +02:00
Lujeni 91ab88dac7 pip: Use chdir directive in the venv path (fixes #25122) (#26865) 2017-10-13 12:39:47 +02:00
Pilou 1c9bffe248 pip module: fix TypeError (#31395)
* pip: add test: an error occurs when pip not found
* pip: fix TypeError exception when pip executable isn't found
2017-10-09 10:01:21 -07:00
Dag Wieers 1241d0a3f4 pip: PEP8 compliancy and doc fixes
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-10-02 16:18:56 -04:00
Nicklaus McClendon 6dbc3c63f8 Updated pip module to always return changed if venv is created (#24233)
* Updated pip module to always return changed if venv is created

Fixes #23204

* Add integration test to pip (see #23204)
2017-09-12 10:01:29 -07:00
Toshio Kuratomi f203ca7907 Update metadata to 1.1 2017-08-15 23:12:08 -07:00
Toshio Kuratomi 47b534d809 Move more modules out of curated
pip to core because users frequently use pip to install packages to run
ansible modules.

win_chocolatey to community as it still needs some work before we'd be
ready to include it in core support.
2017-08-14 10:58:15 -07:00
Rob Nieuwenhuizen 73e19c2ed1 Add support for pip list format=columns (#21990)
* Use 'pip list --format=freeze' to simplify output code parse
2017-08-07 23:56:04 -07:00
Toshio Kuratomi 4109a82d0a remove wildcards and add boilerplate
* cloud/centurylink
* source_control
* cloud/google
* notification
* cloud/rackspace
* cloud/vmware
2017-07-29 14:13:30 -07:00
apmits 033a68d453 pip: Add example for --user (#26856)
* state type of arguments explicitly

* add example for --user argument
2017-07-17 08:17:06 +02:00
Lujeni 661791dcb7 Fix the editable condition into pip module (#19028) (#19688)
* Fix the editable condition into pip module (#19028)

* Add editable to tests

Default changed to False, so now editable: True is needed explicitly in
tests
2017-07-14 10:54:04 +01:00
Ramon bc4a8dbaa4 fix proposal for issue #25151: [python3] pip failed to create virtual env when using custom command (pyvenv) (#25241)
* Fix proposal for bug 25151

* Fix proposal for bug 25151 - pip module, pyvenv validation

* Graceful fail when virtualenv_python is defined and virtualenv_command uses the venv module

* Making sure that venv is being used as a modue "-m venv"

* Updating syntax in validations

* Updating syntax in validations - fixing stupid typo "[)"

* Raising an error if virtualenv_command is pyvenv or venv and virtualenv_python is used

* trailing whitespace gone, pyvenv, venv validation and docs update

* cleaning whitespaces from blank lines
2017-06-05 17:03:15 -07:00
Tim Rupp e27b4c2ae4 Removes expanduser in favor of type path
Removes the usage of expanduser in favor of the type 'path' for
module options. Related to #12263
2017-03-31 00:24:38 -04:00
Toshio Kuratomi eb1214baad New metadata 1.0 (#22587)
Changes to the metadata format were approved here:
https://github.com/ansible/proposals/issues/54
* Update documentation to the new metadata format
* Changes to metadata-tool to account for new metadata
  * Add GPL license header
  * Add upgrade subcommand to upgrade metadata version
  * Change default metadata to the new format
  * Fix exclusion of non-modules from the metadata report
* Fix ansible-doc for new module metadata
* Exclude metadata version from ansible-doc output
* Fix website docs generation for the new metadata
* Update metadata schema in valiate-modules test
* Update the metadata in all modules to the new version
2017-03-14 09:07:22 -07:00
Matt Clay 4554e8d769 Remove unnecessary shebangs and execute bits. 2017-02-22 18:13:46 -08:00
Vladimir Rutsky 18c86bc814 pip: fix example with egg specification (#20371)
pip: fix example with egg specification
2017-01-18 12:40:51 +00:00
Toshio Kuratomi 7319104552 Refreshed metadata for core modules 2016-12-08 11:25:35 -05:00
Fabio Alessandro Locati 8ae7d2dcc4 Unquote urls in YAML - packaging (#5793) 2016-12-08 11:25:34 -05:00
Sam Doran 2bb5ab9776 Change example syntax on pip module 2016-12-08 11:25:30 -05:00
Toshio Kuratomi 0d74ae3368 Need to locate a pip inside a venv when venv is specified
Alternative to #5359

Fixes #5347
2016-12-08 11:25:24 -05:00
Toshio Kuratomi ff6bac126e On Ubuntu16, virtualenv always tries to use python2 even when python2 is not installed.
Workaround that by mimicing the upstream virtualenv behaviour in code
(use the python version that was used to invoke virtualenv/the ansible
module)
2016-12-08 11:25:22 -05:00
Michael Scherer 9e3058c323 Make pip module use pip3 on python 3 2016-12-08 11:25:21 -05:00
Toshio Kuratomi 77975c232b Fix pip freeze workaround with virtualenv (#4951) 2016-12-08 11:25:12 -05:00
Toshio Kuratomi a8fbdcd80d pip list isn't available on pip less than 1.3 so make a fallback (#4947) 2016-12-08 11:25:12 -05:00
Toshio Kuratomi e2963c0e25 Fix parsing of pip output 2016-12-08 11:25:12 -05:00
Rob Cutmore 15b41d2718 Pip: use 'pip list' when available for package list (#4644)
* Pip: handle parsing different pip commands

* Pip: use 'pip list' when available

* Pip: explicitly check which command is used

* Pip: add error checking when fetching packages
2016-12-08 11:25:11 -05:00
Toshio Kuratomi 5bd9cdad5a We've decided that pythn 3.5 is the minimum python3 version (#4572) 2016-12-08 11:24:57 -05:00
Evan 7b66bdc1c4 pip: Fix uninitialized variable during check_mode (#4379)
During check_mode (`--check`), the variable change could be
used uninitialized, yielding this error:

`UnboundLocalError: local variable 'changed' referenced before assignment`

This changeset simply initializes it to False.
2016-12-08 11:24:49 -05:00
Brian Coca ad996f162b name was the issue, not pkg 2016-12-08 11:24:41 -05:00
Brian Coca d8e91f01b0 protect another portion against None name 2016-12-08 11:24:41 -05:00
Brian Coca 506e6ff2e2 another fix for None in name 2016-12-08 11:24:41 -05:00
Brian Coca c871f488eb avoid traceback when name is None 2016-12-08 11:24:41 -05:00
Brian Coca f874c29dff allow pip to take a list of names (#4056)
also simplified argspec by removing defaults
2016-12-08 11:24:41 -05:00
james-prior 68b9c2ffa7 Make explicit that virtualenv is created if needed for pip module. (#3731)
packaging/language/pip.py:
    virtualenv option:
        Mention that virtualenv is created if it does not exist.
            (Explicit is better than implicit.)
        Mention other relevant options.
    notes:
        initialized -> created
    Wrap long lines.
2016-12-08 11:24:31 -05:00
Raphaël Dubigny 71c50aed24 typo in pip module 2016-12-08 11:24:13 -05:00
Matt Martz b4bab770f6 pip module should call exit_json for absent as well (indentation error) 2016-12-08 11:24:10 -05:00
Stefano Mazzucco 04e9677ae0 'executable' and 'virtualenv' mutually exclusive
fixes https://github.com/ansible/ansible/issues/14415
2016-12-08 11:24:09 -05:00
Joel Thompson d8d8d7da64 Add umask option to pip module
On systems with restrictive umasks, the pip module won't allow you to
install pip packages that are usable by everyone on the system. This
commit adds a umask option to optionally override the umask on a
per-package basis.
2016-12-08 11:24:02 -05:00
Brian Coca e2062c44d9 made note about choice availability in ansible ver 2016-12-08 11:23:57 -05:00
Michael Scherer d321670b38 Add more precise documentation on the requirements parameter
Fix #427
2016-12-08 11:23:55 -05:00
stephane 40e7ed9518 Add support for pip force-reinstall
The pip command allows a user to force reinstallation,
but the module doesn't currently support it. Add
"force-reinstall" as a possible state.
2016-12-08 11:23:54 -05:00