Commit Graph

38 Commits

Author SHA1 Message Date
Pradyun Gedam 58c594c06b
Prepare isort for black 2020-09-23 21:47:47 +05:30
Devesh Kumar Singh 04fedfe53c Create custom get_distribution function 2020-07-06 13:42:05 +05:30
Chris Hunt 82be4ee76a Use application context manager for PipSession.
This removes a level of indentation from all commands without
introducing any dummy functions.
2019-09-07 09:46:48 -04:00
Chris Jerdonek 1f09e67f34 Only import a Command class when it is actually needed.
This resulted in an approximate 24% speed-up of a vanilla `pip`
invocation on one system (0.477 secs before, 0.363 secs after).
2019-07-26 23:30:26 -04:00
Pradyun Gedam 537b0fca12
Change isort multi_line_output to 3 2019-07-22 10:15:27 +05:30
László Kiss Kollár 94d9dbef3b Display install instructions for pre-releases
Add a message to the output of `search` on installing pre-release
versions to avoid confusion when attempting to install without `--pre`.
2018-10-26 13:17:01 +01:00
Jon Dufresne 8136b410f7 Correct capitalization of PyPI
As spelled on https://pypi.org/.
2018-09-16 15:30:52 -07:00
Pradyun Gedam 1694a5f1bf
Move status_codes to pip._internal.cli 2018-07-30 09:43:53 +05:30
Pradyun Gedam 0983d0da6c
Update failing tests for pytest changes 2018-06-14 16:37:10 +05:30
Donald Stufft b2c5c678af Skip test due to Warehouse behavior change 2018-04-16 15:59:47 -04:00
Donald Stufft 275ab7c3f5 Switch pip to use Warehouse by default 2018-04-16 15:54:11 -04:00
Pradyun Gedam e31d784b41
Rename a few tests to add the word "basic"
This essentially allows me to do an overall check general check by running the tests using pytest's `-k basic` syntax. Given that I like running tests often and that, in general, I make typos more often than changes that break core functionality, I think this will reduce cycle times for me.
2017-12-16 23:43:46 +05:30
Pradyun Gedam 353a13ddff
isort: Include trailing commas 2017-11-21 13:23:59 +05:30
Benoit Pierre d778fc330e Small tests related cleanups (#4703)
* fix test not using temporary directory
* avoid creating a `cache_dir` directory in the source tree
* drop `data` fixture from tests that don't use it

* tests: fix pytest warning
2017-10-02 18:33:52 +01:00
Donald Stufft 95bcf8c5f6 Move all internal APIs to pip._internal 2017-08-31 14:53:00 -04:00
Pradyun S. Gedam 9923c1ad7e Sort imports and minor Flake8 changes (#4520)
* Run isort on the codebase

Command: isort --recursive --skip __main__.py --skip _vendor -o pip._vendor -sd THIRDPARTY -m 5 -p pip -p tests ./pip ./tests

* 📰
2017-06-13 14:17:00 +02:00
Pradyun S. Gedam 1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
Igor Kuzmitshov 2bdc93dd7b Fix the latest version number in search results
When listing found packages, `print_results()` uses the last version in
the versions list of a package, but that version is not necessarily the
latest. For example, `SearchCommand.search()` may return the following
(tested with JFrog Artifactory PyPI repo):

    pypi_hits = command.search(args, options)

    [{'_pypi_ordering': 1,
      'name': 'testlib',
      'summary': 'Test library.',
      'version': '1.0.5'},
     {'_pypi_ordering': 0,
      'name': 'testlib',
      'summary': 'Test library.',
      'version': '1.0.3'}]

`pip.commands.search.transform_hits()` preserves the order of versions:

    hits = pip.commands.search.transform_hits(pypi_hits)

    [{'name': 'testlib',
      'summary': 'Test library.',
      'versions': ['1.0.5', '1.0.3']}]

`pip.commands.search.print_results()` uses the last version in the list:

    pip.commands.search.print_results(hits)

    testlib (1.0.3)  - Test library.

Expected result:

    testlib (1.0.5)  - Test library.

`print_results()` uses `highest_version()` already to compare the
installed version with the latest found version (for installed
packages). Same function is used in this fix to show the latest
versions of all found packages.
2017-01-09 23:43:29 +00:00
Donald Stufft 765d52e6bd Let the search service handle search order (#4044) 2016-10-30 15:17:10 -04:00
Pradyun e04941bba2 Update http urls to use https instead (#3808) 2016-06-22 14:06:28 -04:00
Ville Skyttä 0da18e93b3 Spelling fixes 2015-12-27 00:58:23 +02: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
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
Donald Stufft 638160a2ac Expect this test to fail until PyPI is fixed 2015-09-02 22:44:18 -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 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 6b3be72991 Switch from using cmp to using sorted() with a key func 2014-09-11 19:22:52 -04:00
Antonio Alvarado Hernandez 57f2d47b84 Proposed fix to #1180 (and maybe #932 & #1104)
This is a rebased final version of a proposed solution to fix
issues #932, #1104 & #1180. Following changes have been done:

* Implemented a new class `PipXmlrpcTransport` using a
  contained `PipSession` object.

* Modified the `pip/commands/search.py` to make use of the
  `PipXmlrpcTransport` class.

* Properly initialized options for testing `SearchCommand`:
  - Changed `options_mock` to an `options` object built from
    `parse_args`, to properly initialize default options.
2014-06-28 00:26:40 +02:00
Alex Gaynor b48b9ce53f Resolve several typos in the codebase 2014-04-29 22:33:04 -07:00
Donald Stufft 9f027337a8 Use Flake8 on the test of pip's Python files 2014-01-28 19:47:58 -05:00
Marcus Smith 15910f573e define options once, but don't globally instantiate 2013-09-16 22:21:15 -07:00
Marcus Smith d21d0e434e 1) have `create_main_parser` construct the parser description.
2) have `create_main_parser` mark the parser as the 'main' parser.
3) remove an extraneus block that's never called.  thanks @netspyer.
4) move 'create_main_parser` to __init__ to avoid circular or embedded imports.
2013-09-15 21:28:19 -07: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
Marcus Smith ff1a79381a test changes due to virtualenv not using distribute 2013-06-13 22:43:26 -07:00
Marcus Smith 2e2ce0f4e9 break up tests dir into data, unit tests, and functional tests 2013-05-29 13:41:12 -07:00
Renamed from tests/test_search.py (Browse further)