Giter Site home page Giter Site logo

surpriso1997 / azure-sdk-trim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clumio-code/azure-sdk-trim

0.0 0.0 0.0 31 KB

Simple Python script to purge mostly useless Azure SDK API versions.

License: Apache License 2.0

Python 88.68% Makefile 11.32%

azure-sdk-trim's Introduction

azure-sdk-trim

PyPI - Version GitHub License

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 published on pypi.org so you can simply install it or add it to your requirements.

pip install azure-sdk-trim

Usage

Simply call the script, it will detect the installed azure sdk and trim it.

azure-sdk-trim

You can pass --help fore more options.

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

azure-sdk-trim's People

Contributors

sodul avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.