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

Incompatibility with pyparsing >= 3 #98

Open lindycoder opened 2 years ago

lindycoder commented 2 years ago

Hello!

It seems the 'operatorPrecendence' that was deprecated is not available anymore and produces:

ImportError: cannot import name 'operatorPrecedence' from 'pyparsing'

Maybe the requirements of should be updated to "pyparsing<3" or fixed.

From pyparsing code:

operatorPrecedence = infixNotation
"""(Deprecated) Former name of :class:`infixNotation`, will be
dropped in a future release."""

https://github.com/pyparsing/pyparsing/blob/pyparsing_2.4.7/pyparsing.py

caleb15 commented 2 years ago

As a workaround you can pin the version of pyparsing to a earlier version:

pyparsing==2.4.7