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

79 commits

Author SHA1 Message Date
Robert Collins c30af314cc Consolidate upgrade logic somewhat.
We had several overly-scope variables in prepare_files which weren't needed.

install is fully modelled by satisfied_by, if we move some logic into the right
guarded conditions, which this does.

not_found was already obsolete.

best_installed really only needed to exist and be checked within the
index-consulting upgrade block.
2015-03-24 14:46:23 +13:00
Robert Collins 7054a3d18e Note about possible cleanup of download_dir and wheel_download_dir. 2015-03-24 14:46:23 +13:00
Robert Collins 23e55948f8 Don't log about extras when ignoring dependencies.
It makes no sense to say we're doing something we're not.
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
Robert Collins 3ed5cf646a Remove excess use of link.
link is assigned in all branches, and then all the checks for it being
set are guarded by a outer if clause.
2015-03-20 10:04:49 +13:00
Robert Collins 11e2c5e99e Constant-fold unpack in prepare_files.
We had this structure widely spread out:
unpack = True
if link:
  if thing:
    raise
  else:
    stuff
else:
  unpack = False
if unpack:
  stuff2

First transform was:
if link:
  if thing:
    raise
  stuff
  unpack = True
else:
  unpack = False
if unpack:
  stuff2

Which made it obvious that we didn't need unpack:
if link:
  if thing:
    raise
  stuff
  stuff2
2015-03-19 18:23:26 +13:00
Robert Collins e7b644f9c1 Introduce an abstraction over the various dists we have.
This may grow, or be subsumed into someting else in time.
2015-03-19 17:05:02 +13:00
Robert Collins 4c57c0290c Minor cleanups in req_set.
- reduce the scope for some variables
 - stop accessing private member of req_to_install
   the cleanup code is idempotent and safe to call multiple times,
   so we only need to decide *if* we want to cleanup, not whether
   the requirement needs it done.
2015-03-19 16:07:47 +13:00
Robert Collins ff33e17046 Document locate_files removal plan. 2015-03-19 15:05:22 +13:00
Robert Collins d42030e6cb Separate out find/prepare loop from mutable state.
To fix the code duplication we need to be able to iterate without mutating the
loop variables inside the inner code. This prepares for removing the code
duplication.
2015-03-19 14:21:53 +13:00
Donald Stufft 34073df838 Merge pull request #2493 from msabramo/issue-770-redux
Fix for #770: pip install -U shouldn't look at pypi if not needed
2015-03-17 07:26:34 -04:00
Marc Abramowitz 94fcd18ed4 Fix for #770: pip install -U shouldn't look at pypi if not needed
If an exact version is specified for install, and that version is
already installed, then there is no point going to pypi as no install
is needed.

Adds a test called
`test_upgrade_no_look_at_pypi_if_exact_version_installed`.

This is a rework of PR #771, because that PR is old and has merge
conflicts that were easier to fix by applying the changes manually.
2015-03-16 22:30:13 -07:00
Donald Stufft a2b89e2758 Merge pull request #2507 from xavfernandez/simplify_prepare_files
simplify (a little) prepare_files
2015-03-16 07:49:32 -04:00
Donald Stufft cccefe1cc9 Merge pull request #2142 from derwolfe/extras-user-warn-2138
warn user when requested extra does not exist - 2138
2015-03-16 07:44:33 -04:00
derwolfe 3a1a45af0d make splitting of lines/endings consistent /sigmavirus24 2015-03-10 20:02:09 -05:00
Xavier Fernandez 512033ad93 simplify (a little) prepare_files 2015-03-09 10:43:23 +01: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
derwolfe 4dfbd2e01c spacing, sort sets prior to pushing into logger, dist.requires 2015-02-26 12:11:04 -06:00
derwolfe 704223dff5 remove assignement
iterate directly over the results of the function calls
2015-02-26 06:50:56 -06:00
derwolfe 86e3300f3b switch to using a tuple wrapping a generator 2015-02-25 17:27:34 -06:00
Chris Wolfe 8d0cd56637 make _missing_extras and _available_extras staticmethods 2015-02-25 08:49:06 -06:00
derwolfe d3e207ede4 add unit tests for missing and available functions 2015-02-25 07:48:12 -06:00
derwolfe cb1962ef54 shorten line 2015-02-24 20:34:42 -06:00
derwolfe 2e30c4732d Cleanup the functional tests, return a tuple instead of list. 2015-02-24 20:30:11 -06:00
derwolfe c5d331bba1 warning showing correctly 2015-02-24 07:14:19 -06:00
Donald Stufft 0bc8aa5622 Style fixes for the latest flake8 2015-02-24 07:46:10 -05:00
derwolfe 6c5edf59a1 fix indentation 2015-02-23 22:14:33 -06:00
derwolfe db50fe6be6 naming and return type 2015-02-23 22:12:10 -06:00
derwolfe 82668636a2 find missing packages first 2015-02-23 22:05:16 -06:00
derwolfe b07918497b trying to tease out dist and requires information 2015-02-23 18:25:35 -06:00
derwolfe 89bff4a4df Merge branch 'develop' into extras-user-warn-2138 2015-02-21 17:07:47 -06:00
derwolfe 53f3346aac phrasing 2014-12-30 19:42:43 -06:00
derwolfe fec9f4fde9 working on adding tests. It looks like the case of multiple extras not exisiting isn't handled 2014-12-30 19:41:11 -06:00
derwolfe 91f80102dd logging working a bit better
Need to access the extras defined on the distribution itself. This way I could just check for membership in the set of extras defined, and throw an error for each, instead of stopping entirely.
2014-12-30 19:30:40 -06:00
derwolfe deabed5d89 log an error when an extra is requested that doesn't exist 2014-12-30 18:35:15 -06:00
Donald Stufft 62d71fca60 Check if distribute is installed before checking installed version 2014-12-30 15:11:55 -05:00
Xavier Fernandez 1921ad1611 switch extra requirements log to debug 2014-12-19 19:13:04 +01: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 cc445dcfb8 remove unused unpack arg from build_location 2014-12-17 22:40:03 +01:00
Xavier Fernandez 92b8608529 simpler RequirementSet.cleanup_files 2014-12-17 14:02:04 +01:00
Xavier Fernandez 883a9cf227 remove unused code 2014-12-15 23:59:21 +01:00
Paul Moore 00ec8e636c Merge pull request #2188 from msabramo/GH-2187_dont_say_unpacking_for_directory
Don't say "Unpacking" if installing from directory
2014-12-15 21:58:59 +00:00
Marc Abramowitz 7711b934f7 Don't say "Unpacking" if installing from directory
Fixes: GH-2187
2014-12-15 10:11:36 -08:00
Donald Stufft 8e11f76171 Merge pull request #2185 from msabramo/GH-376_change_downloading_unpacking_msg_to_collecting
Change "Downloading/unpacking" to "Collecting"
2014-12-14 14:50:43 -05:00
Marc Abramowitz b16d283d69 Change "Downloading/unpacking" to "Collecting"
"Downloading/unpacking" was misleading and confusing, especially when
the package is never found, as nothing was ever downloaded or unpacked
in this case.

The word "collecting" seems general enough to be accurate and it goes
well with the fact that later on pip will say, "Installing collected
packages".

Fixes: GH-376
2014-12-14 00:06:08 -08:00
Donald Stufft 6f64d3e6e2 Implement PEP 440 2014-12-13 13:50:21 -05:00
Marc Abramowitz 86c714deb1 install: "Cleaning up..." msg: info => debug
This message isn't particularly useful to an end user and clutters the
output IMHO.
2014-12-12 09:02:23 -08:00
Donald Stufft 5b817f960b --isolated should isolate from ~/.pydistutils.cfg as well 2014-12-11 11:51:06 -05:00