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

1951 commits

Author SHA1 Message Date
Xavier Fernandez
f1bf7515c2 pip.index: remove INSTALLED_VERSION
closes #703
2015-11-04 22:52:44 +01:00
Donald Stufft
0e240d7dde Force the --python-tag when autobuilding wheels
A lot of existing tarballs will successfully build a wheel, but the
wheel will be implicitly broken because they will have dynamically
adjusted the install_requires inside of their setup.py. Typically
this is done for things like Python version, implementation, or what
OS this is being installed on. We don't consider cache directories
to be OS agnostic but we do consider them to be Python version and
implementation agnostic. To solve this, we'll force the cached
wheel to use a more specific Python tag that includes the major
version and the implementation.
2015-11-04 08:52:28 -05:00
Xavier Fernandez
0cc9d733bf Fix traceback.format_exc call
format_exc takes only one argument, limit which should be an integer.
python 2 seems more lenient than python 3 on that point.

mistake introduced in commit 3148b967a
2015-10-24 00:46:44 +02:00
Xavier Fernandez
f23cbb707f Merge pull request #3179 from cloudnull/fix/req_constraint
Resolves result obj in req_constraints
2015-10-23 18:04:54 +02:00
Kevin Carter
6c50ea5781
Fix to ensure "result" object is defined
The changes resolves a condition that can lead to a stacktrace due to the
use of constraint files. There are several conditions where the result
object may be left undefined which causes the problems.

``` traceback
  Exception:
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 211, in main
      status = self.run(options, args)
    File "/usr/local/lib/python2.7/dist-packages/pip/commands/wheel.py", line 180, in run
      wheel_cache
    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 266, in populate_requirement_set
      requirement_set.add_requirement(req)
    File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 267, in add_requirement
      return result
  UnboundLocalError: local variable 'result' referenced before assignment
```

This change simply ensures that the 'result' object is a defined
when the method returns.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-10-23 10:20:06 -05:00
Xavier Fernandez
fa91e3dcf4 Use get_installed_version and traceback 2015-10-22 23:15:06 +02:00
Xavier Fernandez
89a27cd740 Special-case based on exception message 2015-10-22 23:15:02 +02:00
Erik Rose
f38fc903f2 Obey --require-hashes option in requirements files.
Removed the mention of "package index options" in the docs, because they don't all fit that category anymore. Not even --no-binary and --only-binary do; they're "install options".
2015-10-21 16:02:47 -04:00
Erik Rose
3af5ffa5ce Improve flow of --require-hashes help message. 2015-10-19 23:40:01 -04:00
Erik Rose
622b430491 Typos and docstrings 2015-10-19 23:40:00 -04:00
Erik Rose
925e4b4466 Fix false hash mismatches when installing a package that has a cached wheel.
This would occur when, for example, installing from a requirements file that references a certain hashed sdist, a common situation.

As of pip 7, pip always tries to build a wheel for each requirement (if one wasn't provided directly) and installs from that. The way this was implemented, InstallRequirement.link pointed to the cached wheel, which obviously had a different hash than the index-sourced archive, so spurious mismatch errors would result.

Now we no longer read from the wheel cache in hash-checking mode.

Make populate_link(), rather than the `link` setter, responsible for mapping InstallRequirement.link to a cached wheel. populate_link() isn't called until until prepare_files(). At that point, when we've examined all InstallRequirements and their potential --hash options, we know whether we should be requiring hashes and thus whether to use the wheel cache at all.

The only place that sets InstallRequirement.link other than InstallRequirement itself is pip.wheel, which does so long after hashes have been checked, when it's unpacking the wheel it just built, so it won't cause spurious hash mismatches.
2015-10-19 23:40:00 -04:00
Xavier Fernandez
8cbb8af466 Report import setuptools error to the user
closes #2931
2015-10-19 16:43:01 +02:00
Nate Coraor
63d239ffac 1. Provide a fallback mechanism for determining ABI flags if config vars
are unavailable, but issue a warning if this is used.
2. Explicitly handle the case where the unicode detection finds wide
   unicode but this is a 3.3+ build (necessary due to #1)
3. Fix tests broken due to #2.
2015-10-13 15:58:03 -04:00
Nate Coraor
a55fa5a17e Setting the u ABI flag based on sys.maxunicode is incorrect on recent
Pythons with PEP 393 Flexible String Representation (so >= 3.3).
Granted, on these Pythons, the SOABI config var should always be set,
but the manual SOABI code path should still try to do the right thing.
2015-10-13 10:38:07 -04:00
Nate Coraor
62e265e8b4 Use the WITH_PYMALLOC and Py_DEBUG config vars for setting the m and d ABI
flags.
2015-10-13 10:38:07 -04:00
Nate Coraor
a70e1dd544 Fix unit tests I broke:
- Catch IOError wherever sysconfig is used (#1074)
- Reapply #2915

Also, be sure to normalize the SOABI
2015-10-13 10:38:07 -04:00
Nate Coraor
0b9afeaca4 SOABI support for Python 2.X and PyPy
Additionally, fix the version portion of the Python tag on wheels built
with PyPy that use the Python API. It will now be the Python major
version concatenated with the PyPy major and minor versions.

Fixes #2671, #2882.
2015-10-13 10:38:07 -04:00
Erik Rose
e23f59673e Consolidate hash constants in pip.utils.hashing. 2015-10-12 16:29:08 -04:00
Erik Rose
7c5e5039ad Remove unneeded triple quotes. 2015-10-12 16:15:31 -04:00
Erik Rose
dcf39bfdf0 Add imports to make the pep8 checker happy about the dead _copy_dist_from_dir(). 2015-10-12 14:49:11 -04:00
Erik Rose
4c405a0ad3 Restore deleted _copy_dist_from_dir().
This reverts commit 62ac258e1e.

https://github.com/pypa/pip/pull/3176 is about to add the missing piece that makes this code useful (and not dead), so let's not delete it.
2015-10-12 14:37:03 -04:00
Erik Rose
9e5e34e9f7 Add --algorithm flag to pip hash. 2015-10-12 14:05:10 -04:00
Erik Rose
be6dccb034 Factor up the idiom of reading chunks from a file until EOF. 2015-10-12 13:07:53 -04:00
Erik Rose
d541304354 Allow === as a pinning operator.
https://www.python.org/dev/peps/pep-0440/#arbitrary-equality
2015-10-11 10:14:30 -04:00
Erik Rose
05b7ef9467 Rename "goods" to "allowed" for clarity.
Renaming "gots" didn't go well. I think the current naming is the most concise way to put it. If we rename it to "got", then the loop iterator can't be called "got", and the simple relationship between the iterator and collection names is lost. "Actual" and "actuals" are the other names that occurred to me, but they look so much like "allowed" that the code becomes harder to read.
2015-10-11 09:17:27 -04:00
Erik Rose
304c90aa46 Break after initial """ in multi-paragraph docstrings in exceptions module. 2015-10-10 22:44:13 -04:00
Erik Rose
be4e315c59 Rewrap args of unpack_http_url() to match the style in send(), above. 2015-10-10 22:44:13 -04:00
Erik Rose
b95599a944 Change _good_hashes() to a whitelist.
This guards against the possibility of a weaker hash being added to hashlib in the future. Also give _good_hashes() a more descriptive name, and describe what we mean by "strong".

We can get away with returning a static list because those algorithms are guaranteed present in hashlib.
2015-10-10 22:44:12 -04:00
Erik Rose
52111c1397 Demote package-is-already-installed log message to debug-level.
An info-level message for each package might be too intense. And it might give a false sense of security as well: it doesn't confirm that the virtualenv is non-empty; it merely notices when a package we're installing is already there.
2015-10-10 22:44:12 -04:00
Erik Rose
6f828c351f Correct and clarify docs and comments. 2015-10-10 22:44:12 -04:00
Erik Rose
0e6058bc63 Change head() method to an attr in hashing exceptions. Tweak English.
Standardize on present tense, improve flow, and clarify.
2015-10-10 22:44:12 -04:00
Marcus Smith
13d43e3af8 Merge pull request #3170 from qwcode/req_line_numbers2
update for processing continuations/comments for req files
2015-10-09 07:48:28 -07:00
Marcus Smith
b58d2c9f34 process line continuations first (but with some special handling for comments) 2015-10-08 15:25:51 -07:00
Donald Stufft
9b29884fe9 Merge pull request #3066 from mattrobenolt/update-2
Only update VCS when things have actually changed
2015-10-08 16:26:18 -04:00
Erik Rose
7a0a97c081 Merge 'develop' into 'hashing' to bring the latter up to date. 2015-10-08 13:37:19 -04:00
Erik Rose
09008bf190 Add pip hash command. 2015-10-08 00:36:03 -04:00
Erik Rose
c62cd71f0f Add --require-hashes option to pip download and pip wheel.
Those commands already checked hashes, since they use RequirementSet, where the hash-checking is done.

Reorder some options so pre, no-clean, and require-hashes are always in the same order.
2015-10-07 17:33:57 -04:00
Xavier Fernandez
6aab626e7d Merge pull request #3153 from xavfernandez/error_project_name_mismatch
Abort installation on metadata mismatch
2015-10-05 23:54:09 +02:00
Donald Stufft
9c543b21c6 Prefer a newer SDK over an older SDK 2015-10-05 14:53:14 -04:00
Donald Stufft
ea5459294d prefer fat64 wheels over fat32 wheels 2015-10-05 14:52:53 -04:00
Donald Stufft
005e4a4fa6 fat32 not fat3 2015-10-05 14:52:19 -04:00
Marcus Smith
03de1c0072 Merge remote-tracking branch 'pypa/develop' into req_line_numbers 2015-10-03 20:44:21 -07:00
Marcus Smith
615adf9468 Merge remote-tracking branch 'pypa/develop' into issue_3011
Conflicts:
	CHANGES.txt
2015-10-03 10:21:15 -07:00
Marcus Smith
5f3437bd0f normcase the path tail for uninstall items 2015-10-03 10:13:00 -07:00
Marcus Smith
0d8933ced6 normalize the head to resolve parent directory symlinks, but not the tail 2015-10-03 09:17:26 -07:00
Xavier Fernandez
1a012bb63b Abort installation on metadata mismatch
If setup.py egg_info produces metadata for a different project name than
self.req.project_name, abort the installation.
Fixes #3143
2015-10-01 23:40:27 +02:00
Donald Stufft
b11cb019a4 Drop support for Python 3.2 2015-10-01 09:36:16 -04:00
Matt Iversen
f66d95ea89 Merge pull request #3122 from Ivoz/distinfo-entrypoints
Show entry points for dist-info installed packages
2015-10-01 02:01:14 +10:00
Xavier Fernandez
fe28652e63 Merge pull request #3136 from rouge8/fix-py26-home-slash
Fix user directory expansion when HOME=/
2015-09-29 22:18:24 +02:00
Andy Freeland
73a439ea66 Add pip.compat.expanduser to workaround http://bugs.python.org/issue14768 2015-09-29 16:01:32 -04:00
Andy Freeland
fac2891abb Fix user directory expansion when HOME=/
On versions of CPython affected by <http://bugs.python.org/issue14768>
(Python 2.6, some versions of Python 2.7 and 3.3),
`os.path.expanduser('~/path')` returns `//path` rather than `/path` when
`HOME=/`. This affects pip when `os.path.expanduser('~/.cache/pip')` is
expanded to `/\\\\.cache/pip`. Although `HOME=/` is probably uncommon on
most Linux systems, it is extremely common in Docker images.

Fixes #2996.
2015-09-29 16:01:32 -04:00
Xavier Fernandez
070a7289a2 Fix split_leading_dir, no need to cast to str
closes #2729
2015-09-29 14:28:33 +02:00
Paul Moore
908d07734c Merge pull request #3047 from tgs/clean_wheel_build_dir
Clean build dir if bdist_wheel fails
2015-09-29 09:19:39 +01:00
Erik Rose
910b82c59d --require-hashes no longer implies --no-deps.
For dependencies that are properly pinned and hashed (not really dependencies at all, if you like, since they're explicit, root-level requirements), we install them as normal. For ones that are not pinned and hashes, we raise the errors typical of any unhashed requirement in --require-hashes mode.

Since the stanza under "if not ignore_dependencies" doesn't actually add anything if it's already in the RequirementSet, not much has to be done in the way of code: the unhashed deps don't have any hashes, so we complain about them as per usual.

Also...
* Revise wording of HashUnpinned errors. They can be raised even if no hash is specified, so the previous wording was misleading.
* Make wording of HashMissing less awkward.
2015-09-25 19:07:20 -04:00
Erik Rose
f3f73f1c07 Remove the -H spelling for --hashes.
dstufft is nervous about blowing a single-char option on something that will usually be copied and pasted anyway. We can always put it back later if it proves to be a pain.
2015-09-25 15:32:33 -04:00
Erik Rose
0c17248998 Pass PEP 8 checks. 2015-09-24 22:16:00 -04:00
Erik Rose
11dbb92440 Switch from --sha256 etc. to a single option: --hash.
Everybody seems to favor this. Spelled -H, it's still pretty short. And it is less unusual programmatically.
2015-09-24 22:16:00 -04:00
Erik Rose
1e41f01823 Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175.
* Add --require-hashes option. This is handy in deployment scripts to force application authors to hash their requirements. It is also a convenient way to get pip to show computed hashes for a virgin, unhashed requirements file. Eventually, additions to `pip freeze` should fill a superset of this use case.
  * In --require-hashes mode, at least one hash is required to match for each requirement.
  * Option-based requirements (--sha256=...) turn on --require-hashes mode implicitly.
  * Internet-derived URL-based hashes are "necessary but not sufficient": they do not satisfy --require-hashes mode when they match, but they are still used to guard against transmission errors.
  * Other URL-based requirements (#md5=...) are treated just like flag-based ones, except they don't turn on --require-hashes.
* Complain informatively, with the most devastating errors first so you don't chase your tail all day only to run up against a brick wall at the end. This also means we don't complain that a hash is missing, only for the user to find, after fixing it, that we have no idea how to even compute a hash for that type of requirement.
  * Complain about unpinned requirements when hash-checking mode is on, lest they cause the user surprise later.
  * Complain about missing hashes.
  * Complain about requirement types we don't know how to hash (like VCS ones and local dirs).
* Have InstallRequirement keep its original Link around (original_link) so we can differentiate between URL hashes from requirements files and ones downloaded from the (untrustworthy) internet.
* Remove test_download_hashes, which is obsolete. Similar coverage is provided in test_utils.TestHashes and the various hash cases in test_req.py.
2015-09-24 22:16:00 -04:00
Marcus Smith
c4487bc453 Merge pull request #3093 from rbtcollins/develop
Add apparently missing py file flavor.
2015-09-23 15:44:11 -07:00
Erik Rose
3303be0c4e Teach requirements parser how to parser hash options, like --sha256.
We purposely keep it off the CLI for now. optparse isn't really geared to expose interspersed args and options, so a more heavy-handed approach will be necessary to support things like `pip install SomePackage --sha256=abcdef... OtherPackage --sha256=012345...`.
2015-09-23 17:39:32 -04:00
Erik Rose
9211d6e313 Style tweaks 2015-09-23 17:39:32 -04:00
Erik Rose
62ac258e1e Delete dead _copy_dist_from_dir(). 2015-09-23 17:39:32 -04:00
Erik Rose
e058486c91 Fix some docstring typos. 2015-09-23 17:39:32 -04:00
Marcus Smith
2b0a722191 - add a preprocess function so that interactions between filtering and
joining can easily be tested
- add some test cases mentioned by @pgervais
- deal with case of last line ending with \
2015-09-22 16:53:26 -07:00
Marcus Smith
ecdb8584f8 refactor to preserve reporting of original line numbers in requirement files 2015-09-21 14:10:31 -07:00
Matthew Iversen
f70aac4457 Show entry points for dist-info installed packages
Also make dist['files'] logic slightly more straight forward.
2015-09-21 04:21:20 +10:00
Xavier Fernandez
0b1acf9726 Merge pull request #3085 from patricklaw/add-pip-download-command
Add `pip download` command and deprecate `pip install --download`.
2015-09-15 23:27:47 +02:00
Robert Collins
8737b9c5a4 Add apparently missing py flavor. 2015-09-15 15:04:58 +12:00
Donald Stufft
11d96fb3c5 Merge pull request #2937 from nakato/i2928
Attempt to install editable packge defined in constraints should error
2015-09-14 16:54:18 -04:00
Mathew Jennings
417f79d8b8 Add pip download command and deprecate pip install --download.
`pip download` has the same functionality as `pip install --download`,
and the behavior of `pip install --download` is preserved with a deprecation
warning.  `pip install --download` will be removed in pip version 10.
2015-09-13 17:41:00 -04:00
Xavier Fernandez
35f6a6b40f Merge pull request #3099 from xavfernandez/unused_user_log_dir
Remove unused user_log_dir
2015-09-11 23:26:34 +02:00
Xavier Fernandez
d6767e14e2 Merge pull request #3098 from xavfernandez/unused__get_username
Remove unused __get_username function
2015-09-11 23:24:59 +02:00
Xavier Fernandez
f2ed6fcdc5 Remove unused __get_username function 2015-09-11 17:45:57 +02:00
Xavier Fernandez
7b44092f06 Remove unused user_log_dir 2015-09-11 17:44:30 +02:00
Xavier Fernandez
b07dc33b8f Merge pull request #3097 from xavfernandez/fix_ideal_build_dir
InstallRequirement: fix attribute name
2015-09-11 17:41:23 +02:00
Xavier Fernandez
ee3c2b0034 InstallRequirement: fix attribute name 2015-09-11 17:23:17 +02:00
Xavier Fernandez
7d34f61eec Merge pull request #2812 from thanatos/repo-ssh-and-https-are-secure
Allow things like "git+ssh" to count as secure in validate_secure_origin.
2015-09-11 17:05:18 +02:00
Roy Wellington Ⅳ
059e934746 Adopt comments and ordering from @pykler's implementation.
See: 723da87562
2015-09-09 20:23:39 -07:00
Roy Wellington Ⅳ
2b3386afaf Compute the protocol to check against outside the loop.
And improve the comment a bit.
2015-09-09 18:59:03 -07:00
Roy Wellington Ⅳ
455f3b4e74 SSH is a secure protocol, and allow repository links ("git+") to validate. 2015-09-09 18:59:03 -07:00
Roy Wellington Ⅳ
99b68f977e Allow SSH as a secure protocol. 2015-09-09 18:59:03 -07:00
Xavier Fernandez
d6f9bbf463 Raise an exception on invalid script entry points
(only for wheel installs)
closes #2998 and #3086
2015-09-09 23:09:01 +02:00
Thomas Smith
7f58c07a25 Clean build dir if bdist_wheel fails
When pip tries to build a wheel but fails, setup.py install is run in
the same directory.  However, some build files are not compatible
between 'install' and 'bdist_wheel', particularly scripts - the shebang
lines are different.  Pip now cleans the build dir after a failed
bdist_wheel so that pip doesn't install broken scripts.

Closes #3006
2015-09-09 15:16:51 -04:00
Donald Stufft
bd863d7c6e Merge pull request #3080 from xavfernandez/normalize_names
Add a canonicalize_name util function
2015-09-08 16:56:34 -04:00
Xavier Fernandez
c73b1f9fd5 rename to canonicalize_name 2015-09-08 00:18:54 +02:00
Xavier Fernandez
414c2d62fd supplied name does not need to be normalized 2015-09-06 19:20:17 +02:00
Xavier Fernandez
2ff59d1cc0 Add canonical utils function 2015-09-06 19:20:14 +02:00
Xavier Fernandez
b290e13cfa Allow --pre option in requirement files
closes #1273
2015-09-05 23:13:03 +02:00
Xavier Fernandez
a9325b0727 Allow --process-dependency-links in req files
closes #1274
2015-09-05 20:19:30 +02:00
Xavier Fernandez
a7634cb623 Merge pull request #3007 from xavfernandez/trusted_host_in_req_file
Allow --trusted-host option in requirement files
2015-09-05 20:10:24 +02:00
Xavier Fernandez
8c67bccb2c Remove now useless code
since a23a65cee4
2015-09-04 23:24:08 +02:00
Xavier Fernandez
7d596224cd Improve some PackageFinder methods' docstrings 2015-09-04 22:36:32 +02:00
Xavier Fernandez
9c43dbcac4 Merge pull request #3035 from arindamchoudhury/patch-1
Update PackageFinder.find_requirement docstring
2015-09-04 22:19:08 +02:00
Xavier Fernandez
e168b845a4 Allow --trusted-host option in requirement files
closes #2822
2015-09-03 22:33:31 +02:00
Donald Stufft
a23a65cee4 Merge pull request #3073 from dstufft/remove-8-deprecations
Remove items slated for removal in pip 8.0
2015-09-03 11:10:51 -04:00
Donald Stufft
6afc718307 Remove items slated for removal in pip 8.0 2015-09-03 10:55:11 -04:00
Xavier Fernandez
f8040ab13e Use stdlib os.path.relpath
instead of custom (and now useless) make_path_relative
2015-09-03 15:38:44 +02:00
Donald Stufft
e26d930b0a PEP 470: Remove support for searching rel links 2015-09-03 01:04:06 -04:00
Donald Stufft
0f5d4286a5 Deprecate and Noop the PEP 438 functionality due to PEP 470 2015-09-02 23:47:05 -04:00
Matt Robenolt
4c3ab41e90 Only update VCS when things have actually changed
This saves a network hop when using git and passing an explicit sha
as a ref by comparing the version that's already checked out.

Yields a ~4x speedup on my local machine

Before:
```
$ /usr/local/bin/pip --version
pip 7.1.0 from /usr/local/lib/python2.7/site-packages (python 2.7)
$ time /usr/local/bin/pip install --disable-pip-version-check -e git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
Obtaining raven-dev from git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
  Updating ./src/raven-dev clone (to 56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e)
  Could not find a tag or branch '56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e', assuming commit.
Installing collected packages: raven-dev
  Running setup.py develop for raven-dev
Successfully installed raven-dev
/usr/local/bin/pip install --disable-pip-version-check -e   0.84s user 0.48s system 39% cpu 3.300 total
```

After:
```
$ /Users/matt/.virtualenvs/pip/bin/pip --version
pip 7.2.0.dev0 from /Users/matt/code/pip (python 2.7)
$ time /Users/matt/.virtualenvs/pip/bin/pip install --disable-pip-version-check -e git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
Obtaining raven-dev from git+https://github.com/getsentry/raven-python.git@56fc6f7beecf445843d0ec7052bb8c6f0ea80a2e#egg=raven_dev
checking version
  Skipping because already up-to-date.
Installing collected packages: raven-dev
  Running setup.py develop for raven-dev
Successfully installed raven-dev
/Users/matt/.virtualenvs/pip/bin/pip install --disable-pip-version-check -e   0.59s user 0.22s system 98% cpu 0.824 total
```
2015-09-01 13:23:18 -07:00
Donald Stufft
0aa65181ad bump for development 2015-08-22 18:58:01 -04:00
Donald Stufft
78daccc915 Update changelog and version 2015-08-22 18:46:55 -04:00
Donald Stufft
bee3be48ad Handle the case where pip isn't installed during the version check 2015-08-22 17:50:22 -04:00
Donald Stufft
3d245ea2d2 bump version for development 2015-08-20 18:16:49 -04:00
Donald Stufft
0214d7c669 bump for release 2015-08-20 17:10:00 -04:00
Donald Stufft
56279c0fdd bump to 7.1.1.dev0 2015-08-20 17:08:13 -04:00
Donald Stufft
9aad142153 Update setuptools version 2015-08-20 16:34:38 -04:00
Donald Stufft
3a9f33bd3d Upgrade ipaddress to 1.0.14 2015-08-20 16:33:10 -04:00
Donald Stufft
cc7f416378 Merge pull request #3037 from ianw/no-reset-platlib
Don't reset purelib/platlib when install-dir not set
2015-08-19 17:27:21 -04:00
Ian Wienand
d871bcd1bb Don't reset purelib/platlib when install-dir not set
Change 3affcaa2b8 attempts to reset
purelib & platlib to any "install-dir" specified by the user in
setup.cfg.  This code is used when we are installing wheels.

The problem with this is that distutils is *always* setting
"i.install_lib" -- even when the user specifies nothing.  This has the
result of unconditionally setting purelib == platlib.

On some systems this results in .so's from the wheel getting installed
into /usr/lib/python2.7 (purelib) rather than /usr/lib64/python
(platlib).  Because distribution-packaged libraries have installed
their .so into platlib, we can now have a situation where the new
pip-installed library is picking up an old .so from the distro package
... with predictably bad results.

This takes the approach of checking the configuration to see if the
user has overridden install-dir and only resetting the paths if they
have.  The override case is covered by existing test-cases.

Closes #2940
2015-08-19 14:56:53 +10:00
Arindam Choudhury
f9907d6e77 Update index.py 2015-08-18 15:30:58 +02:00
Sachi King
5d96864775 Attempt to get name for editable file:// URLs
When installing an editable from file:///path/to/file, pip currently does
not attempt to determine the name from #egg=NAME, just passing back
None.  This causes constraints code to completely ignore this line
resulting in unexpected installation behaviour.

This patch makes '-e file:///path#egg=name' function similarly to
'file:///path#egg=name' and '-e git+URL#egg=name'.  If #egg=name is not
defined, it returns None and the package becomes an unamed requirement,
which constraints will not parse but in the case of a requirement will
later be processed and determined.

Closes #3026
2015-08-18 11:44:20 +10:00
Sachi King
4c7fd6aead Attempt to install editable packge defined in constraints should error
Currently if the local package you are trying to install is listed in
the constraint file it will silently fail to install the local package
while installing its dependancies.

This process was caused by the has_requirement returning true when a
constraint with that name was defined, resulting in the local package
not being processed.

Closes #2928
2015-08-17 14:49:03 +10:00
Donald Stufft
0027580f86 Merge pull request #2980 from xavfernandez/use_logging_exc_info
basecommand: use logging exc_info parameter
2015-08-03 16:48:54 -04:00
Xavier Fernandez
e0522c4109 Add debug log when using cached wheel
closes #3000
2015-08-02 20:10:49 +02:00
Donald Stufft
e695a66cd7 Upgrade packaging to 15.3 2015-08-01 20:11:25 -04:00
Xavier Fernandez
b0cc9da953 basecommand: use logging exc_info parameter 2015-07-16 21:21:41 +02:00
Donald Stufft
e2d98cc51a Upgrade ipaddress to 1.0.13 2015-07-15 17:01:38 -04:00
Donald Stufft
c82e79f418 Upgrade to distlib 0.2.1 2015-07-15 17:01:14 -04:00
Paulus Schoutsen
a5e06a506c Do not break built-in logging module when pip embedded in script
Fixes #2553. When a Python script embeds pip and tries to log something from a different thread, an AttributeError is raised.
2015-07-15 10:34:16 -07:00
Xavier Fernandez
0e8d5801b0 Compute pip version from its metadata
Move InstallRequirement.installed_version to a get_installed_version helper
Adapt test
2015-07-06 10:28:18 +02:00
Xavier Fernandez
7cd1586d27 Check for new pip version after run call
If a pip install --update was performed, the version check should not
find anything. Closes #2829
2015-07-03 17:09:12 +02:00
Min RK
aa0099a641 check that wheel cache dir is writable
before building wheels. Warning is copied from http cache check.

HTTP cache has a similar check and warning,
but wheels would still try and fail to build.
2015-07-02 13:10:47 -07:00
Donald Stufft
0ba95ace50 bump for development 2015-06-30 20:34:20 -04:00
Donald Stufft
d2f09e2867 Bump for release 2015-06-30 18:53:26 -04:00
Donald Stufft
40242fe4db Merge pull request #2934 from jamezpolley/user_implies_null_prefix
Ignore distutils prefix when using --user
2015-06-28 23:08:01 -04:00
James Polley
b227c45a7b Ignore distutils prefix when using --user
Fixes bug #2683

There are two changes here; one to fix the using-wheels codepath and one
to fix the no-wheels codepath. Two tests are introduced, one to test
each codepath.
2015-06-26 19:08:45 +10:00
Donald Stufft
2912910b44 Do a (slightly) less insane thing to handle debundling
Previously we attempt to do some crazy things with import hooks
in order to attempt to automatically alias normally installed
dependencies as our vendored dependencies. This turned out to be
fairly fragile, so instead we'll manually patch sys.modules to
trigger the aliasing.

As part of this, we also drop support for the
PIP_NO_VENDOR_FOR_DOWNSTREAM environment variable because it was
never fully supported and now that we have wheel caching, actually
using it could possibly trigger a bad wheel to be cached. The new
mechanism requires some light patching by downstream to opt into
the mechanism, so they can also easily remove all of the files
in pip/_vendor/ except for __init__.py.
2015-06-23 22:27:47 -04:00
Donald Stufft
0b9beab59c Merge pull request #2924 from dstufft/upgrade-setuptools
Upgrade setuptools to 18.0
2015-06-23 19:44:02 -04:00
Donald Stufft
f03ebccf33 Merge pull request #2891 from jdkx/develop
Fixed support for Jython 2.7 in wheel.py.
2015-06-23 19:14:14 -04:00
Donald Stufft
3abaac5abc Merge pull request #2743 from Carreau/importlib
imp deprecated on 3.4
2015-06-23 19:13:31 -04:00
Donald Stufft
e89e3a80a4 Upgrade setuptools to 18.0 2015-06-23 19:00:35 -04:00
Donald Stufft
c68a56dfed Merge pull request #2915 from minrk/soabi-cp35-split
get only first part of SOABI for ABI tag
2015-06-23 12:34:19 -04:00
James Polley
6d719576e8 Handle missing case from bug #2888
If a single package is listed as a constraint; is a dependency of a
package being installed; *and* is already installed, we end up
processing it multiple times. This change adds a new "prepared" flag
which we set the first time the package is processed, to prevent
multiple handling.

Fixes bug #2888
2015-06-19 15:21:02 +10:00
Min RK
26d078c4c2 get only first part of SOABI for ABI tag
after cpython-

CPython 3.5 has SOABI='cpython-35m-darwin'

This now returns the expected 'cp35m'
2015-06-18 11:20:52 -07:00
Julien Demoor
b53397528b Fixed support for Jython 2.7 in wheel.py. 2015-06-10 07:13:08 +04:00
Robert Collins
a66d3e2e8b Issue #2867: Accept --no/only-binary via pip.conf 2015-06-10 10:25:15 +12:00
Donald Stufft
8e3eaec559 Merge pull request #2857 from rbtcollins/issue-2731
Issue #2731: Constraints files.
2015-06-08 18:29:02 -04:00
Robert Collins
bb0b429a49 Issue #2731: Constraints files.
This adds constraints files. Like requirements files constraints files
control what version of a package is installed, but unlike
requirements files this doesn't itself choose to install the package.
This allows things that aren't explicitly desired to be constrained if
and only if they are installed.
2015-06-03 06:38:33 +12:00
Donald Stufft
6ad6c59731 Merge pull request #2858 from william-ml-leslie/develop
Remove stray apostrophe
2015-06-02 10:05:13 -04:00
William ML Leslie
e7d01268e8 Remove stray apostrophe 2015-06-02 15:07:41 +10:00
Donald Stufft
9089430ab7 Support a falsey cache-dir 2015-06-01 20:52:02 -04:00
Donald Stufft
0ebc37d17a Expand ~ in the wheel cache directory 2015-06-01 17:24:11 -04:00
Marcus Smith
c16747bfd0 - we won't be shlex parsing the args later,
so the split here should just be simple string split on ' '
- token parsing logic fixes
- text fixes (tuples, not lists)
2015-06-02 06:50:16 +12:00
Marcus Smith
f4b2ee1a9e Break up the line into an args and options string.
We only want to shlex (and then optparse) the options, not the args.
args can contain markers which are corrupted by shlex
2015-06-02 06:50:05 +12:00
Paul Moore
27d01147d0 Advise use of python -m pip on Windows when suggesting an upgrade 2015-05-26 14:13:41 +01:00
Donald Stufft
c631081484 Merge pull request #2815 from kitterma/develop
Update __init__.py
2015-05-23 13:15:38 -04:00
Scott Kitterman
88d0cca5e9 Update __init__.py
Add support in pip/compat for use of ipaddr in addition to ipaddress, this time with nested try accept.
2015-05-23 12:59:53 -04:00
Donald Stufft
91e59df2f0 Merge branch 'master' into develop 2015-05-22 20:21:02 -04:00
Donald Stufft
b2c8fb9f2c bump version 2015-05-22 20:14:27 -04:00
Donald Stufft
7c969b6e62 Guard against req.link being None 2015-05-22 19:43:29 -04:00
Donald Stufft
1730747a19 bump changelog and version 2015-05-22 19:32:26 -04:00
Donald Stufft
6413f628ac Merge pull request #2808 from dstufft/only-wheel-artifact
Don't cache wheels for links which do not point to release artifacts
(cherry picked from commit 66d970dbcf)
2015-05-22 19:29:55 -04:00
Donald Stufft
3a7adebe79 Merge pull request #2810 from dstufft/allow-all-external-req-file
Allow --allow-all-external inside of a requirements.txt
(cherry picked from commit b6b77e7957)
2015-05-22 19:29:21 -04:00
Donald Stufft
b6b77e7957 Merge pull request #2810 from dstufft/allow-all-external-req-file
Allow --allow-all-external inside of a requirements.txt
2015-05-22 18:09:53 -04:00
Donald Stufft
09542477a9 Allow --allow-all-external inside of a requirements.txt 2015-05-22 17:51:35 -04:00
Donald Stufft
fc5746a34c Don't cache wheels for links which do not point to release artifacts 2015-05-22 17:13:26 -04:00
Donald Stufft
c77e8f068a bump version to 7.1.0.dev0 2015-05-21 23:38:10 -04:00
Donald Stufft
01e6230e91 Bump version and update changelog 2015-05-21 22:56:59 -04:00
Donald Stufft
5631a8a75e Use a hashed representation of the URL for the wheel cache 2015-05-21 21:54:46 -04:00
Donald Stufft
3569a9b060 Remove the implicit debug log 2015-05-21 18:01:40 -04:00
Donald Stufft
56d5076ee2 Hide setup.py output unless using -v 2015-05-20 21:27:12 -04:00
Donald Stufft
8af4872ff6 Use the directory locking for the filecache 2015-05-20 14:21:11 -04:00
Donald Stufft
ee0236ccb1 Upgrade CacheControl to 0.11.5 2015-05-20 14:01:18 -04:00
Donald Stufft
749707313a Merge pull request #2785 from mrtrumbe/dev/issue1236
Address issue #1236.
2015-05-19 18:05:00 -04:00
Donald Stufft
869ad9ad98 Merge pull request #2786 from rbtcollins/brokenout-1
Fix indented log.
2015-05-15 14:31:19 -04:00
Robert Collins
79403ad470 Fix indented log.
If exception occur the log stays indented. Oops.
2015-05-15 23:42:38 +12:00
Donald Stufft
416f9d0eff Merge pull request #2782 from rbtcollins/issue-2780
Issue #2780: Fix assertion installing with no cache.
2015-05-14 20:35:33 -04:00
Matthew Trumbell
4babf310a4 Addresses issue #1236. Extras can now be specified on file/directory-like requirement specifications as well as url requirement specifications. 2015-05-14 11:24:49 -05:00
Robert Collins
a6613ab507 Issue #2780: Fix assertion installing with no cache.
This was an oversight.
2015-05-14 17:41:37 +12:00
Donald Stufft
a0e73f069c Upgrade packaging to 15.2 2015-05-13 17:47:49 -04:00
Thomas Guettler
a930de1f06 - Closes #2759: Modify sys.path in-place. 2015-05-11 09:27:01 +02:00
Xavier Fernandez
1cde090bd4 fix typos: Search docstring and an empty line 2015-05-10 23:45:54 +02:00
Donald Stufft
18064e7017 Remove the workarounds/hacks to handle distribute -> setuptools 2015-05-09 15:09:05 -04:00
Donald Stufft
08160408fb Only warn on final releases with different base versions
We only want to prompt people to upgrade their pip version if the
newer version is not a post release of the version they have and
it's not a pre-release version.
2015-05-09 13:37:12 -04:00
Donald Stufft
2f2adf2308 Upgrade requests to 2.7.0 2015-05-08 17:26:18 -04:00
Donald Stufft
3c7325647f Upgrade html5lib to 1.0b5 2015-05-08 17:24:58 -04:00
Donald Stufft
22e059556d Add a warning that'll tell people when their Python doesn't support TLS 2015-05-06 18:48:04 -04:00
Donald Stufft
31ab024a7d Use shutil.move instead of os.rename
os.rename causes errors to happen whenever the temporary location
is on a different device than the wheel cache directory. Using
shutil.move instead will cause it to use os.rename when it can and
fallback to copying otherwise.
2015-05-04 07:47:21 -04:00
Matthias Bussonnier
cdb1dc7685 imp deprecated on 3.4
importing it prevent to debug other packages with `-W error` as the
deprecation warning will raise.

Though there is still imp imported from a few vendorized packages,
and for other purposes than cache_from_source.
2015-05-02 10:48:25 -07:00
Marcus Smith
b3ec00b45d fix case where original requirements file is a local path and the nested file is over http. 2015-05-01 16:03:59 -07:00
Marcus Smith
e1e428bb74 Merge pull request #2735 from qwcode/issue_2734
fix for Issue 2734
2015-04-28 17:42:22 -07:00
Marcus Smith
94a6829515 Merge pull request #2725 from qwcode/req_file_parse_defaults
requirements file parsing with normal option defaults
2015-04-28 16:44:31 -07:00
Marcus Smith
afdb664f55 pep8 fixes 2015-04-28 16:17:50 -07:00
Marcus Smith
50c3b6c371 pep8 fix 2015-04-28 16:15:50 -07:00
Marcus Smith
7725cdbe2c - remove overlapping variables from populate_requirement_set
- warn about not specifying requirements, when they're not specified,
  not when the RequirementSet happens to turn up empty
2015-04-28 16:00:38 -07:00
Marcus Smith
dc295237c0 warn when requirements are ignored due to non-matching markers 2015-04-28 15:59:37 -07:00
Marcus Smith
d47b1a5b26 more explanation in the process_line doc string 2015-04-28 15:23:02 -07:00
Marcus Smith
09ea42e7f3 convert elif's to if's since we're allowing multiple options per line 2015-04-24 23:10:07 -07:00
Marcus Smith
7c83f8d3cd 1) parse with defaults set as they are naturally (vs forcing to None)
and adjust the logic to match; the result is simpler.
2) Due to #1, we can remove some hairy "format_control" hacks
3) Due to #1, we have to relax the parsing and allow:
   - multiple options per line
   - any supported option on a line with a requirement (not just
     --install-option/--global-option, although they are the only
     options that are passed into a requirement)
2015-04-24 22:32:26 -07:00
Robert Collins
eda3f0451d Issue #2723: Restore the use of git clones
6.1.1 and before use git clones when installing a git+ url. 7.0.0.dev
didn't temporarily because the internal flag for controlling whether
to do a clone or an export was tied into the behaviour for whether
something will be deleted or not - which is arguably different. Remove
the confounded behaviour and just unpack always, using the same marker
flag to delete directories as used for file and non-vcs urls.
2015-04-25 15:33:33 +12:00
Robert Collins
582af6e684 Issue #2677: Disable wheels for setup.py options.
Using --install-options, --build-options, --global-options changes
the way that setup.py behaves, and isn't honoured by the wheel code.
The new wheel autobuilding code made this very obvious - disable
the use of wheels when these options are supplied.
2015-04-24 16:14:48 +12:00
Robert Collins
6aec23cafe Issue #2675: Granular control over wheels/sdists
With wheel autobuilding in place a release blocker is some granular
way to opt-out of wheels for known-bad packages. This patch introduces
two new options: --no-binary and --only-binary to control what
archives we are willing to use on both a global and per-package basis.

This also closes #2084
2015-04-24 08:52:48 +12:00
Marcus Smith
b911339625 Merge remote-tracking branch 'pypa/develop' into refactor_req_file
Conflicts:
	pip/req/req_file.py
2015-04-23 02:21:01 -07:00
Marcus Smith
fdd10ade9c only calculate the dest strings once 2015-04-23 01:39:02 -07:00
Marcus Smith
55e7bd3daa handle requirement specifiers with spaces, e.g. "pkg >= 1" 2015-04-23 01:31:48 -07:00
Donald Stufft
33764609eb Merge pull request #2715 from citruspi/Error-Log-Level-Flag
Differentiate Between Quiet Flag Counts
2015-04-22 20:46:55 -04:00
Mihir Singh
04ac5270c3 Mapped three or more quiet flags to the critical log level 2015-04-22 18:38:45 -05:00
Mihir Singh
4b6bdf0210 Set the log level to ERROR when two or more quiet flags are passed
Fixes pypa/pip#2670
2015-04-22 17:56:34 -05:00
Robert Collins
ec46a3bac4 Replace wheel cache cache_dir with an object.
Wheel cache lookups become more complex when we wish to allow binary
blacklisting. Rather than passing more parameters around, replace
cache_root with wheel_cache, and create a wheel cache in all the
relevant command entry points.
2015-04-23 10:03:50 +12:00