File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# This is for running publishing tests
2- pypiserver
2+ pypiserver>=2.2.0
Original file line number Diff line number Diff line change 44#
55# bazel run //examples/wheel:requirements_server.update
66#
7- pypiserver==2.0.1 \
8- --hash=sha256:1dd98fb99d2da4199fb44c7284e57d69a9f7fda2c6c8dc01975c151c592677bf \
9- --hash=sha256:7b58fbd54468235f79e4de07c4f7a9ff829e7ac6869bef47ec11e0710138e162
7+ importlib-resources==7.1.0 \
8+ --hash=sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708 \
9+ --hash=sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1
10+ # via pypiserver
11+ packaging==26.1 \
12+ --hash=sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f \
13+ --hash=sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de
14+ # via pypiserver
15+ pypiserver==2.4.1 \
16+ --hash=sha256:156540f87ecfd6db06ae2c16e25ae5afe4fda6f510bd1c34e46fbb0c491bcd9e \
17+ --hash=sha256:45f116d0bff6aafcaed002cfad48a6832e62a82393e3a9b447d5c41a0e310fff
1018 # via -r examples/wheel/requirements_server.in
1119
1220# The following packages are considered to be unsafe in a requirements file:
Original file line number Diff line number Diff line change 66import unittest
77from contextlib import closing
88from pathlib import Path
9+ from urllib .error import URLError
910from urllib .request import urlopen
1011
1112
@@ -50,17 +51,16 @@ def setUp(self):
5051 ],
5152 )
5253
53- line = "Hit Ctrl-C to quit"
5454 interval = 0.1
5555 wait_seconds = 40
5656 for _ in range (int (wait_seconds / interval )): # 40 second timeout
57- current_logs = self . log_file . read_text ()
58- if line in current_logs :
59- print ( current_logs . strip ())
60- print ( "..." )
61- break
62-
63- time .sleep (0.1 )
57+ try :
58+ with urlopen ( self . url , timeout = 1 ) as response :
59+ if response . status == 200 :
60+ break
61+ except ( URLError , OSError ):
62+ pass
63+ time .sleep (interval )
6464 else :
6565 raise RuntimeError (
6666 f"Could not get the server running fast enough, waited for { wait_seconds } s"
@@ -98,13 +98,15 @@ def test_upload_and_query_simple_api(self):
9898 got_content = response .read ().decode ("utf-8" )
9999 want_content = """
100100<!DOCTYPE html>
101- <html>
101+ <html lang="en" >
102102 <head>
103+ <meta charset="utf-8">
104+ <meta name="viewport" content="width=device-width, initial-scale=1">
103105 <title>Links for example-minimal-library</title>
104106 </head>
105107 <body>
106108 <h1>Links for example-minimal-library</h1>
107- <a href="/packages/example_minimal_library-0.0.1-py3-none-any.whl#sha256=ef5afd9f6c3ff569ef7e5b2799d3a2ec9675d029414f341e0abd7254d6b9a25d">example_minimal_library-0.0.1-py3-none-any.whl</a><br>
109+ <a href="/packages/example_minimal_library-0.0.1-py3-none-any.whl#sha256=ef5afd9f6c3ff569ef7e5b2799d3a2ec9675d029414f341e0abd7254d6b9a25d">example_minimal_library-0.0.1-py3-none-any.whl</a><br>
108110 </body>
109111</html>"""
110112 self .assertEqual (
You can’t perform that action at this time.
0 commit comments