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

8865 commits

Author SHA1 Message Date
Chris Hunt
281273dac3 Use packaging.tags.generic_tags
As with cpython_tags and compatible_tags, we assume this function covers
our use cases in the no-argument case and will customize our arguments
for it in a few steps.
2020-01-07 19:00:18 -05:00
Chris Hunt
fa1ec40ce0 Remove unused abi3 branch in _generic_tags
Since this function is only called for non-CPython interpreters, the
abi3-related branches are not relevant.
2020-01-07 19:00:14 -05:00
Chris Hunt
1574872162 Inline packaging.tags.cpython_tags 2020-01-07 19:00:09 -05:00
Chris Hunt
56840c30c5 Make packaging.tags.cpython_tags unconditional 2020-01-07 19:00:04 -05:00
Chris Hunt
fecfadb810 Customize platforms for packaging.tags.cpython_tags 2020-01-07 19:00:00 -05:00
Chris Hunt
05045e7903 Customize abis for packaging.tags.cpython_tags 2020-01-07 18:59:55 -05:00
Chris Hunt
147680a613 Customize python_version for packaging.tags.cpython_tags 2020-01-07 18:59:50 -05:00
Chris Hunt
5dbef5debe Use packaging.tags.cpython_tags
We assume this function improves the status quo over the current
`_cpython_tags`, so we use it when no arguments need to be customized.

Since `packaging.tags` has its own tests and derives defaults
differently than pep425tags, we also remove the applicable tests that
were testing against the result of a plain call to
`pep425tags.get_supported()`.
2020-01-07 18:59:44 -05:00
Chris Hunt
e388df6c59 Remove impl from _cpython_tags
We only call this function when the user or platform-provided
implementation is "cp", so we can inline the literal in place of the
parameter. This will make refactoring easier.
2020-01-07 18:57:55 -05:00
Chris Hunt
8f1c60ead0 Only use _cpython_tags for CPython
Since the behavior for both of these functions is the same, there is no
behavior change here. This will let us simplify `_cpython_tags` a bit.
2020-01-07 18:57:50 -05:00
Chris Hunt
b91286c38d Inline packaging.tags.compatible_tags 2020-01-07 18:57:45 -05:00
Chris Hunt
c514c6b35f Make packaging.tags.compatible_tags unconditional 2020-01-07 18:57:41 -05:00
Chris Hunt
2de0b7c560 Customize platforms for packaging.tags.compatible_tags 2020-01-07 18:57:36 -05:00
Chris Hunt
72d00ddcc1 Customize interpreter for packaging.tags.compatible_tags 2020-01-07 18:57:31 -05:00
Chris Hunt
750abcab04 Customize python_version for packaging.tags.compatible_tags 2020-01-07 18:57:26 -05:00
Chris Hunt
4659a78935 Use packaging.tags.compatible_tags
We assume this function improves on our existing behavior, so use it
as-is. We will customize the arguments over the next few commits.

Since packaging.tags internally calculates platforms when not provided,
we skip the tests which patch functions assuming that manylinux
compatibility determination depends on them.
2020-01-07 18:55:26 -05:00
Chris Hunt
480911bc8e Remove unused abi arg from _compatible_tags 2020-01-07 17:00:40 -05:00
Chris Hunt
1c8c481214 Only calculate py-compatible tags in one place
Since `_compatible_tags` is the function that will be responsible for
generating the non-interpreter-specific tags, we remove the
corresponding sections from `_cpython_tags` and `_generic_tags`. The
resulting tags in `get_supported` are equivalent because these were
the last tags to be computed in those functions, and `_compatible_tags`
is executed after them (so any non-duplicate tags it produces will be
last).

To reinforce the reponsibility of `_compatible_tags` we also remove the
abi-related tag generation, which is already handled in `_cpython_tags`
and `_generic_tags`.
2020-01-07 17:00:40 -05:00
Chris Hunt
54db17c976 Use _cpython_tags, _generic_tags, and _compatible_tags
Since these functions are copies of the existing code, there is no
behavior change except each tag will now be present 3 times. To
accommodate this we remove all but the first duplicate tag from the
set of all tags.

We put `_compatible_tags` last because it will provide the lowest
priority tags. The order of `_cpython_tags` and `_generic_tags`
here is not significant - when we start customizing them we will
introduce a condition so that they are mutually exclusive.
2020-01-07 17:00:40 -05:00
Chris Hunt
d386bb2fff Copy get_supported into packaging.tags-like functions
packaging.tags provides a simple `sys_tags` function for getting
applicable tags for the running interpreter, but it does not allow
customization of arguments.

packaging.tags provides three functions for getting custom tags:

1. `cpython_tags` - for CPython only
2. `generic_tags` - for any non-CPython Python implementation
3. `compatible_tags` - tags that are not specific to an interpreter
   implementation

Since pip allows users to provide explicit impl, platform, abi, and
version, we have to use these functions.

`cpython_tags` and `generic_tags` are mutually exclusive, and return tags
that are the highest priority. These capture the most specific tags.

`compatible_tags` are always applicable, and a lower priority since they
may just be compatible with e.g. the Python language version, but lack
any optimizations available in the interpreter-specific tags.

To be able to do a meaningful comparison between our current
implementation and the above functions, we need to segment the pip code
into pieces that look like them.

To that end, we now have copies of the current `get_supported` function,
one for each of the functions provided by packaging.tags, and will walk
through converting them to rely on packaging.tags. For each
simplification step, if desired, we can compare the implementation in
the packaging.tags function with what we're replacing in pip.

Specifically, for each function in turn, we will:

1. Refactor it locally, taking into account its new, more limited,
   responsibilities
2. Introduce the packaging.tags function for the case where there are no
   custom arguments provided
3. Customize arguments one-by-one and delegate to the packaging.tags
   function
4. When there is no pip-specific logic left, remove the intermediate
   function and use the packaging.tags function directly in
   `get_supported`

In the end all these functions will be gone again and we'll be left with
an implementation that relies solely on the tag generation in
packaging.tags.
2020-01-07 17:00:40 -05:00
Chris Hunt
3ada01fb51 Convert return values in pep425tags.get_supported
Now we can incrementally use utility functions from pep425tags without
switching everything at once or converting in multiple places.
2020-01-07 17:00:40 -05:00
Xavier Fernandez
9c64c82186
Merge pull request #7561 from chrahunt/maint/use-packaging-tags-mac-versions
Switch to packaging.tags.mac_version for macOS wheel tag backfilling
2020-01-07 14:39:01 +01:00
Pradyun Gedam
9e910aa81d
Remove AppVeyor (#7564) 2020-01-07 13:27:58 +00:00
Pradyun Gedam
52309f98d1
Merge pull request #7532 from uranusjr/pip-upgrade-prompt-message
Use sys.executable to format upgrade message
2020-01-07 12:34:54 +00:00
Pradyun Gedam
ea27521359
Custom optparse.Option type that calls expanduser (#7534) 2020-01-07 12:26:38 +00:00
Pradyun Gedam
6c515125c2
Merge pradyunsg:revert/6864 into master (#7557)
Revert addition of un-suffixed pip CLI entry points for invocation check on Windows
2020-01-07 08:16:38 +00:00
Chris Hunt
bc20a983da Use packaging.tags.mac_platforms
This function takes care of the version iteration AND architecture
determination internally.
2020-01-07 02:16:57 -05:00
Chris Hunt
687a00b3e1 Sort pep425tags typing imports
Makes the next change easier to review.
2020-01-07 02:16:28 -05:00
Christopher Hunt
1d0eb4625f
Merge pull request #7563 from chrahunt/maint/use-packaging-tags-tag
Use packaging.tags.Tag to represent tag throughout the code
2020-01-07 15:16:00 +08:00
Pradyun Gedam
4ee779f79e
Drop no longer valid tests 2020-01-07 12:25:11 +05:30
Chris Hunt
58f175fdf2 Remove unused format_tag
Since we delegate tag formatting to packaging.tags.Tag, we don't need
this function or its tests.
2020-01-07 01:42:42 -05:00
Chris Hunt
80b2c82d0c Use packaging.tags.Tag in place of Tuple
This is the standard type used by packaging.tags. Making this change
throughout the code lets us start switching over to using its
tag-generating functions in get_supported().

We also get rid of a test, since it was superseded by `__str__` in
packaging.tags.Tag.
2020-01-07 01:42:42 -05:00
Christopher Hunt
f526f13a76
Merge pull request #7562 from chrahunt/maint/use-packaging-tags-interpreter-functions
Use interpreter_name and interpreter_version from packaging.tags
2020-01-07 14:39:54 +08:00
Christopher Hunt
4f7146c71c
Merge pull request #7566 from chrahunt/maint/use-packaging-tags-refactor-platform-list
Extract platform list into separate function in pep425tags
2020-01-07 14:38:26 +08:00
Tzu-ping Chung
9bf6a3b3fb List URL/path options in news 2020-01-07 10:57:34 +05:30
Tzu-ping Chung
32ecd727d5 Rename custom option class for future expansion 2020-01-07 10:50:53 +05:30
Chris Hunt
838d64d865 Extract platform list into separate function
Simplifies get_supported without changing any behavior.
2020-01-06 22:28:55 -05:00
Chris Hunt
927ea8be29 Replace AppVeyor with Azure in CI docs 2020-01-06 19:33:49 -05:00
Chris Hunt
24a9d77e41 Move AppVeyor tests to Azure Pipelines
This will allow us to have CI running concurrently on multiple PRs,
since we get 30 parallel jobs on Azure Pipelines but only 1 on AppVeyor.

We have parameterized --use-venv since AppVeyor was using it, but Azure
Pipelines was previously not.
2020-01-06 19:32:05 -05:00
Chris Hunt
893faa9e44 Replace get_abbr_impl with interpreter_name
This reduces the amount of code we have to manage.

interpreter_name is calculated differently, defaulting to the
long name of the interpreter rather than "cp", but that is more
conformant.
2020-01-06 18:27:51 -05:00
Chris Hunt
4b5614c9e2 Replace get_impl_ver with interpreter_version 2020-01-06 18:27:27 -05:00
Christopher Hunt
902ee9bb34
Merge pull request #7559 from chrahunt/maint/use-packaging-tags-update-vendored
Update vendored library: packaging
2020-01-07 06:03:14 +08:00
Chris Hunt
44b664fd7c Add news 2020-01-06 14:05:08 -05:00
Chris Hunt
c750c1d82a Update packaging to 20.0 2020-01-06 14:04:07 -05:00
Chris Hunt
8460394c47 Update packaging version and include py.typed
Since the new packaging has types, it includes a py.typed. No harm in
including this in our package, and it may facilitate debug tool usage on
an installed pip by signaling that pip._vendor.packaging is
type-annotated.
2020-01-06 14:03:34 -05:00
Pradyun Gedam
5e1455561e
Move should_build filtering to wheel and install commands (#7527) 2020-01-06 14:25:40 +00:00
Pradyun Gedam
d9d801f818
Drop no-suffix checks for pip-from-PATH 2020-01-06 19:29:56 +05:30
Stéphane Bidoul (ACSONE)
5aa3b3d2f0
Remove unused build() argument 2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE)
66e010980a
Remove WheelBuilder
build is now a function
2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE)
f04e6ab7b5
Split should_build test
Separately test should_build_for_wheel_command
and should_buid_for_install_command.
The tests are simpler and this open the door
for reasoning about both functions independently.
2020-01-05 23:52:42 +01:00