-
Notifications
You must be signed in to change notification settings - Fork 7
chore: remove python cache artifacts in the images #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This prevents creation of *.pyc files which helps with: - Reducing container size - Making the build reproducible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR disables Python bytecode compilation during pip install to reduce container size and improve build reproducibility.
- Adds
--no-compileflag to the pip install command.
🦙 MegaLinter status:
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 18 | 0 | 0 | 0.5s | |
| ✅ DOCKERFILE | hadolint | 2 | 0 | 0 | 0.81s | |
| ✅ GHERKIN | gherkin-lint | 2 | 0 | 0 | 0.97s | |
| ✅ JSON | npm-package-json-lint | yes | no | no | 0.35s | |
| ✅ JSON | prettier | 16 | 1 | 0 | 0 | 0.44s |
| ✅ JSON | v8r | 16 | 0 | 0 | 8.77s | |
| ✅ MARKDOWN | markdownlint | 9 | 0 | 0 | 0 | 0.84s |
| ✅ MARKDOWN | markdown-table-formatter | 9 | 0 | 0 | 0 | 0.25s |
| ✅ REPOSITORY | checkov | yes | no | no | 16.33s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 0.4s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.01s | |
| grype | yes | no | 2 | 23.4s | ||
| ✅ REPOSITORY | secretlint | yes | no | no | 0.96s | |
| ✅ REPOSITORY | syft | yes | no | no | 2.04s | |
| ✅ REPOSITORY | trivy | yes | no | no | 5.29s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.22s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.2s | |
| ✅ SPELL | lychee | 63 | 0 | 0 | 1.82s | |
| ✅ YAML | prettier | 24 | 0 | 0 | 0 | 0.93s |
| ✅ YAML | v8r | 24 | 0 | 0 | 6.62s | |
| ✅ YAML | yamllint | 24 | 0 | 0 | 0.95s |
See detailed report in MegaLinter reports
📦 Container Size AnalysisComparing 📈 Size Comparison Table
|
📦 Container Size AnalysisComparing 📈 Size Comparison Table
|
…ips-software/amp-devcontainer into feature/disable-pip-compile
|
Pull Request Report (#842)Static measures
Time related measures
Status check related measures
|
|
🎉 Hooray! The changes in this pull request went live with the release of v6.2.0 🎉 |




🚀 Hey, I have created a Pull Request
Description of changes
This PR prevents the creation of Python cache artifacts during build by:
This prevents the creation of
__pycache__folders with*.pycfiles which helps with:There will be a minor penalty on start-up time of Python tools like Conan and GCovr, but this will be offset by the smaller image size. After the first run the files will be created anyway in /cache/.python. And will be persisted if /cache is bind mounted.
✔️ Checklist