2121import  unittest 
2222from  pathlib  import  Path 
2323
24- print ("sys.path:" )
25- for  i , x  in  enumerate (sorted (sys .path )):
26-     print (x )
27- 
28- raise  SystemExit (1 )
29- 
30- from  rules_python .python .runfiles  import  runfiles 
24+ from  python .runfiles  import  runfiles 
3125
3226
3327class  PipRepositoryAnnotationsTest (unittest .TestCase ):
@@ -41,7 +35,7 @@ def wheel_pkg_dir(self) -> str:
4135    def  test_build_content_and_data (self ):
4236        r  =  runfiles .Create ()
4337        rpath  =  r .Rlocation (
44-             "pip_repository_annotations_example/external/ {}/generated_file.txt" .format (
38+             "{}/generated_file.txt" .format (
4539                self .wheel_pkg_dir ()
4640            )
4741        )
@@ -54,7 +48,7 @@ def test_build_content_and_data(self):
5448    def  test_copy_files (self ):
5549        r  =  runfiles .Create ()
5650        rpath  =  r .Rlocation (
57-             "pip_repository_annotations_example/external/ {}/copied_content/file.txt" .format (
51+             "{}/copied_content/file.txt" .format (
5852                self .wheel_pkg_dir ()
5953            )
6054        )
@@ -67,7 +61,7 @@ def test_copy_files(self):
6761    def  test_copy_executables (self ):
6862        r  =  runfiles .Create ()
6963        rpath  =  r .Rlocation (
70-             "pip_repository_annotations_example/external/ {}/copied_content/executable{}" .format (
64+             "{}/copied_content/executable{}" .format (
7165                self .wheel_pkg_dir (),
7266                ".exe"  if  platform .system () ==  "windows"  else  ".py" ,
7367            )
@@ -88,7 +82,7 @@ def test_data_exclude_glob(self):
8882        current_wheel_version  =  "0.38.4" 
8983
9084        r  =  runfiles .Create ()
91-         dist_info_dir  =  "pip_repository_annotations_example/external/ {}/site-packages/wheel-{}.dist-info" .format (
85+         dist_info_dir  =  "{}/site-packages/wheel-{}.dist-info" .format (
9286            self .wheel_pkg_dir (),
9387            current_wheel_version ,
9488        )
@@ -119,11 +113,10 @@ def test_extra(self):
119113        # This test verifies that annotations work correctly for pip packages with extras 
120114        # specified, in this case requests[security]. 
121115        r  =  runfiles .Create ()
122-         rpath  =  r .Rlocation (
123-             "pip_repository_annotations_example/external/{}/generated_file.txt" .format (
124-                 self .requests_pkg_dir ()
125-             )
116+         path  =  "{}/generated_file.txt" .format (
117+             self .requests_pkg_dir ()
126118        )
119+         rpath  =  r .Rlocation (path )
127120        generated_file  =  Path (rpath )
128121        self .assertTrue (generated_file .exists ())
129122
0 commit comments