Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
79727994
Commit
79727994
authored
Jan 22, 2020
by
Matthew Brett
Browse files
Refactor to use packaging instead of pip
parent
0b3704f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
common_utils.sh
common_utils.sh
+1
-0
supported_wheels.py
supported_wheels.py
+4
-9
No files found.
common_utils.sh
View file @
79727994
...
@@ -336,6 +336,7 @@ function install_wheel {
...
@@ -336,6 +336,7 @@ function install_wheel {
done <<< "
$TEST_DEPENDS
"
done <<< "
$TEST_DEPENDS
"
fi
fi
# Install compatible wheel
# Install compatible wheel
pip install packaging
pip install
$(
pip_opts
)
$@
\
pip install
$(
pip_opts
)
$@
\
$(
python
$MULTIBUILD_DIR
/supported_wheels.py
$wheelhouse
/
*
.whl
)
$(
python
$MULTIBUILD_DIR
/supported_wheels.py
$wheelhouse
/
*
.whl
)
}
}
...
...
supported_wheels.py
View file @
79727994
...
@@ -6,15 +6,13 @@ from __future__ import print_function
...
@@ -6,15 +6,13 @@ from __future__ import print_function
import
sys
import
sys
from
os.path
import
basename
from
os.path
import
basename
from
packaging.tags
import
sys_tags
try
:
try
:
from
wheel.install
import
WHEEL_INFO_RE
as
wheel_matcher
from
wheel.install
import
WHEEL_INFO_RE
as
wheel_matcher
except
ImportError
:
# As of Wheel 0.32.0
except
ImportError
:
# As of Wheel 0.32.0
from
wheel.wheelfile
import
WHEEL_INFO_RE
from
wheel.wheelfile
import
WHEEL_INFO_RE
wheel_matcher
=
WHEEL_INFO_RE
.
match
wheel_matcher
=
WHEEL_INFO_RE
.
match
try
:
from
pip.pep425tags
import
get_supported
except
ImportError
:
# pip 10
from
pip._internal.pep425tags
import
get_supported
def
tags_for
(
fname
):
def
tags_for
(
fname
):
...
@@ -28,11 +26,8 @@ def tags_for(fname):
...
@@ -28,11 +26,8 @@ def tags_for(fname):
def
main
():
def
main
():
# Up to pip < 20, get_supported() returns a list of tuples; from pip >= 20,
supported
=
{(
tag
.
interpreter
,
tag
.
abi
,
tag
.
platform
)
# it returns a list of packaging.tags.Tag objects. We try to support both.
for
tag
in
sys_tags
()
supported
=
{
(
tag
.
interpreter
,
tag
.
abi
,
tag
.
platform
)
if
not
isinstance
(
tag
,
tuple
)
else
tag
for
tag
in
get_supported
()
}
}
for
fname
in
sys
.
argv
[
1
:]:
for
fname
in
sys
.
argv
[
1
:]:
tags
=
set
(
tags_for
(
fname
))
tags
=
set
(
tags_for
(
fname
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment