Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
e13b5fc
create dependency json
lucia-sb Sep 12, 2025
cd9c2eb
typing
lucia-sb Sep 12, 2025
d0f0fdd
order sizes
lucia-sb Sep 12, 2025
0ab6d1e
send metrics
lucia-sb Sep 12, 2025
3a1d897
send metrics
lucia-sb Sep 12, 2025
77a22a0
change on
lucia-sb Sep 12, 2025
05e7206
change on
lucia-sb Sep 12, 2025
6c60125
change on
lucia-sb Sep 12, 2025
915ae41
change on
lucia-sb Sep 12, 2025
58fac6b
change on
lucia-sb Sep 12, 2025
09ae290
change on
lucia-sb Sep 12, 2025
414c32d
change on
lucia-sb Sep 12, 2025
1a0f483
change on
lucia-sb Sep 12, 2025
80e0f15
check files
lucia-sb Sep 12, 2025
fbf217d
check files
lucia-sb Sep 12, 2025
897eb33
check files
lucia-sb Sep 12, 2025
b1fe7fd
check files
lucia-sb Sep 12, 2025
8b4752d
check files
lucia-sb Sep 12, 2025
534f64e
check files
lucia-sb Sep 12, 2025
dfb1b54
check files
lucia-sb Sep 12, 2025
443546a
check files
lucia-sb Sep 12, 2025
132d3d3
check files
lucia-sb Sep 12, 2025
658f89d
measure disk usage
lucia-sb Sep 15, 2025
a8e5286
fix
lucia-sb Sep 15, 2025
df2dfc9
repo
lucia-sb Sep 15, 2025
19b7268
check wf
lucia-sb Sep 15, 2025
817d4a1
check wf
lucia-sb Sep 15, 2025
9d4467f
permissions
lucia-sb Sep 15, 2025
8546397
run_id
lucia-sb Sep 15, 2025
8756ce2
Merge branch 'master' into lucia-sb/calculate-dep-sizes-2
lucia-sb Sep 15, 2025
28fac9a
ddev
lucia-sb Sep 15, 2025
36dbd3e
run_id
lucia-sb Sep 15, 2025
1896c10
permissions
lucia-sb Sep 15, 2025
288b3e8
permissions
lucia-sb Sep 15, 2025
6c53f6c
platforms
lucia-sb Sep 16, 2025
6a9448f
permissions
lucia-sb Sep 16, 2025
61dcb04
run_id
lucia-sb Sep 16, 2025
4bec19b
compressed
lucia-sb Sep 16, 2025
fab6967
Merge branch 'master' into lucia-sb/calculate-dep-sizes-2
lucia-sb Sep 16, 2025
9dc34bf
merge base
lucia-sb Sep 16, 2025
b11e272
remove file
lucia-sb Sep 16, 2025
891bded
test run
lucia-sb Sep 16, 2025
1637bf9
uncomment
lucia-sb Sep 16, 2025
7f0d4d4
Merge branch 'master' into lucia-sb/calculate-dep-sizes-2
lucia-sb Sep 16, 2025
7408a26
changelog
lucia-sb Sep 16, 2025
8572155
build deps folder
lucia-sb Sep 16, 2025
1d0acac
comment build
lucia-sb Sep 16, 2025
a9e63af
change
lucia-sb Sep 17, 2025
8920542
Merge branch 'master' into lucia-sb/calculate-dep-sizes-2
lucia-sb Sep 17, 2025
ef47024
uncomment
lucia-sb Sep 17, 2025
544eeaf
workflow_run
lucia-sb Sep 17, 2025
18615ae
default
lucia-sb Sep 17, 2025
af8aff0
sha
lucia-sb Sep 17, 2025
684a03a
test
lucia-sb Sep 17, 2025
094ce49
dep files
lucia-sb Sep 17, 2025
07c142d
comment
lucia-sb Sep 17, 2025
611e868
tests
lucia-sb Sep 17, 2025
ba9fb8f
comment
lucia-sb Sep 17, 2025
43b422b
spaces
lucia-sb Sep 17, 2025
385f351
test
lucia-sb Sep 17, 2025
bccad63
change metric name
lucia-sb Sep 17, 2025
a866603
Review Changes
lucia-sb Sep 18, 2025
65392bc
Review Changes
lucia-sb Sep 18, 2025
eba6310
Review Changes
lucia-sb Sep 18, 2025
147dd4b
Review Changes
lucia-sb Sep 18, 2025
7dc210f
Review Changes
lucia-sb Sep 18, 2025
a481300
Review Changes
lucia-sb Sep 18, 2025
7e713c5
typing
lucia-sb Sep 18, 2025
4d7bdde
Review Changes
lucia-sb Sep 18, 2025
6d643a6
wip
lucia-sb Sep 19, 2025
1352ebb
Merge branch 'lucia-sb/calculate-dep-sizes-2' into lucia-sb/comment-d…
lucia-sb Sep 19, 2025
9165c05
only one file
lucia-sb Sep 19, 2025
a0e9979
fix
lucia-sb Sep 19, 2025
faaccda
fix
lucia-sb Sep 19, 2025
f246c5c
fix
lucia-sb Sep 19, 2025
54e50b1
test
lucia-sb Sep 23, 2025
ed77fb5
test
lucia-sb Sep 23, 2025
e7c23d0
test
lucia-sb Sep 23, 2025
da27042
config ddev
lucia-sb Sep 23, 2025
fe976ca
test
lucia-sb Sep 23, 2025
b8a15a1
fix
lucia-sb Sep 23, 2025
de26602
fix
lucia-sb Sep 23, 2025
dadad41
config file
lucia-sb Sep 23, 2025
113b012
quiet try
lucia-sb Sep 23, 2025
4fdb0d2
quiet try
lucia-sb Sep 23, 2025
bed5e4d
send metrics
lucia-sb Sep 24, 2025
66e647f
test send metrics
lucia-sb Sep 24, 2025
8760cf2
test commas no quiet
lucia-sb Sep 24, 2025
4ef965f
test commas no quiet
lucia-sb Sep 24, 2025
f46288f
dependency commit
lucia-sb Sep 24, 2025
9771596
get commit data
lucia-sb Sep 24, 2025
bc89959
fix
lucia-sb Sep 24, 2025
6492ebb
switch from config override
lucia-sb Sep 24, 2025
431cdfe
override in set
lucia-sb Sep 24, 2025
babeeb3
comment send metrics
lucia-sb Sep 24, 2025
1a82810
config show
lucia-sb Sep 24, 2025
a7af2d8
debugging prints for config file
lucia-sb Sep 24, 2025
7f301f1
debugging prints for config file
lucia-sb Sep 24, 2025
32044cb
ddev config show
lucia-sb Sep 24, 2025
8a8d985
name the org prod
lucia-sb Sep 24, 2025
7b1c865
remove overrides
lucia-sb Sep 24, 2025
e52b8f2
prints for debugging
lucia-sb Sep 24, 2025
ffc4222
print sent
lucia-sb Sep 24, 2025
ed0853c
override
lucia-sb Sep 24, 2025
98fdc6e
metric version
lucia-sb Sep 24, 2025
9e90c65
change dd api
lucia-sb Sep 25, 2025
8fe657b
ovewrite config
lucia-sb Sep 25, 2025
b843a05
restore --to-dd-key
lucia-sb Sep 25, 2025
93f1331
restore --to-dd-key
lucia-sb Sep 25, 2025
56bf86f
restore --to-dd-key
lucia-sb Sep 25, 2025
03e3b4e
restore --to-dd-key
lucia-sb Sep 25, 2025
56efee6
sending metrics
lucia-sb Sep 25, 2025
ca44795
retry secret
lucia-sb Sep 25, 2025
4f3267a
test comment on PR
lucia-sb Sep 25, 2025
fe63f31
test comment on PR
lucia-sb Sep 25, 2025
3587cea
unify diff and comment
lucia-sb Sep 25, 2025
d616c27
Set dd api key as env variable
AAraKKe Sep 25, 2025
e186961
Inherit secrets
AAraKKe Sep 25, 2025
3024dc2
permissions
lucia-sb Sep 25, 2025
32e071c
remove print
lucia-sb Sep 25, 2025
0c490e9
Merge branch 'master' into lucia-sb/comment-diffs-on-pr
lucia-sb Sep 25, 2025
2b41d5b
filter platform
lucia-sb Sep 25, 2025
d36f9d9
Merge branch 'master' into lucia-sb/comment-diffs-on-pr
lucia-sb Sep 25, 2025
d0f71c5
print sizes to debug
lucia-sb Sep 25, 2025
c43e9df
print commit
lucia-sb Sep 26, 2025
bd0fa04
comment format
lucia-sb Sep 26, 2025
e0aa653
debug print
lucia-sb Sep 26, 2025
dcfacc2
debug print
lucia-sb Sep 26, 2025
177b888
ref on checkout
lucia-sb Sep 26, 2025
0ae8be1
ref on checkout
lucia-sb Sep 29, 2025
664195b
test
lucia-sb Sep 29, 2025
b8be9cd
gh for PR number
lucia-sb Sep 29, 2025
fbafb72
test branch name
lucia-sb Sep 29, 2025
3d81561
branch name
lucia-sb Sep 29, 2025
ca87232
add branch to ticket parsing
lucia-sb Sep 29, 2025
5f6db55
tokens
lucia-sb Sep 30, 2025
fe3a654
tokens
lucia-sb Sep 30, 2025
f163aa1
tokens
lucia-sb Sep 30, 2025
91f2515
tokens
lucia-sb Sep 30, 2025
3fe6d16
remove octo-sts
lucia-sb Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .builders/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import argparse
import json
import os
import shutil
import subprocess
Expand Down Expand Up @@ -153,6 +154,10 @@ def build_macos():
final_requirements = mount_dir / 'frozen.txt'
shutil.move(final_requirements, output_dir)

# Move the dependency sizes to the output directory
dependency_sizes_dir = mount_dir / 'sizes.json'
shutil.move(dependency_sizes_dir, output_dir)


def build_image():
parser = argparse.ArgumentParser(prog='builder', allow_abbrev=False)
Expand Down Expand Up @@ -219,6 +224,7 @@ def build_image():
external_wheels_dir.mkdir()
final_requirements = mount_dir / 'frozen.txt'
final_requirements.touch()
dependency_sizes = mount_dir / 'sizes.json'

script_args = ['--python', args.python]

Expand Down Expand Up @@ -246,6 +252,9 @@ def build_image():
# Move the final requirements file to the output directory
shutil.move(final_requirements, output_dir)

# Move the dependency sizes to the output directory
shutil.move(dependency_sizes, output_dir)


def main():
if sys.platform == 'darwin':
Expand Down
58 changes: 47 additions & 11 deletions .builders/scripts/build_wheels.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from __future__ import annotations

import argparse
import json
import os
import subprocess
import sys
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import TypedDict
from zipfile import ZipFile

from dotenv import dotenv_values
from utils import extract_metadata, normalize_project_name
Expand All @@ -14,6 +17,10 @@
CUSTOM_EXTERNAL_INDEX = f'{INDEX_BASE_URL}/external'
CUSTOM_BUILT_INDEX = f'{INDEX_BASE_URL}/built'

class WheelSizes(TypedDict):
compressed: int
uncompressed: int

if sys.platform == 'win32':
PY3_PATH = Path('C:\\py3\\Scripts\\python.exe')
PY2_PATH = Path('C:\\py2\\Scripts\\python.exe')
Expand Down Expand Up @@ -55,6 +62,13 @@ def check_process(*args, **kwargs) -> subprocess.CompletedProcess:
return process


def calculate_wheel_sizes(wheel_path: Path) -> WheelSizes:
compressed_size = wheel_path.stat().st_size
with ZipFile(wheel_path) as zf:
uncompressed_size = sum(zinfo.file_size for zinfo in zf.infolist())
return {'compressed': compressed_size, 'uncompressed': uncompressed_size}


def main():
parser = argparse.ArgumentParser(prog='wheel-builder', allow_abbrev=False)
parser.add_argument('--python', required=True)
Expand Down Expand Up @@ -109,9 +123,14 @@ def main():

# Fetch or build wheels
command_args = [
str(python_path), '-m', 'pip', 'wheel',
'-r', str(MOUNT_DIR / 'requirements.in'),
'--wheel-dir', str(staged_wheel_dir),
str(python_path),
'-m',
'pip',
'wheel',
'-r',
str(MOUNT_DIR / 'requirements.in'),
'--wheel-dir',
str(staged_wheel_dir),
# Temporarily removing extra index urls. See below.
# '--extra-index-url', CUSTOM_EXTERNAL_INDEX,
]
Expand All @@ -124,21 +143,38 @@ def main():
check_process(command_args, env=env_vars)

# Repair wheels
check_process([
sys.executable, '-u', str(MOUNT_DIR / 'scripts' / 'repair_wheels.py'),
'--source-dir', str(staged_wheel_dir),
'--built-dir', str(built_wheels_dir),
'--external-dir', str(external_wheels_dir),
])
check_process(
[
sys.executable,
'-u',
str(MOUNT_DIR / 'scripts' / 'repair_wheels.py'),
'--source-dir',
str(staged_wheel_dir),
'--built-dir',
str(built_wheels_dir),
'--external-dir',
str(external_wheels_dir),
]
)

dependencies: dict[str, tuple[str, str]] = {}
sizes: dict[str, WheelSizes] = {}

for wheel_dir in wheels_dir.iterdir():
for entry in wheel_dir.iterdir():
project_metadata = extract_metadata(entry)
for wheel in wheel_dir.iterdir():
project_metadata = extract_metadata(wheel)
project_name = normalize_project_name(project_metadata['Name'])
project_version = project_metadata['Version']
dependencies[project_name] = project_version


project_sizes = calculate_wheel_sizes(wheel)
sizes[project_name] = {'version': project_version, **project_sizes}

output_path = MOUNT_DIR / 'sizes.json'
with output_path.open('w', encoding='utf-8') as fp:
json.dump(sizes, fp, indent=2, sort_keys=True)

final_requirements = MOUNT_DIR / 'frozen.txt'
with final_requirements.open('w', encoding='utf-8') as f:
for project_name, project_version in sorted(dependencies.items()):
Expand Down
Loading
Loading