Skip to main content

Azure SDK Trim tool

Project description

azure-sdk-trim

Quality Gate Status Bugs Code Smells Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure-sdk-trim-0.2.2.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

azure_sdk_trim-0.2.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file azure-sdk-trim-0.2.2.tar.gz.

File metadata

  • Download URL: azure-sdk-trim-0.2.2.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for azure-sdk-trim-0.2.2.tar.gz
Algorithm Hash digest
SHA256 fe6544d05827a0a999cee53059a4dc4edad5c933e962ed3ca90910cc478ec045
MD5 a2483c9818da9f625baa9f2eee2735b7
BLAKE2b-256 cfd5acf3383815706bc92146594851f954bc9b10f59b8334779d9bfb2fba0f24

See more details on using hashes here.

File details

Details for the file azure_sdk_trim-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_sdk_trim-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cbc05adf6dd2f207872b754d0b4965a7861d73c1d0e53d0de36141e668c4158c
MD5 8b8d137ee11e217986bc44760f872d66
BLAKE2b-256 a47aff464b6aa3d51f516fc48444eaa4e752c70d2bb3761d67a84fce0f63c2e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page