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

40 commits

Author SHA1 Message Date
Tzu-ping Chung 99bea32523 Merge branch 'main' into extra-normalization 2023-09-12 16:16:43 +08:00
Tzu-ping Chung c94d81a36d Setuptools now implements proper normalization 2023-09-12 16:00:40 +08:00
Tzu-ping Chung dc188a87e4 Skip test failing on new Python/setuptools combo
This is a temporary measure until we fix the importlib.metadata backend.
2023-09-12 14:29:53 +08:00
Tzu-ping Chung b9066d4b00 Add test cases for normalized weird extra 2023-05-11 13:00:47 +08:00
Tzu-ping Chung 21857784d6 Implement PEP 685 extra normalization in resolver
All extras from user input or dependant package metadata are properly
normalized for comparison and resolution. This ensures requests for
extras from a dependant can always correctly find the normalized extra
in the dependency, even if the requested extra name is not normalized.

Note that this still relies on the declaration of extra names in the
dependency's package metadata to be properly normalized when the package
is built, since correct comparison between an extra name's normalized
and non-normalized forms requires change to the metadata parsing logic,
which is only available in packaging 22.0 and up, which pip does not use
at the moment.
2023-04-26 12:53:24 -06:00
Jon Dufresne c71cf88049 Complete type annotations of tests/functional/ directory 2021-11-18 18:26:17 -08:00
Tzu-ping Chung ad9b041650 Don't skip extra-merging test on 2020 resolver 2021-09-30 01:37:22 +08:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
briantracy 37a2b12a21
Special case warning for requirements.txt install (#9915)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2021-07-12 11:40:43 +08:00
Andrey Bienkowski 9b2cb894ba Convert more str.format() calls to f-strings 2021-02-13 09:27:17 +03:00
Paul Moore d6a21011b3 Remove support for extras after specifier in requirements 2021-01-23 12:06:44 +00:00
Jon Dufresne cdcf74fb8e Use f-strings for simple string formatting
Use pyupgrade to convert simple string formatting to use f-string
syntax. pyupgrade is intentionally timid and will not create an f-string
if it would make the expression longer or if the substitution parameters
are anything but simple names or dotted names.
2020-12-25 16:21:20 -08:00
Jussi Kukkonen 76b20d738e Deprecate requirements format "base>=1.0[extra]"
This requirements format does not conform to PEP-508. Currently the
extras specified like this work by accident (because _strip_extras()
also parses them). The version checks end up being done with a
misparsed version '1.0[extra]' -- this is not changed in this commit.

Add deprecation warning and fix the corresponding resolver test. Add a
command line test.

Note that we really only check that the Requirement has SpecifierSet
with a specifier that ends in a ']'. A valid version number cannot
contain ']' and no wheels currently on pypi have versions ending in ']'.
2020-07-13 12:33:50 +03:00
Stéphane Bidoul 5e69b8c270
Merge pull request #8326 from ssurbhi560/use_methods_in_tests
Add methods for path lookups in test_install_{extras, index}.py
2020-06-09 22:06:13 +02:00
Tzu-ping Chung 8586098b18 These tests should pass now 2020-05-27 23:18:33 +08:00
Surbhi Sharma 57a0815dd8 use methods for path lookups in files: test_install_{extras, index} 2020-05-27 00:47:00 +05:30
Paul Moore c2fa0dd997 Add a mark for tests that fail on the new resolver 2020-05-21 15:39:00 +01:00
Paul Moore c258a1f517 Fix some test failures related to message differences 2020-05-15 14:17:47 +01:00
Phil Elson bdc886be40 Add xfail tests for case where specifications added as an extra are not honoured. 2020-04-16 05:17:01 +02:00
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Chris Hunt 39ac9ca351 Rename compatible functions in tests.lib.path.Path. 2019-07-02 18:48:44 -04:00
Chris Jerdonek 8d78ff0fce Prefix warning and error log messages. 2019-02-27 03:22:26 -08:00
Benoit Pierre 961737ab98 Fix integration tests on Windows (#4769) 2017-10-06 20:51:42 +01:00
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
Pradyun S. Gedam 1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
Xavier Fernandez e53e2247d9 Canonicalize extras before matching them - Fix issue #3810 (#4037)
Canonicalize InstallRequirement.extras

since dist.extras are already canonicalized, pip needs to canonicalize
extras before matching them with dist.extras

Fixes #3810
2016-10-29 14:25:05 +02: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
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
Donald Stufft a88bc0de73 Send log messages >= logging.WARNING to stderr 2015-04-06 23:11:16 -04: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
derwolfe 97b03f4925 fix test names, non_existant/nonexistent 2015-03-11 07:25:09 -05:00
derwolfe 55585d0ab8 nonexistant/nonexistent - msabramo comment 2015-03-11 07:18:27 -05:00
derwolfe 50237f4fc3 move missing extras functional tests back into test_install_extras 2015-02-25 18:24:04 -06:00
Matej Stuchlik c5024dc851 Mark tests requiring Internet access 2015-01-15 00:53:15 +01:00
MinRK c2e71e7ce6 query installed requirements for extras
fixes issue where egg_info('requires.txt') does not exist
for packages installed from wheels.
2014-06-25 22:45:28 -04:00
Donald Stufft 5a76a47d3b Fix code to handle the latest flake8 2014-03-26 18:24:19 -04:00
Donald Stufft 9f027337a8 Use Flake8 on the test of pip's Python files 2014-01-28 19:47:58 -05: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 28298c413d more functional/unit tests restructure 2013-05-29 13:41:13 -07:00
Renamed from tests/functional/test_extras.py (Browse further)