Skip to content

Commit dc694be

Browse files
authored
(fleet) remove ensurepip from embedded Python (#52526)
## Summary This PR removes the `ensurepip` module from the embedded Python during the omnibus finalize step. `ensurepip` is the module Python uses to bootstrap `pip` into an environment that doesn't have it. The shipped package already includes a fully installed `pip`, so `ensurepip` is unused at runtime and can be dropped from the artifact. ## Size impact Reduces the on-disk package size by **~1.8 MB**. It is removed in `omnibus/config/software/datadog-agent-finalize.rb` alongside the other embedded-Python size reductions, using a version-independent glob so it keeps working across Python upgrades. Co-authored-by: arthur.bellal <arthur.bellal@datadoghq.com>
1 parent d9c4bad commit dc694be

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

omnibus/config/software/datadog-agent-finalize.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@
144144
# removing the local folder to reduce package size by ~0.5MB
145145
delete "#{install_dir}/embedded/share/locale"
146146

147+
# removing ensurepip from the embedded Python to reduce package size by ~1.8MB
148+
delete "#{install_dir}/embedded/lib/python*/ensurepip"
149+
147150
# Drop bundled unit-test directories from embedded Python wheels/deps (not used at agent runtime).
148151
# Deepest paths first so nested tests/ trees are removed safely.
149152
command "find #{install_dir}/embedded/lib -path '*/site-packages/*' -depth -type d -name tests -exec rm -rf {} +"

0 commit comments

Comments
 (0)