Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
aports
aports
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 676
    • Issues 676
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 205
    • Merge Requests 205
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • alpine
  • aportsaports
  • Issues
  • #11906

Closed
Open
Opened Aug 31, 2020 by gatopeich@gatopeich

Python3 package includes 23 mb of precompiled files?

I am slightly surprised to find 23 MB worth of .pyc files included in Python 3.8 as packaged for Alpine 3.12;

$ docker run -it alpine:3.12
/ # export PYTHONDONTWRITEBYTECODE=1
/ # apk add python3
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/10) Installing libbz2 (1.0.8-r1)
(2/10) Installing expat (2.2.9-r1)
(3/10) Installing libffi (3.3-r2)
(4/10) Installing gdbm (1.13-r1)
(5/10) Installing xz-libs (5.2.5-r0)
(6/10) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(7/10) Installing ncurses-libs (6.2_p20200523-r0)
(8/10) Installing readline (8.0.4-r0)
(9/10) Installing sqlite-libs (3.32.1-r0)
(10/10) Installing python3 (3.8.5-r0)
Executing busybox-1.31.1-r16.trigger
OK: 53 MiB in 24 packages
/ # du -csh $(find /usr/lib/python3.8 -name __pycache__)|grep M|sort -n
1.2M	/usr/lib/python3.8/asyncio/__pycache__
1.2M	/usr/lib/python3.8/pydoc_data/__pycache__
1.8M	/usr/lib/python3.8/encodings/__pycache__
9.8M	/usr/lib/python3.8/__pycache__
23.2M	total

Also, the 2 variants seem to be present for every module (opt-1, opt-2). Is this intentional?

Is there a supported way to avoid them and let the interpreter compile what is really needed?

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
3.14.0
Milestone
3.14.0
Assign milestone
Time tracking
None
Due date
None
Reference: alpine/aports#11906