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

37 commits

Author SHA1 Message Date
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
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
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
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 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
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
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
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
Donald Stufft a88bc0de73 Send log messages >= logging.WARNING to stderr 2015-04-06 23:11:16 -04:00
Matej Stuchlik c5024dc851 Mark tests requiring Internet access 2015-01-15 00:53:15 +01: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 5f0692b40a Fix for latest setuptools 2014-12-13 12:38:55 -05:00
Pierre-Yves Rofes af819b3758 Add a test for issue #1934 2014-10-02 09:17:27 +02:00
Donald Stufft 90688e82b1 Revert "Merge pull request #1519 from dstufft/remove-dependency-links"
This reverts commit da02f073da, reversing
changes made to 2ad8888901.

Conflicts:
	CHANGES.txt
	pip/commands/freeze.py
	pip/commands/list.py
	pip/commands/wheel.py
	pip/index.py
	pip/req/req_set.py
	pip/vcs/subversion.py
2014-08-01 16:50:08 -04:00
Matthew Iversen 4008c0a111 Fix tests for subdirectory install
- make assert_install test clearer
- Add option allowing for testing install from an editable subdirectory
2014-03-09 05:33:05 +11:00
Donald Stufft 95ac4c16f5 Remove dependency links support from pip 2014-02-25 18:39:40 -05:00
Donald Stufft 95035fc5c4 Turn on everything in flake8
flake8 ignores some errors by default, these ignored by defaults
change sometimes. This will make things stabler by selecting
everything.
2014-02-24 16:52:23 -05:00
Donald Stufft 9f027337a8 Use Flake8 on the test of pip's Python files 2014-01-28 19:47:58 -05:00
Marcus Smith a7c522da97 fix references to req methods/classes after refactor 2014-01-12 10:05:11 -08:00
Donald Stufft 12ee7cc6d9 Do not respect dependency links by default 2013-10-27 18:34:46 -04:00
Paul Nasrat 951ef7438c Merge remote-tracking branch 'niedbalski/develop' into subdirectory-editable
Conflicts:
	CHANGES.txt
	tests/functional/test_install_reqs.py
	tests/lib/__init__.py
	tests/unit/test_req.py

Additional work - refactored tests to new style.
2013-09-27 14:42:05 -04:00
Donald Stufft 487925ea3f Isolate the tests from the shared data directory 2013-08-27 06:49:35 -04:00
Donald Stufft f9a3b97b41 Explicitly pass around a directory for tests.lib.local_repos 2013-08-27 06:47:25 -04:00
Donald Stufft 0c42245f21 Replace explicit calls to reset_env() with the script fixture 2013-08-27 06:47:23 -04:00
Donald Stufft 9894c8baac Refactor tests.lib
* Move virtualenv creation out of TestPipEnvironment
* Remove global state and force explicit use of TestPipEnvironment
  instances
* Remove "backup" virtualenv copying and instead create new
  virtual environments each time.
* Remove the monkeypatched "PyPICache" functionality
* Remove things that were not being used anymore and were dead
  weight
* Remove sitecustomize support which was primarily used to
  monkeypatch the "PyPICache" but was used in one or two other
  tests.
2013-08-21 22:40:16 -04:00
Donald Stufft da0bc4b1d1 Switch to using py.test as the test runner instead of nose
* Better output with the bare asserts we use throughout the tests
* Function fixtures are pretty nice, especially as a way to
  start a background server or create an isolated virtualenv
2013-08-21 10:19:58 -04:00
Jorge Niedbalski abf27b5bd2 [tests] added test for subdirectory editable options 2013-07-24 12:25:35 -03:00
Marcus Smith 28298c413d more functional/unit tests restructure 2013-05-29 13:41:13 -07:00
Renamed from tests/functional/test_requirements.py (Browse further)