Skip to main content

Frappuccino

Project description

Frappucino

Freeze your API.

Frappucino allows you during development to make sure you haven't broken API. By first taking an imprint of your API at one point in time and then compare it to the current project state. The goal is to warn you when incompatible changes have been introduces, and list theses.

You could integrate it in you CI to make sure you don't inadvertently break things.

Example:

# old function
def read(name, *, options=None):
    with open(name, 'rb') as f:
        return process(data)

# new function
def read(name_or_buffer, *, options=None):
    if isinstance(name, str):
        with open(name, 'rb') as f:
            data = f.read()
    else:
        data = name_or_buffer.read()
    return process(data)

There is a subtle breakage of API in the above, as you may not remember positional parameters can be use a keyword arguments. That is to say one of your customer may use:

read(name='dump.csv')

Hence changing the name of the positional parameter from name to name_or_buffer is a change of API. There are a number of details like this one where you may end up breaking API without realizing. It's hard to keep track of this when working on dev branches, unit test may not catch all of that. Frappuccino is there to help.

Example:

$ source activate astropy==3.2
$ frappuccino astropy astropy.timeseries --save    astropy.json

$ source activate astropy=master
$ frappuccino astropy astropy.timeseries --compare astropy.json

The following signatures differ between versions:

      - astropy.time.core.TimeDelta.to(self, *args, **kwargs)
      + astropy.time.core.TimeDelta.to(self, unit, equivalencies='[]')

      - astropy.table.table.Table.add_column(self, col, index='None', name='None', rename_duplicate='False', copy='True')
      + astropy.table.table.Table.add_column(self, col, index='None', name='None', rename_duplicate='False', copy='True', default_name='None')

      - astropy.table.table.Table.replace_column(self, name, col)
      + astropy.table.table.Table.replace_column(self, name, col, copy='True')

Other example

cp frappuccino/tests/old.py frappuccino/t.py ; frappuccino frappuccino.t --save t.json; sleep 2;  cp frappuccino/tests/new.py frappuccino/t.py; frappuccino frappuccino.t --compare t.json

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

frappuccino-0.0.6.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

frappuccino-0.0.6-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file frappuccino-0.0.6.tar.gz.

File metadata

  • Download URL: frappuccino-0.0.6.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for frappuccino-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e2c3559bce43fcb3dcb6492ecc34d94f71dd2ca7c46395d2ec16bd37d20c60c1
MD5 2c7d6c9484e277bafc1a7672c8f82ced
BLAKE2b-256 c68efc0f30e5f4bdbabf373c97c5805a2b9d3b26f09b2f52ce7543cf92b2037d

See more details on using hashes here.

File details

Details for the file frappuccino-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: frappuccino-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for frappuccino-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0cade435d984fe47fb0916f820e54bc2460dfa70e5642c1b02a158518a251f
MD5 6ef36cf59143261b0df03ea290f3d8dd
BLAKE2b-256 05459c0996c459406b851fcb01de5e255213b321846f6a3fcc9ddfb330be0959

See more details on using hashes here.

Supported by

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