1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
Commit graph

82 commits

Author SHA1 Message Date
Robert Collins 17352765f0 Issue #2478 - topological install order.
This is needed for setup-requires, since without it its possible
to cause installation to fail in sort-circuit scenarios such as
the added functional test case demonstrates.
2015-04-01 12:33:17 +13:00
Xavier Fernandez 8bff8b5411 PackageFinder._get_index_urls_locations only needs req_name
and InstallRequirement does not need its url_name property anymore
2015-03-27 17:31:05 +01:00
Donald Stufft 610db0c1fb Merge pull request #2587 from rbtcollins/develop
More refactoring of req_set
2015-03-23 22:36:59 -04:00
Robert Collins 9b40f0391a Factor out source_dir assignment for editables.
This is a small change to make prepare_file easier to read. It is slightly
complicated by the round-about way it was being assigned in non-editable cases.
2015-03-24 14:47:47 +13:00
Robert Collins 3e1d7a301c Docstring layout fix. 2015-03-24 14:46:23 +13:00
Robert Collins dd3afd20ec Cleanup link handling in req_set.
* Move the caching of find_requirement into find_requirement.

* Move the decision to set / not-set link into InstallRequirement.
2015-03-24 14:46:23 +13:00
Marc Abramowitz d02cb6de43 Speed up _filter_install function
This speeds up the _filter_install function that is used to filter the
output of `python setup.py install` when installing packages. It does
this by using a single regex which is pre-compiled and thus avoiding a
`for` loop over 15 different regexes.

Before:

    $ python
    Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import timeit
    >>> timeit.timeit("""_filter_install("if we've already set distribute as a conflict to setuptools blah blah blah blah")""", setup='from pip.req.req_install import InstallRequirement; ir = InstallRequirement("foo", None, None); _filter_install = ir._filter_install')
    21.220640897750854

After:

    $ python
    Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import timeit
    >>> timeit.timeit("""_filter_install("if we've already set distribute as a conflict to setuptools blah blah blah blah")""", setup='from pip.req.req_install import InstallRequirement; ir = InstallRequirement("foo", None, None); _filter_install = ir._filter_install')
    0.9454500675201416
2015-03-19 19:27:19 -07:00
Marc Abramowitz d04850659c Make get_dist handle egg_info_path w/ slash at end
Without this, I was getting:

    $ pip install -U 'sentry[lol]'
    ...
      UnknownExtra: Unknown 7.4.1 has no such extra feature 'lol'

With this, I get:

    $ pip install -U 'sentry[lol]'
    ...
      UnknownExtra: sentry 7.4.1 has no such extra feature 'lol'
2015-03-16 11:48:41 -07:00
Donald Stufft 18d92c4543 Merge pull request #2506 from xavfernandez/build_location
simplify and comment build_location/correct_build_location
2015-03-16 07:54:14 -04:00
Marc Abramowitz 0a08fa70dc InstallRequirement.__repr__ show editable
This is handy to have when debugging with pdb.
2015-03-13 15:06:58 -07:00
Xavier Fernandez 95996f08bc simplify and comment build_location/correct_build_location
- add a bunch of comments
- renamed correct_build_location to _correct_build_location
- use build_location inside of _correct_build_location to be consistent
  with the other build directories
2015-03-10 22:29:15 +01:00
Donald Stufft 8f69e31ee7 Merge pull request #2280 from xavfernandez/url_to_link
Replace InstallRequirement.url attribute by a link attribute
2015-03-06 18:04:38 -05:00
Marc Abramowitz 8689ae4b51 Add __repr__ to InstallRequirement
This makes it easier to inspect with pdb.

Instead of:

    (Pdb++) req_to_install
    <pip.req.req_install.InstallRequirement object at 0x10459f7d0>

we get the much friendlier:

    (Pdb++) req_to_install
    <InstallRequirement object: wheel==0.24.0 in /Users/marca/python/virtualenvs/pip/lib/python2.7/site-packages>
2015-03-06 07:58:34 -08:00
Xavier Fernandez 3fcf5972bc add is_wheel method to Link class 2015-03-05 11:04:41 +01:00
Xavier Fernandez e8e2566279 replace InstallRequirement.url by a link attribute 2015-03-05 11:01:28 +01:00
Xavier Fernandez 0cf2a49d98 Reset uninstall order as before c509c5c4ab
In the case of develop install where we have an egg-info directory and
an egg-link, make sure we uninstall it in the develop_egg_link if case.

Fix #2456
2015-02-25 14:11:50 +01:00
Donald Stufft 0bc8aa5622 Style fixes for the latest flake8 2015-02-24 07:46:10 -05:00
Alex Gaynor 62d07e8b4d Hide lines from the output about changing mode
These don't really add value for developers
2015-02-05 12:46:56 -08:00
Paul Moore 18748b3de6 Make pip.utils.rmtree retry in case antivirus etc holds a directory 2015-02-04 20:34:24 +00:00
Donald Stufft 80fedf7334 Deprecate uninstalling distutils installed projects 2015-01-30 19:22:35 -05:00
Xavier Fernandez d926c9e3b8 fix uninstall for distutils installed packages
fix #2384
2015-01-31 00:10:28 +01:00
Xavier Fernandez c509c5c4ab change uninstallation logic
check develop_egg_link case first and map distribution types based on
dist.egg_info attribute
close #2346 #2348 #2350
2015-01-15 09:48:10 +01:00
Xavier Fernandez a0cd939a12 On uninstall, match the egg case via its extension
instead of egg_name since they don't seem to be unambiguous
also add a debug log in case no uninstall case match
(it would have made the debugging much easier)

closes #2293
2015-01-14 14:07:14 +01:00
Donald Stufft 5f414a69c6 Don't return cached output for InstallRequirement().installed_version 2014-12-23 07:39:13 -05:00
Xavier Fernandez de7e9c5266 drop egg_info_lines
and use pkg_resources.Distribution instead
2014-12-19 19:12:20 +01:00
Xavier Fernandez 06da6c07ec Fix environment extras installation for sdist
use pkg_resources.Distribution.requires instead of
Requirements.requirements to have environment markers parsing for free
It also unifies a little the process for wheel and non-wheel installs

closes #2174
2014-12-19 19:12:20 +01:00
Xavier Fernandez 4ea7937264 parse_editable: clarify output
extras and editable_options are two different things
2014-12-19 19:11:14 +01:00
Xavier Fernandez 65c004dcb1 remove InstallRequirement.delete_marker_filename 2014-12-19 15:34:21 +01:00
Donald Stufft 5e717e809a Merge pull request #2206 from msabramo/make_installed_version_work_with_wheel
Make installed_version work for wheel
2014-12-17 22:35:20 -05:00
Marc Abramowitz 59d1ce1af7 Add test_installed_version_not_installed
Checks what happens when user tries to get `installed_version` property
for a InstallRequirement object when that distribution is not installed.
2014-12-17 15:23:42 -08:00
Xavier Fernandez cc445dcfb8 remove unused unpack arg from build_location 2014-12-17 22:40:03 +01:00
Marc Abramowitz 279c123928 Make installed_version work for wheel
by using `pkg_resources.get_distribution` instead of calling pkg_info
method. Wheels don't have a .pip-egg-info folder.

See: GH-2202
2014-12-16 19:12:48 -08:00
Marc Abramowitz 34b98f917e Loosen filter regexes slightly
to catch a few messages that slipped through when I was installing
docutils on Python 3.4:

    warning: no files found matching 'MANIFEST'
    warning: no previously-included files matching '.cvsignore' found under directory '*'
    Skipping implicit fixer: buffer

Before:

    $ pip install ~/src/docutils --upgrade
    Processing /Users/marca/src/docutils
        warning: no files found matching 'MANIFEST'
        warning: no previously-included files matching '.cvsignore' found under directory '*'
        warning: no previously-included files matching '*~' found under directory '*'
        warning: no previously-included files matching '.DS_Store' found under directory '*'
    Installing collected packages: docutils
      Found existing installation: docutils 0.13
        Uninstalling docutils:
          Successfully uninstalled docutils
      Running setup.py install for docutils
        Skipping implicit fixer: buffer
        Skipping implicit fixer: idioms
        Skipping implicit fixer: set_literal
        Skipping implicit fixer: ws_comma
      ...

After:

    $ pip install ~/src/docutils --upgrade
    Processing /Users/marca/src/docutils
    Installing collected packages: docutils
      Found existing installation: docutils 0.13
        Uninstalling docutils:
          Successfully uninstalled docutils
      Running setup.py install for docutils
      ...
2014-12-16 11:43:19 -08:00
Paul Moore 427b9fc9f1 Merge pull request #2191 from msabramo/filter_out_more_manifest_junk_when_installing
Make filter regex more inclusive
2014-12-15 18:56:46 +00:00
Marc Abramowitz 971d9c098f Make filter regex more inclusive
so that it filters out more "no previously-included..." warnings from
distutils while installing.

Before:

    $ pip install -e ~/dev/git-repos/pip
    Obtaining file:///Users/marca/dev/git-repos/pip
        warning: no previously-included files found matching '.coveragerc'
        warning: no previously-included files found matching '.mailmap'
        warning: no previously-included files found matching '.travis.yml'
        warning: no previously-included files found matching 'pip/_vendor/Makefile'
        warning: no previously-included files found matching 'tox.ini'
        no previously-included directories found matching '.travis'
        no previously-included directories found matching 'docs/_build'
        no previously-included directories found matching 'contrib'
        no previously-included directories found matching 'tasks'
        no previously-included directories found matching 'tests'
    Installing collected packages: pip
      Running setup.py develop for pip
        warning: no previously-included files found matching '.coveragerc'
        warning: no previously-included files found matching '.mailmap'
        warning: no previously-included files found matching '.travis.yml'
        warning: no previously-included files found matching 'pip/_vendor/Makefile'
        warning: no previously-included files found matching 'tox.ini'
        no previously-included directories found matching '.travis'
        no previously-included directories found matching 'docs/_build'
        no previously-included directories found matching 'contrib'
        no previously-included directories found matching 'tasks'
        no previously-included directories found matching 'tests'
    ...

After:

    $ pip install -e ~/dev/git-repos/pip
    Obtaining file:///Users/marca/dev/git-repos/pip
    Installing collected packages: pip
      Running setup.py develop for pip
    ...
2014-12-15 09:55:07 -08:00
Donald Stufft 6f64d3e6e2 Implement PEP 440 2014-12-13 13:50:21 -05:00
Donald Stufft 33eba11761 Merge pull request #2178 from msabramo/pip_install_make_some_warnings_debug
install: Make some warnings DEBUG rather than INFO
2014-12-12 16:48:38 -05:00
Marc Abramowitz a3842b2a82 install: Make some warnings DEBUG rather than INFO
* `warning: no previously-included files matching`
* `warning: no files found matching`

See: GH-1070
2014-12-12 11:52:56 -08:00
Marc Abramowitz 7eb00c97ea "Running setup.py...egg_info" log: INFO => DEBUG
Change log level of `"Running setup.py (path:%s) egg_info"` log messages
from INFO to DEBUG. The average user does not know or care that pip is
running `python setup.py egg_info`, unless things are broken, IMHO.

See: GH-1070
2014-12-12 11:37:08 -08:00
Donald Stufft 5b817f960b --isolated should isolate from ~/.pydistutils.cfg as well 2014-12-11 11:51:06 -05:00
Victor Stinner e498d83db1 Support markers in requirements
It's now possible to specify requirements markers in requirements.
Examples::

    futures; python_version < '2.7'
    mock; python_version < '3.3'
    nose
    ordereddict; python_version < '2.7'
    unittest2; python_version < '2.7'

The separator is "; ". For convinience, ";" alone is also supported, but
no in URLs. The ";" character is a legit and common character in an URL.
Example of valid URL without markers::

    http://foo.com/?p=bar.git;a=snapshot;h=v0.1;sf=tgz

Example of URL with markers::

    http://foo.com/?p=bar.git;a=snapshot;h=v0.1;sf=tgz; python_version < '3.3'
2014-11-20 10:52:08 -05:00
Victor Stinner e236842944 Fix issue #1433: parse requirements in markers
* InstallRequirement supports PEP 426 markers
* RequirementSet.add_requirement() ignores an InstallRequirement if
  markers don't match.
2014-11-20 10:52:08 -05:00
Xavier Fernandez b713e96df2 cleanup: use "with open()" to open files 2014-10-18 20:41:18 +02:00
Toshio Kuratomi 9f9a07a447 Better detection of egg-info dirs 2014-10-06 03:21:52 -04:00
Toshio Kuratomi 416ca84bdf Record files don't always include directories so find eggdir by looking for a file within it.
Fixes #2075
2014-09-29 13:51:01 -04:00
Donald Stufft 17448b92d0 InstallRequirement.absolute_versions is no longer required. 2014-09-25 22:15:43 -04:00
Donald Stufft cc2a44e995 Normalize names in a URL
PyPI and Bandersnatch now normalize the project name in their
URLs. This change matches that and will reduce the number of
redirects we hit on PyPI and will reduce the need to hit /simple/
on a Bandersnatch mirror.
2014-09-18 07:11:31 -04:00
Donald Stufft ec91d8e421 Move from pip.compat.* to six.moves.* for urllib related stuff 2014-09-11 18:40:45 -04:00
Donald Stufft 767d11e49c Switch to using the stdlib logger instead of pip.log 2014-09-10 09:36:09 -04:00
Donald Stufft 89fc318113 Merge pull request #1897 from paweljasinski/ironpython
detect windows when running under IronPython
2014-08-30 13:48:45 -04:00