SystemsBioinformatics / cbmpy

CBMPy is a Python based platform for constraint based modelling and analysis.
https://systemsbioinformatics.github.io/cbmpy/
GNU General Public License v3.0
19 stars 6 forks source link

CBMPy 0.7.25 fails with sympy.__version__ = '1.8' (due to not have a microversion number) #33

Closed jonrkarr closed 3 years ago

jonrkarr commented 3 years ago

CBMPy assumes that the version number of sympy has three parts. However, the version sometimes only has two, such as the current version (1.8).

The packaging package has methods for more safely working with version numbers. https://packaging.pypa.io/en/latest/version.html#packaging.version.parse

    import cbmpy  # noqa: F401
/usr/local/lib/python3.9/dist-packages/cbmpy/__init__.py:46: in <module>
    from . import CBSolver
/usr/local/lib/python3.9/dist-packages/cbmpy/CBSolver.py:40: in <module>
    from . import CBGLPK
/usr/local/lib/python3.9/dist-packages/cbmpy/CBGLPK.py:34: in <module>
    if int(sympy.__version__.split('.')[1]) >= 7 and int(sympy.__version__.split('.')[2]) >= 4:
E   IndexError: list index out of range

The current version of the code has the same issue. https://github.com/SystemsBioinformatics/cbmpy/blob/master/cbmpy/CBGLPK.py#L38

bgoli commented 3 years ago

Many thanks for reporting this issue it has been fixed in 0.8.1