Skip to main content

PyTreaty is a hard fork of the PyContracts library from Andrea Censi. This fork has been updated to allow multiple contract definitions on a function, as well as removing Python 2.x support and other updates.

Project description

Build Status codecov Codacy Badge

PyTreaty

This is a hard fork of the PyContracts library, the original version of which can be found here.

Modifications we have made:

  • All contract definitions are now applied at all times. Previously if you added type annotations to a function, the docstring contracts were ignored. Type annotations and docstring contracts have different (but overlapping) purposes, and therefore we require both. Also, previously if you used a contract decorator then both type annotations and docstring contracts were ignored. This is also fixed.
  • Removed Python 2.x support. Maintaining support for legacy python versions bloats the codebase significantly, so we only support Python 3.5+.

Why did we fork?

We are big fans of the original project from Andrea Censi, and we are very happy to merge these changes upstream, however we received no response from the original project, and therefore we assume the project is orphaned.

There are also wider changes we want to make across the codebase, so we also crossed the threshold where it became viable to maintain our own codebase.

Thing to come

We plan to continue to improve and support PyTreaty, some notable future improvements that are planned are:

  • Adding support for complex Python typing and custom type hints.
  • New and improved documentation.

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

pytreaty-2019.1b2.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

pytreaty-2019.1b2-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file pytreaty-2019.1b2.tar.gz.

File metadata

  • Download URL: pytreaty-2019.1b2.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for pytreaty-2019.1b2.tar.gz
Algorithm Hash digest
SHA256 7148981a35c6ef1ebc074487bc392093f9f27593ef5361342668de3c2f1d933f
MD5 74509d1c89588a0511137b36087e8ad9
BLAKE2b-256 40a7c29d73e6df14e3af6cbf6b34183807a47e2296f1c6509add7fd5e6b3c38b

See more details on using hashes here.

Provenance

File details

Details for the file pytreaty-2019.1b2-py3-none-any.whl.

File metadata

  • Download URL: pytreaty-2019.1b2-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for pytreaty-2019.1b2-py3-none-any.whl
Algorithm Hash digest
SHA256 f61e3e58f773bcfb168c594f09779d1347cab147d8b9b7e204671f75595d58ab
MD5 7647a1b01b21eedd16b501888c0e0c06
BLAKE2b-256 78b27f478a0659521bf4844dda1d1606e051cdcc0442f8e0546d0545ba21134f

See more details on using hashes here.

Provenance

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