AndreaCensi / contracts

PyContracts is a Python package that allows to declare constraints on function parameters and return values. Contracts can be specified using Python3 annotations, or inside a docstring. PyContracts supports a basic type system, variables binding, arithmetic constraints, and has several specialized contracts and an extension API.
http://andreacensi.github.io/contracts/
Other
398 stars 62 forks source link

Innappropriate import of site-packages rather than contracts source if contracts is installed #97

Closed rjdbcm closed 11 months ago

rjdbcm commented 2 years ago

I noticed while vertically integrating some of your code locally in a project that I would get strange errors about changing contracts that had been previously defined. After much frustration I checked the imports and found that they were loading from my site-packages directory rather than the local src/ packages. This caused contracts to be defined by a mix of different versions from the local src/ directory and my site-packages. I have created this patch to remediate this issue.

-Ross