Skip to main content

Maintain your code

Project description

maintenance

This library provides utilities to easily deprecate code, without manually setting up the warnings. If your project uses experimental feautures, this library might be useful as well.

Installation

pip install maintenance.py

Usage

from maintenance import deprecated, experimental

class MyClass:
    def matches_pep8_convention(self, arg):
        self.arg = arg
        print(arg)
    
    @deprecated(
        "New method matches pep8 convention.",
        new = "matches_pep8_convention",
        since = "1.2.3",
    )
    def doesNotMatchPep8Convention(self, arg):
        return self.matches_pep8_convention(arg)
    
    @experimental(
        "Can only be used when `matches_pep8_convention` was previously used.",
        stable_in = "2.0.0"
    )
    def might_break(self):
        print(self.arg)

Both functions deprecated and experimental only have optional parameters.

Parameters for deprecated

message

Optional message providing extra information.

new

The new object, that is intended to use. May be a python object or a string.

since

A version number since when this object is deprecated.

Parameters for experimental

message

Optional message providing extra information.

stable_in

Version number, when the object is expected to be stable.

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

maintenance.py-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maintenance.py-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file maintenance.py-0.1.0.tar.gz.

File metadata

  • Download URL: maintenance.py-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for maintenance.py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7a511e87004ad364f61ad4b020c14924aa495828dbc85df2e6a992600dab4b0
MD5 d20ea2add494aa5656fe532bb65f7f26
BLAKE2b-256 7cff85297c4b601a0769c027b8a30a775c040e32e7f994a5eb81a7eb9e535f86

See more details on using hashes here.

File details

Details for the file maintenance.py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: maintenance.py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for maintenance.py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b022fc6b51474be3a7c0d3cb1d9799f834c55a70e48fbe1b6e06c65117fbdca
MD5 912f60aa4ebc8843cff2c013054a9189
BLAKE2b-256 abcbe6123bc1d1561abe885346dcb553ddfda3f5fa0016d76013592b193447ef

See more details on using hashes here.

Supported by

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