devel/py-dpcontracts 0.6.0_1 MidnightBSD
Simple implementation of contracts for Python
- System
- MidnightBSD
- Repository
- mports
- Maintainer
- [email protected]
- License
- lgpl3+
- Categories
- devel, python
Description
This module provides a collection of decorators that makes it easy to write software using contracts.
Contracts are a debugging and verification tool. They are declarative statements about what states a program must be in to be considered "correct" at runtime. They are similar to assertions, and are verified automatically at various well-defined points in the program. Contracts can be specified on functions and on classes.
Contracts serve as a form of documentation and a way of formally specifying program behavior. Good practice often includes writing all of the contracts first, with these contract specifying the exact expected state before and after each function or method call and the things that should always be true for a given class of object.
Contracts consist of two parts: a description and a condition. The description is simply a human-readable string that describes what the contract is testing, while the condition is a single function that tests that condition. The condition is executed automatically and passed certain arguments (which vary depending on the type of contract), and must return a boolean value: True if the condition has been met, and False otherwise.
In the other systems
| System | Port | Version |
|---|---|---|
| MidnightBSD | devel/py-dpcontracts | 0.6.0_1 |
| FreeBSD | devel/py-dpcontracts | 0.6.0_1 |
| DragonFly | devel/py-dpcontracts | 0.6.0_1 |
| HardenedBSD | devel/py-dpcontracts | 0.6.0_1 |
| GhostBSD | devel/py-dpcontracts | 0.6.0_1 |
Install
Binary package:
mport install ${PYTHON_PKGNAMEPREFIX}dpcontracts
From mports:
cd /usr/mports/devel/py-dpcontracts && make install clean
To depend on this port in another port's Makefile:
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dpcontracts>0:devel/py-dpcontracts
Dependencies
No port depends on this one.
Configuration
No options to configure.
- USES
- python
- Service scripts
- none
Files
distinfo 1
| File | Size | SHA256 |
|---|---|---|
| dpcontracts-0.6.0.tar.gz | 11156 | 6cf9df1f16beaa48523b798b41170dabf7a536a6133328731665cdb29c42234a |
Master sites 1
- PYPI