@@ -25,11 +25,33 @@ def test_wheel_module(copy_sample):
2525 make_wheel_in (td / 'pyproject.toml' , td )
2626 assert_isfile (td / 'module1-0.1-py2.py3-none-any.whl' )
2727
28+ def test_editable_wheel_module (copy_sample ):
29+ td = copy_sample ('module1_toml' )
30+ make_wheel_in (td / 'pyproject.toml' , td , editable = True )
31+ whl_file = td / 'module1-0.1-py2.py3-none-any.whl'
32+ assert_isfile (whl_file )
33+ with unpack (whl_file ) as unpacked :
34+ pth_path = Path (unpacked , 'module1.pth' )
35+ assert_isfile (pth_path )
36+ assert pth_path .read_text () == str (td )
37+ assert_isdir (Path (unpacked , 'module1-0.1.dist-info' ))
38+
2839def test_wheel_package (copy_sample ):
2940 td = copy_sample ('package1' )
3041 make_wheel_in (td / 'pyproject.toml' , td )
3142 assert_isfile (td / 'package1-0.1-py2.py3-none-any.whl' )
3243
44+ def test_editable_wheel_package (copy_sample ):
45+ td = copy_sample ('package1' )
46+ make_wheel_in (td / 'pyproject.toml' , td , editable = True )
47+ whl_file = td / 'package1-0.1-py2.py3-none-any.whl'
48+ assert_isfile (whl_file )
49+ with unpack (whl_file ) as unpacked :
50+ pth_path = Path (unpacked , 'package1.pth' )
51+ assert_isfile (pth_path )
52+ assert pth_path .read_text () == str (td )
53+ assert_isdir (Path (unpacked , 'package1-0.1.dist-info' ))
54+
3355def test_wheel_src_module (copy_sample ):
3456 td = copy_sample ('module3' )
3557 make_wheel_in (td / 'pyproject.toml' , td )
@@ -41,6 +63,17 @@ def test_wheel_src_module(copy_sample):
4163 assert_isdir (Path (unpacked , 'module3-0.1.dist-info' ))
4264 assert_isfile (Path (unpacked , 'module3-0.1.dist-info' , 'LICENSE' ))
4365
66+ def test_editable_wheel_src_module (copy_sample ):
67+ td = copy_sample ('module3' )
68+ make_wheel_in (td / 'pyproject.toml' , td , editable = True )
69+ whl_file = td / 'module3-0.1-py2.py3-none-any.whl'
70+ assert_isfile (whl_file )
71+ with unpack (whl_file ) as unpacked :
72+ pth_path = Path (unpacked , 'module3.pth' )
73+ assert_isfile (pth_path )
74+ assert pth_path .read_text () == str (td / "src" )
75+ assert_isdir (Path (unpacked , 'module3-0.1.dist-info' ))
76+
4477def test_wheel_src_package (copy_sample ):
4578 td = copy_sample ('package2' )
4679 make_wheel_in (td / 'pyproject.toml' , td )
@@ -51,6 +84,18 @@ def test_wheel_src_package(copy_sample):
5184 print (os .listdir (unpacked ))
5285 assert_isfile (Path (unpacked , 'package2' , '__init__.py' ))
5386
87+ def test_editable_wheel_src_package (copy_sample ):
88+ td = copy_sample ('package2' )
89+ make_wheel_in (td / 'pyproject.toml' , td , editable = True )
90+ whl_file = td / 'package2-0.1-py2.py3-none-any.whl'
91+ assert_isfile (whl_file )
92+ with unpack (whl_file ) as unpacked :
93+ pth_path = Path (unpacked , 'package2.pth' )
94+ assert_isfile (pth_path )
95+ assert pth_path .read_text () == str (td / "src" )
96+ assert_isdir (Path (unpacked , 'package2-0.1.dist-info' ))
97+
98+
5499def test_dist_name (copy_sample ):
55100 td = copy_sample ('altdistname' )
56101 make_wheel_in (td / 'pyproject.toml' , td )
0 commit comments