Skip to content

Commit f0afead

Browse files
committed
Leave __init__.py contrib files.
1 parent 4933d7e commit f0afead

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ RUN find . -name "*.dist-info" -type d | xargs rm -rf
3333
# https://docs.python.org/3.11/using/cmdline.html#cmdoption-O
3434
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONNODEBUGRANGES
3535
RUN PYTHONNODEBUGRANGES=1 python -OO -m compileall -b ./python/lib/$runtime/site-packages
36-
RUN find ./python/lib/$runtime/site-packages -name \*.py -delete
36+
# remove all .py files except ddtrace/contrib/*/__init__.py which are necessary
37+
# for ddtrace.patch to discover instrumationation packages.
38+
RUN find ./python/lib/$runtime/site-packages -name \*.py | grep -v ddtrace/contrib | xargs rm -rf
39+
RUN find ./python/lib/$runtime/site-packages/ddtrace/contrib -name \*.py | grep -v __init__ | xargs rm -rf
3740
RUN find ./python/lib/$runtime/site-packages -name __pycache__ -type d -exec rm -r {} \+
3841

3942
FROM scratch

0 commit comments

Comments
 (0)