azure-sdk-trim
Simple Python script to purge mostly useless Azure SDK API versions.
The Azure SDK for python is 1.2GB and growing. The main reason for the size and growth is that each release gets added internally and all prior releases are kept. This is a troublesome design that does not seem to be fully addressed in the near future. The logic deletes most but not all older API versions as multiple API versions can import prior versions, and the azure cli can point directly at older, preview, versions. This approach keeps a high compatibility level while trimming half of the space used.
The 0.2.2 release has been tested with Python 3.12.2, azure-cli 2.59.0 where the azure sdk is 1.2GB and the trimmed version is about 600MB. We unittest against python versions 3.8 to 3.12 on macOS, Linux and Windows.
So Long & Thanks For All The Fish.
Installation
This script is not published on pypi.org but you can either download the script as a standalone script or pip install it from github directly:
wget https://raw.githubusercontent.com/clumio-code/azure-sdk-trim/main/azure_sdk_trim/azure_sdk_trim.py
pip install git+https://github.com/clumio-code/azure-sdk-trim@v0.2.0#egg=azure-sdk-trim
Caveats
While most third party packages that use the Azure SDK do not point to older APIs explicitly, some do which can lead to issues.
If you use a third party package that points to a specific version that got deleted, then you will experience runtime failures. A temporary workaround can be to create a symlink to point the old version folder to a newer version. This usually works but could lead to unsuspected behavior. As such, we do not intend to add symlinks automatically. We recommend filing bugs against the upstream maintainers so that they stop pointing to obsolete APIs versions.
We use newer Python syntax, so py3.12 is recommended, but the code can be modified for backward compatibility with older python versions if needed. We will not accept any PR to add support for unsupported versions of Python (anything older than 3.8 as of this writing).
Style Guide
We follow the Google Python Style Guide
with a few distinctions. We use 100 characters width and prefer single quotes
over double quotes for regular string declarations. Triple quoting is always
done with double quotes: """A docstring.""""
For most of the formatting, we rely on Gray configured to use Black.
Please run gray . and make test mypy pylint, before submitting any PR.
Disclaimer
This project is not affiliated with Microsoft or the Azure SDK maintainers.
Links
Metadata
Release files for azure-sdk-trim 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| azure-sdk-trim-0.2.2.tar.gz | 18.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azure_sdk_trim-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.3 kB
Release files / azure-sdk-trim-0.2.2.tar.gz
| Download URL | azure-sdk-trim-0.2.2.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe6544d05827a0a999cee53059a4dc4edad5c933e962ed3ca90910cc478ec045
|
|
BLAKE2b-256 checksum How to use checksums |
cfd5acf3383815706bc92146594851f954bc9b10f59b8334779d9bfb2fba0f24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / azure_sdk_trim-0.2.2-py3-none-any.whl
| Download URL | azure_sdk_trim-0.2.2-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbc05adf6dd2f207872b754d0b4965a7861d73c1d0e53d0de36141e668c4158c
|
|
BLAKE2b-256 checksum How to use checksums |
a47aff464b6aa3d51f516fc48444eaa4e752c70d2bb3761d67a84fce0f63c2e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for azure-sdk-trim 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.