Azure / Azure/azure-cli

deb package releases are including __pycache__ dirs and substantially large

Open
#17,900 3 comments 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad feature-request Packaging
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**
The `.deb` packages at https://packages.microsoft.com/repos/azure-cli/ are not pruned of `__pycache__` directories, contributing 350MB of the package size or 41%.

This makes container image layers which install `az` significantly larger than it needs to be.

**To Reproduce**
Download and extract `.deb` package
```bash
wget 'https://packages.microsoft.com/repos/azure-cli/pool/main/a/azure-cli/azure-cli_2.22.1-1~buster_all.deb'
ar -x azure-cli_2.22.1-1~buster_all.deb
mkdir root
tar -xJf data.tar.xz -C root/
```

Calculate size contributed by `__pycache__/` directories:
```
$ du -csh $(find root/ -name '__pycache__') | grep total
350M total
```

Total size:
```
$ du -sh root/
859M root
```

**Expected behavior**
```
$ find root/ -name '__pycache__' | wc -l
0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.