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

355 commits

Author SHA1 Message Date
Donald Stufft
3172b4e7d6 This test doesn't actually work in practice :( 2016-01-21 09:08:36 -05:00
Robert Collins
7b2fbb069a Stop erroring on installs of argparse and wsgiref. 2016-01-21 13:49:49 +13:00
Xavier Fernandez
171a107c34 pip list: reenable prereleases filter
according to --pre option

broken in 7fcf75bb61

closes #3385
2016-01-20 15:12:00 +01:00
kaustav haldar
fbfa7fbcfe fix(pip/req/req_set): If double requirements exist which have the same specs, dont raise a double requirement given error 2016-01-19 22:25:25 -08:00
Ian Wienand
35a3e8b7f5 Restore ability to uninstall distutils packages
This is a partial revert of 6afc718307
to restore the ability to overwrite distutils installed packages.

It is not elegant, but some projects (such as OpenStack's devstack)
rely on overwriting packages installed via the system package manager.
These packages can't be removed because they are dependencies for
parts of the base system, but many of the things devstack needs to run
requires later dependencies.  For historical reasons it's not easy to
fix this into a virtualenv, etc, all at once.

If distributions move to setuptools based packages, this problem might
fix itself.
2016-01-20 16:57:04 +11:00
Xavier Fernandez
18b5fc2c44 pip.wheel: change --wheel-dir default value
From <current working directory>/wheelhouse to <current working
directory> only to be consistent with pip download behavior.
2016-01-19 22:42:22 +01:00
Donald Stufft
1ae7707e96 Default to downloading to the current directory 2016-01-19 13:05:34 -05:00
Donald Stufft
3b3978b994 Merge pull request #3284 from ncoghlan/pep376-installer-file
Record pip in INSTALLER file
2016-01-19 10:41:08 -05:00
Donald Stufft
35feedebc1 Merge pull request #3324 from jsbarber/develop
Fix for issue #2834 with test
2016-01-18 23:21:09 -05:00
Donald Stufft
3ae13b2e35 Merge pull request #3312 from sbidoul/no-branch-in-egg-name-sbi
stop the addition of the branch name in the #egg=... fragment
2016-01-18 18:04:03 -05:00
Xavier Fernandez
d1136dda3e Add support for .xz files (with python >=3.3)
Closes #722
2016-01-14 22:39:45 +01:00
Stéphane Bidoul
6f790d1d80 stop the addition of the branch name in the #egg=... fragment 2016-01-14 19:04:02 +01:00
Xavier Fernandez
21fb8a28f0 Dont raise on #egg metadata mismatch, just warn
Since pip 7, via pip freeze, is producing such mismatching #egg
fragment, forbidding them in pip 8 would be too strongly
backward-incompatible.
It is a partial rollback of 1a012bb6.
2016-01-14 00:30:02 +01:00
Jeff Barber
24a5cc6a42 Fix for issue #2834 with test 2016-01-03 17:38:36 -05:00
Donald Stufft
44feed107f Fix one more test that didn't expect stderr on 2.6 2016-01-01 22:36:18 -05:00
Donald Stufft
2202f868f8 Adjust the tests to be more forgiving of extra stderr output 2016-01-01 22:20:14 -05:00
Donald Stufft
15a06418b5 PyPI no longer supports external files so this test doesn't make sense 2016-01-01 14:38:28 -05:00
Xavier Fernandez
034232f0e0 Merge pull request #3317 from scop/spelling
Spelling fixes
2015-12-29 23:19:56 +01:00
Ville Skyttä
0da18e93b3 Spelling fixes 2015-12-27 00:58:23 +02:00
Xavier Fernandez
d9e0a057b0 Rename test and mark as network
since the wheel package now needs to be installed
2015-12-17 00:24:38 +01:00
Xavier Fernandez
8767f892fd Fix wheel path test of --user install with prefix
From b227c45a
2015-12-17 00:08:50 +01:00
Xavier Fernandez
9457300142 Fix tests when wheel is available in global site packages
Make sure we are installing via setuptools and not wheels so that we get
egg-info directories.
2015-12-16 00:12:18 +01:00
Stéphane Bidoul
52556056c4 fix a test that was relying on incorrect non-detection of an editable pkg 2015-12-04 14:40:24 +01:00
Stéphane Bidoul
7d7b50a990 add freeze test with git subdirectory and srcdir 2015-12-04 14:40:24 +01:00
Stéphane Bidoul
e905e651d4 fix test that was removing setup.py hence causing spurious errors 2015-12-04 14:40:24 +01:00
Nick Coghlan
a925c88ed6 Record pip in INSTALLER file 2015-12-04 19:22:19 +10:00
Xavier Fernandez
3f21828f75 Unify output of pip list & fix test 2015-11-29 17:37:45 +01:00
Xavier Fernandez
795798f3f0 Allow combination of pip list options
--editable with --outdated/--updtodate
closes #933
2015-11-29 17:37:45 +01:00
Xavier Fernandez
82c45bcf63 Add changelog and test 2015-11-26 23:49:26 +01:00
Marcus Smith
ca47dc9949 Merge pull request #3252 from domenkozar/install/prefix
Support pip install --prefix
2015-11-26 09:30:20 -08:00
Domen Kožar
b4bb2eee14 Support also pip install -e --prefix 2015-11-24 10:01:46 +01:00
Domen Kožar
7270d272f4 Make sure --user and --prefix install flags conflict 2015-11-22 19:23:22 +01:00
Domen Kožar
e14a66f1b9 Support --prefix argument to install command.
There was no way to override prefix for an installation for wheels
previously. The default it whatever sys.prefix points to.
2015-11-22 19:13:51 +01:00
Steve Kowalik
dc8e7f01dd Join constraints and requested extras
Compare extras when checking if a requirement has already been
specified, and take a union of the extras before installation.

Co-Authored-By: Sachi King <nakato@nakato.io>
Closes #3046, #3189
2015-11-20 18:05:17 +11:00
Donald Stufft
f39bc756e5 Merge branch 'develop' into hashes2 2015-11-06 18:46:09 -05: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
89a27cd740 Special-case based on exception message 2015-10-22 23:15:02 +02: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
Erik Rose
9e5e34e9f7 Add --algorithm flag to pip hash. 2015-10-12 14:05:10 -04: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
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
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
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
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
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
Xavier Fernandez
bb1812b99d Adapt search tests to new PyPI searches
- unmark test_multiple_search for failure
- search for nonexistentpackage instead of non-existent-package since PyPI
  seems to fallback to searches about "package" and manages to find
  things...
2015-09-14 10:01:57 +02: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
5c3074a9b7 tests: fix test_search
The pip package description was changed in 2014 via af1d6d5
2015-09-11 14:26:35 +02:00
Thomas Smith
2bbb3be1ff Failing test: should clean up failed wheel build
Test for PR #3047
2015-09-09 15:16:51 -04:00
Donald Stufft
6afc718307 Remove items slated for removal in pip 8.0 2015-09-03 10:55:11 -04:00
Donald Stufft
0f5d4286a5 Deprecate and Noop the PEP 438 functionality due to PEP 470 2015-09-02 23:47:05 -04:00
Donald Stufft
638160a2ac Expect this test to fail until PyPI is fixed 2015-09-02 22:44:18 -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
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
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
3abaac5abc Merge pull request #2743 from Carreau/importlib
imp deprecated on 3.4
2015-06-23 19:13:31 -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
Robert Collins
a66d3e2e8b Issue #2867: Accept --no/only-binary via pip.conf 2015-06-10 10:25:15 +12: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
Marcus Smith
8c20947a23 update 'pip freeze -r' test to include marker case 2015-06-02 06:50:16 +12:00
Donald Stufft
f6856d6687 Try to test against Python 3.5 2015-05-27 21:34:17 -04:00
Donald Stufft
547ba94900 This works again 2015-05-20 16:27:42 -04:00
Donald Stufft
fa5710614e Mark this test as xfail until PyPI's search is fixed 2015-05-19 19:00:06 -04:00
Donald Stufft
18064e7017 Remove the workarounds/hacks to handle distribute -> setuptools 2015-05-09 15:09:05 -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
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
Robert Collins
62041d3ca8 Cleanup now use_wheel is the default.
There were a bunch of tests passing use_wheel unnecessarily, this
makes the change to remove use_wheel larger than it needs to be.
2015-04-20 20:12:03 +12:00
Marcus Smith
1ca1f1053d pep8 fixes 2015-04-18 13:55:48 -07:00
Marcus Smith
285f71b34a Test --install-option in requirements file overrides same option in cli 2015-04-18 12:48:25 -07:00
Marcus Smith
9c66633c29 - fixes to TestOptionVarants
- consistent use of the finder fixture
2015-04-18 11:59:17 -07:00
Robert Collins
08acb6670d Issue #2140: Build wheels automatically
Building wheels before installing elminates a cause of broken environments -
where install fails after we've already installed one or more packages.

If a package fails to wheel, we run setup.py install as normally.
2015-04-13 18:33:07 +12:00
Marcus Smith
12eab18bde functional test for --install-option in a requirements file 2015-04-13 00:07:15 +02:00
Marcus Smith
351d809df6 remove the functional test. for this change, we can achieve as much confidence with unit tests that confirm what args are passed 2015-04-13 00:07:15 +02:00
Georgi Valkov
0da51b14d7 Remove misleading test cases and improve docs 2015-04-12 23:52:49 +02:00
Georgi Valkov
29f0c75c63 Do not shlex.split() and flatten value of global|install_options 2015-04-12 23:52:49 +02:00
Georgi Valkov
1c0021b268 Add an --install|global-option functional test 2015-04-12 23:52:49 +02:00
Robert Collins
35ec67ab08 Add functional test that we can install non-wheelable sdists.
This is a preventative against breaking this as we add automatic
wheelisation.
2015-04-09 14:09:27 +12:00
Donald Stufft
b7309c6bcc Remove the items deprecated for removal in 7.0 2015-04-07 04:20:51 -04:00
Donald Stufft
a88bc0de73 Send log messages >= logging.WARNING to stderr 2015-04-06 23:11:16 -04:00
Marcus Smith
16108e99ad have the topo sort test use consistent dist type 2015-04-01 16:37:00 -07:00
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
Marcus Smith
47963aec7f Merge pull request #2577 from msabramo/test_install_less_deps_2
Less network deps in test_install
2015-03-23 19:46:26 -07:00
Marc Abramowitz
291bb12d07 test_install_package_with_target: No network
and also fix intermittent failures reported in
https://github.com/pypa/pip/issues/2580
2015-03-22 23:09:38 -07:00
Marc Abramowitz
f6dda5aa80 Less network deps in test_install 2015-03-19 03:54:09 -07:00
Robert Collins
31534feba5 Fix up references to tests/packages to tests/data/packages. 2015-03-18 14:25:41 +13:00
Marcus Smith
6023179ebf Merge pull request #2536 from msabramo/test_install_less_deps
test_install: Less deps on external stuff
2015-03-16 18:33:46 -07:00
Marc Abramowitz
987ce2b3b1 test_install: Less deps on external stuff
so that tests are faster and less likely to fail intermittently,
especially on Travis CI, where the networking is flakey.
2015-03-16 17:50:16 -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
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
Paul Moore
b1fe2cdfc8 Merge pull request #2526 from msabramo/test_freeze_bazaar_clone_work_on_windows
Make test_freeze_bazaar_clone pass on Windows
2015-03-16 11:40:41 +00:00