1
1
"""'pip wheel' tests"""
2
2
import os
3
- import sys
4
- import textwrap
5
3
6
4
from os .path import exists
7
5
8
- from pip .download import path_to_url as path_to_url_d
9
6
from pip .locations import write_delete_marker_file
10
7
from pip .status_codes import PREVIOUS_BUILD_DIR_ERROR
11
- from tests .lib import pyversion , path_to_url
8
+ from tests .lib import pyversion
12
9
13
10
14
11
def test_pip_wheel_fails_without_wheel (script , data ):
@@ -50,6 +47,20 @@ def test_pip_wheel_downloads_wheels(script, data):
50
47
assert "Saved" in result .stdout , result .stdout
51
48
52
49
50
+ def test_pip_wheel_builds_editable_deps (script , data ):
51
+ """
52
+ Test 'pip wheel' finds and builds dependencies of editables
53
+ """
54
+ script .pip ('install' , 'wheel' )
55
+ editable_path = os .path .join (data .src , 'requires_simple' )
56
+ result = script .pip (
57
+ 'wheel' , '--no-index' , '-f' , data .find_links , '-e' , editable_path
58
+ )
59
+ wheel_file_name = 'simple-1.0-py%s-none-any.whl' % pyversion [0 ]
60
+ wheel_file_path = script .scratch / 'wheelhouse' / wheel_file_name
61
+ assert wheel_file_path in result .files_created , result .stdout
62
+
63
+
53
64
def test_pip_wheel_fail (script , data ):
54
65
"""
55
66
Test 'pip wheel' failure.
@@ -70,38 +81,6 @@ def test_pip_wheel_fail(script, data):
70
81
assert result .returncode != 0
71
82
72
83
73
- def test_pip_wheel_ignore_wheels_editables (script , data ):
74
- """
75
- Test 'pip wheel' ignores editables
76
- """
77
- script .pip ('install' , 'wheel' )
78
-
79
- local_wheel = '%s/simple.dist-0.1-py2.py3-none-any.whl' % data .find_links
80
- local_editable = data .packages .join ("FSPkg" )
81
- script .scratch_path .join ("reqs.txt" ).write (textwrap .dedent ("""\
82
- %s
83
- -e %s
84
- simple
85
- """ % (local_wheel , local_editable )))
86
- result = script .pip (
87
- 'wheel' , '--no-index' , '-f' , data .find_links , '-r' ,
88
- script .scratch_path / 'reqs.txt' ,
89
- )
90
- wheel_file_name = 'simple-3.0-py%s-none-any.whl' % pyversion [0 ]
91
- wheel_file_path = script .scratch / 'wheelhouse' / wheel_file_name
92
- assert wheel_file_path in result .files_created , (
93
- wheel_file_path ,
94
- result .files_created ,
95
- )
96
- assert "Successfully built simple" in result .stdout , result .stdout
97
- assert "Failed to build" not in result .stdout , result .stdout
98
- ignore_editable = "ignoring %s" % path_to_url (local_editable )
99
- # TODO: understand this divergence
100
- if sys .platform == 'win32' :
101
- ignore_editable = "ignoring %s" % path_to_url_d (local_editable )
102
- assert ignore_editable in result .stdout , result .stdout
103
-
104
-
105
84
def test_no_clean_option_blocks_cleaning_after_wheel (script , data ):
106
85
"""
107
86
Test --no-clean option blocks cleaning after wheel build
@@ -153,4 +132,4 @@ def test_pip_wheel_fail_cause_of_previous_build_dir(script, data):
153
132
)
154
133
155
134
# Then I see that the error code is the right one
156
- assert result .returncode == PREVIOUS_BUILD_DIR_ERROR
135
+ assert result .returncode == PREVIOUS_BUILD_DIR_ERROR , result
0 commit comments