Skip to content

Commit 3a6c0cd

Browse files
committed
update build scripts
1 parent d86812e commit 3a6c0cd

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/build.py

+16-7
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ def is_success_build(pkg_name: str, output: str, error: str = None):
3434
for line in output.splitlines():
3535
if any([
3636
error is not None and 'error' not in error,
37-
'successfully installed' in line and pkg_name in line,
38-
'requirement already satisfied' in line and pkg_name in line,
37+
'successfully installed' in line and f' {pkg_name}' in line,
38+
all([
39+
'requirement already satisfied' in line,
40+
f' {pkg_name}' in line,
41+
'from {pkg_name}' not in line,
42+
]),
3943
]):
4044
return True
4145
return False
@@ -142,10 +146,13 @@ def gen_packages(
142146
return packages
143147

144148

145-
def gen_until_index(packages: list, until: str = None):
149+
def gen_until_index(packages: list, until: str = None, since_index: int = 0):
150+
"""
151+
from all index to index of generated packages
152+
"""
146153
if until:
147154
if until.isdigit():
148-
until_index = int(until)
155+
until_index = int(until) - since_index
149156
else:
150157
until_index = packages.index(until)
151158
else:
@@ -166,7 +173,7 @@ def build(
166173

167174
print(f'Building wheels for pypy {ver}...')
168175
packages = gen_packages(plat, since, only, retry, ver)
169-
until_index = gen_until_index(packages, until)
176+
all_packages = gen_packages(plat)
170177
success = []
171178
failed = []
172179

@@ -198,16 +205,18 @@ def build(
198205
if EXTRA_CDN not in pip_conf:
199206
extra_index_flag = f'--extra-index-url {EXTRA_INDEX_URL}'
200207

208+
# since_index is index of all packages
201209
if since:
202210
if since.isdigit():
203211
since_index = int(since)
204212
else:
205-
with open(f'{pkg_dir}/packages.txt', 'r') as f:
206-
all_packages = f.read().splitlines()
207213
since_index = all_packages.index(since)
208214
else:
209215
since_index = 0
210216

217+
# until_index is index of generated packages
218+
until_index = gen_until_index(packages, until, since_index)
219+
211220
env = os.environ
212221
pbar = tqdm(packages, initial=since_index, total=len(packages) + since_index)
213222
count = 0

src/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
build_versions = ['3.7', '3.8', '3.9', '3.10']
2626

27-
LINUX_MAX_LOAD = 4
28-
WIN_MAX_LOAD = 4
27+
LINUX_MAX_LOAD = 16
28+
WIN_MAX_LOAD = 16
2929

3030

3131
# win

0 commit comments

Comments
 (0)