Contractual
Installation
pip install contractual
Use
how to use-
Contract Files
Contract files comply with the Pact file format seen at https://github.com/pact-foundation/pact-specification/tree/version-2 There is a key difference though-
Contractual supports mocking out arbitrary interfaces, while Pact limits itself
to http requests. As such, a Contractual file can only be used with a Pact verifier
if you limit the unchecked mocks to HttpContractMock. In the files themselves,
you will see a list of interactions having the form
{
"description": "get all users for max",
"request": {},
"response": {},
"providerState": "a user with an id named 'u:ser' exists"
}
That is a valid HTTP contract. A more general ContractMock contract would have the
form
{
"description": "get all users for max",
"contractMock": {
"contractName": "Name",
"args": []
},
"response": {},
"providerState": "a user with an id named 'user' exists"
}
Development
Development Environment
Poetry is used to manage the project and dependencies. Once you have poetry installed
pip install --user poetry, you can run poetry install to setup a virtaulenv for
your project. Dependencies can be updated using poetry add or poetry remove and
committing the updated pyproject.toml and poetry.lock files.
Release
CI is handled on Gitlab at https://gitlab.com/pjbecotte/contractual. There is a make target to create a new release by tagging a new version and then incrementing to the next beta version. (This requires permissions to push to master)
Metadata
Release files for contractual 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| contractual-0.4.6.tar.gz | 6.4 kB | Without provenance | Details for contractual-0.4.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| contractual-0.4.6-py3-none-any.whl | Python 3 | none | any | Details for contractual-0.4.6-py3-none-any.whl |
Total release size: 9.7 kB
Release files / contractual-0.4.6.tar.gz
| Download URL | contractual-0.4.6.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a5d54e6bfca7854331e721aa84ddf27483843d1e6968932435f0918eccedba3
|
|
BLAKE2b-256 checksum How to use checksums |
e2281d9d2de7ebbd2e56acd440295703d3734781a4e099a0827a6c8236dc23a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / contractual-0.4.6-py3-none-any.whl
| Download URL | contractual-0.4.6-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd7da2911f5d17a71b4a5ceee9278d756cc289b1ff9975110c97943429af5355
|
|
BLAKE2b-256 checksum How to use checksums |
01807699c0eaef62c7e86fa3e890b45bea8c52d2f8690e815e77138ed731755d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for contractual 0.4.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.