Skip to content

Commit ce97657

Browse files
authored
Trim distlib to only include scripts code (#13342)
Distlib is our largest dependency. The vast majority of that is the Windows stub executables which we can't get rid of. However, distlib is a general purpose low-level packaging library, of which we only use the scripts module. By line count, trimming the parts of distlib that aren't used for scripts results in a 5% reduction in total (`_internal` and `_vendor`) size, which translates to ~250 KB of uncompressed and 64 KB of compressed (wheel) savings.
1 parent a5cd068 commit ce97657

File tree

9 files changed

+2
-6559
lines changed

9 files changed

+2
-6559
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ drop = [
137137
'^pygments/cmdline\.py$',
138138
# trim rich's markdown support
139139
"rich/markdown.py",
140+
# trim parts of distlib that aren't related to scripts
141+
'^distlib/(?!__init__|compat|resources|scripts|util).*\.py$',
140142
]
141143

142144
[tool.vendoring.typing-stubs]

0 commit comments

Comments
 (0)