@@ -82,12 +82,11 @@ def check_dist(
82
82
)
83
83
raise e
84
84
for resource_path in resource_paths :
85
- name , _ , rest = resource_path .partition ("/" )
85
+ name , _ , _ = resource_path .partition ("/" )
86
86
test_file = Path (td ) / "test_path.py"
87
87
test_text = f"""
88
- import importlib.resources
89
- with importlib.resources.path('{ name } ','{ rest } ') as resource_path:
90
- assert resource_path.exists()
88
+ from importlib.metadata import PackagePath, files
89
+ assert PackagePath('{ resource_path } ') in files('{ name } ')
91
90
"""
92
91
test_file .write_text (test_text , encoding = "utf-8" )
93
92
test_file = util .normalize_path (test_file )
@@ -124,12 +123,12 @@ def get_pypi_token(release_url, python_package):
124
123
def start_local_pypi ():
125
124
"""Start a local PyPI server"""
126
125
temp_dir = TemporaryDirectory ()
127
- cmd = f"pypi-server -p 8081 -P . -a . -o -v { temp_dir .name } "
128
- proc = Popen (shlex .split (cmd ), stderr = PIPE )
126
+ cmd = f"pypi-server run -p 8081 -P . -a . -o -v { temp_dir .name } "
127
+ proc = Popen (shlex .split (cmd ), stdout = PIPE )
129
128
# Wait for the server to start
130
129
while True :
131
- assert proc .stderr is not None
132
- line = proc .stderr .readline ().decode ("utf-8" ).strip ()
130
+ assert proc .stdout is not None
131
+ line = proc .stdout .readline ().decode ("utf-8" ).strip ()
133
132
util .log (line )
134
133
if "Listening on" in line :
135
134
break
0 commit comments