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

61 commits

Author SHA1 Message Date
Tzu-ping Chung 2fad07e6e2 Merge branch 'main' into no-import-from-conftest 2023-10-03 16:11:30 +08:00
Shantanu eddd9ddb66
Enable mypy's strict equality checks (#12209)
This makes mypy check more behaviours within the codebase.

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2023-09-23 17:10:13 +01:00
Christian Clauss 69a1e956da Ruff rules C4,C90,PERF 2023-08-28 14:51:13 +02:00
Felipe Peter e8b4bae05e Remove superfluous "together" 2023-05-21 00:29:06 +08:00
Felipe Peter 00ddca8bae Merge remote-tracking branch 'upstream/main' into fix-docs-for-pip-list-outdated-with-freeze-format 2023-05-21 00:25:32 +08:00
Tzu-ping Chung c3160c5423 Avoid importing things from conftest
It is generally discouraged to import from conftest. Things are now
moved to tests.lib and imported from there instead.

Also did some cleanup to remove the no-longer-needed nullcontext shim.
2023-05-09 15:43:53 +08:00
Stéphane Bidoul 3fd8fde14b Remove with_wheel fixture
We install wheel by default in our test env.
2023-03-27 11:55:20 +01:00
Tzu-ping Chung 50e194f107 Selectively enable user site
The modern virtual environment structure does not allow us to enable
"fake user site" while disabling the global site, so we need to do more
fine-grained configuration to correctly set up test environments for
each test case.

With this done, we can also properly support the stdlib venv ad the test
environment backend, since it basically works identically with modern
virtualenv. The incompatible_with_test_venv is thus removed.
2022-10-28 01:51:13 +08:00
Felipe Peter fdc262f069 Fix error message and improve help text 2022-10-19 14:47:27 +08:00
Felipe Peter e6e7c12b6d
Disallow freeze format with pip list --outdated (#11482)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2022-10-04 10:11:46 +01:00
Stéphane Bidoul 3f5436cf3d
Use installer instead of setuptools in test suite
Instead of using a private setuptools api to
install common wheels in "editable" mode,
use 'installer' together with a .pth.
2022-07-23 16:22:02 +02:00
q0w c8c88ce520 Adapt tests 2022-06-23 19:20:18 +03:00
Tzu-ping Chung 42359a9605 Migrate tests to use pathlib.Path
The pip-specific Path implementation has been removed, and all its
usages replaced by pathlib.Path. The tmpdir and tmpdir_factory fixtures
are also removed, and all usages are replaced by tmp_path and
tmp_path_factory, which use pathlib.Path.

The pip() function now also accepts pathlib.Path so we don't need to put
str() everywhere. Path arguments are coerced with os.fspath() into str.
2022-06-08 19:58:46 +08:00
Jon Dufresne c71cf88049 Complete type annotations of tests/functional/ directory 2021-11-18 18:26:17 -08:00
Stéphane Bidoul d251b4bf94
Add editable project location to pip list output 2021-09-21 11:18:00 +02:00
Pradyun Gedam 585037a80a
Cleanup implicit string concatenation 2021-08-20 13:37:52 +01:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
Tzu-ping Chung ead43d674d Add method to access the raw project name 2021-07-22 15:20:49 +08:00
Tzu-ping Chung ef8299d559 pip list now normalizes the project name 2021-07-12 11:44:23 +08:00
Xavier Fernandez 9725229888 Add --exclude option to pip freeze and pip list commands 2020-10-30 21:50:59 +01:00
Devesh Kumar Singh 528a193dda Fix incorrect comment in tests 2020-04-10 19:02:57 +05:30
Devesh Kumar Singh 2324ae422e Add unit tests for pip commands not using cwd 2020-04-05 23:17:03 +05:30
Devesh Kumar Singh feac595446 Don't use cwd in python -m pip command 2020-04-05 19:59:05 +05:30
Pradyun Gedam 8981895b5e
Skip all failing tests when using venv
Our isolation logic for venv isn't correct and that is causing these
tests to fail. The culprits for this are:

  tests/lib/venv.py::VirtualEnvironment.user_site_packages
  tests/lib/venv.py::VirtualEnvironment.sitecustomize

Both these together are supposed to create an environment to isolate the
tests. However, they were written for virtualenv and make assumptions
that are not true for environments created with venv. Until we can fix
VirtualEnvironment to properly isolate the test from the underlying test
environment when using venv, these tests will continue to fail.

This is blocking an important bugfix for users facing issues with since
pip is installing packages into `--user` when run in a venv, even when
`--user` isn't visible from that environment.

As a temporary band-aid for this problem, I'm skipping these tests to
unblock us from shipping the bugfix for the aforementioned issue.

The test isolation logic should be fixed to work for venv. Once such a
fix is made, this commit should be reverted.
2019-11-05 23:02:45 +05:30
Chris Hunt 0c4625b2ba Use another shared script in pip list tests 2019-10-30 02:16:23 -04:00
Chris Hunt 6cd9852626 Use shared script in pip list tests 2019-10-30 01:55:32 -04:00
Pradyun Gedam fc976bb32b
Utilize "pip_install_local" where possible 2019-07-29 14:27:28 +05:30
Chris Hunt 39ac9ca351 Rename compatible functions in tests.lib.path.Path. 2019-07-02 18:48:44 -04:00
Laszlo Kiss-Kollar a240a98701 Add --path option to pip list
This makes `pip list` consistent with `pip freeze` which also supports
listing packages in arbitrary file paths.
2019-06-12 16:10:06 +02:00
Peter Lisák 1a87e577d0 Add comments 2019-01-07 17:10:08 +01:00
Peter Lisák 4f35981085 pip list --not-required --outdated should list only outdated packages that are not dependencies of installed packages 2019-01-06 10:05:44 +01:00
Benoit Pierre add3801163 tests: rework tests virtual environment
- cleanup virtualenv creation code
- ensure all testing virtual environments use a recent version
  of setuptools / wheel, making it easier to switch to custom
  versions of those, as well as reducing network accesses
- reduce size of testing virtual environment, slightly speeding
  up the testsuite
2018-10-18 23:28:37 +02:00
Pradyun Gedam 52782f0547
Remove the "legacy" format for 'pip list' 2018-06-21 21:19:17 +05:30
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
Thomas Kluyver 20955812bf Merge branch 'master' into pep518 2017-05-19 11:04:32 +01:00
Pradyun S. Gedam 1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
Thomas Kluyver 9c7ed29009 Fix some more tests which build packages from source 2017-05-13 23:47:17 +01:00
luojiebin d0c0cc9e80 Fixed issue #949 (#4414)
* Showed installers when list command runs with -vv option

* Added news entry

* Updated code to show both location and installer of a package when '-v' is used

* Removed installer from freeze format

* Moved get_installer function to pip.utils.packaging
2017-04-06 15:16:18 +02:00
Luo Jiebin 5394bc744f Added test for verbose option of list command 2017-04-02 19:00:50 +08:00
Donald Stufft 0b1f521059 Switch the default for pip list to the columns format 2017-03-20 10:49:56 -04:00
Atsushi Odagiri ee345ef37b add exclude-editable option to list command (#4016)
* added exclude-editable option to list command

* added include-editable option

* added functional test

* added changes
2017-01-31 13:06:47 +01:00
Donald Stufft 7f1c180e70 Correct the setting name in pip list format deprecation (#4069) 2016-11-03 18:36:56 -04:00
Donald Stufft 81a5bcf7cd Misc updates (#4056)
* Update AUTHORS.txt

* Remove --columns which has been superseded by --format=columns
2016-11-02 14:08:37 -04:00
nvdv 88d2bd8165 Rename --no-deps-only to --not-required. 2016-10-05 15:03:03 +03:00
nvdv bb896cb44c Add functional test for 'list --no-deps-only' option. 2016-09-30 15:07:10 +03:00
Jakub Wilk 6dc28c1b31 Fix typos 2016-06-10 21:29:43 +02:00
Xavier Fernandez 1e8b6c2fe7 Improve tests
Demote "Ignoring indexes" log to DEBUG to enable stdout JSON parsing
2016-05-19 15:31:46 +02:00
Xavier Fernandez 5bbc73d145 Add --format option to pip list
with legacy, columns, freeze and json formats
2016-05-19 15:31:46 +02:00
Douglas Thor 6dcd9dac2e Added --columns, --no-columns option to pip list. Fixes #3651 (#3654) 2016-05-12 13:13:48 -04: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