aradi / fypp

Python powered Fortran preprocessor
http://fypp.readthedocs.io
BSD 2-Clause "Simplified" License
180 stars 30 forks source link

`pip install fypp` breaks on Python 2.7, using `pip3 install fypp` works. #18

Closed dappelha closed 2 years ago

dappelha commented 2 years ago

After pip install fypp, I try out fypp and I get some errors below (using python 2.7). No errors and everything works if I use pip3 instead.

The docs at https://fypp.readthedocs.io/en/stable/fypp.html#getting-started says:

The behavior of Fypp can be influenced with various command line options. A summary of all command line options can be obtained by:

fypp -h

When I try it I get an error from this section:

def _process_direct_call(self, callexpr, span):
        match = _DIRECT_CALL_REGEXP.match(callexpr)
        if not match:
            msg = "invalid direct call expression"
            raise FyppFatalError(msg, self._curfile, span)
        callname = match.group('callname')
        self.handle_call(span, callname, None, False)
        callparams = match.group('callparams')
        if callparams is None or not callparams.strip():
            args = []
        else:
            try:
                args = [arg.strip() for arg in _argsplit_fortran(callparams)]
            except Exception as exc:
                msg = 'unable to parse direct call argument'
                raise FyppFatalError(msg, self._curfile, span) from exc`
dappelha commented 2 years ago
dappelhans@prm-login:/gpfs/fs1/dappelhans/examples/fypp-examples$ fypp -h
Traceback (most recent call last):
  File "/home/dappelhans/.local/bin/fypp", line 7, in <module>
    from fypp import run_fypp
  File "/home/dappelhans/.local/lib/python2.7/site-packages/fypp.py", line 711
    raise FyppFatalError(msg, self._curfile, span) from exc
                                                      ^
SyntaxError: invalid syntax
dappelha commented 2 years ago

using pip3 install fypp and everything works. Seems there is something broken about using python 2.7 even though docs said it should work.

aradi commented 2 years ago

Thanks for reporting! With version 3.1 we have dropped support for Python 2.7 and also for some ancient Python 3.x versions. Unfortunately, the documentation was not updated accordingly. I've fixed this now (5a5a333) and have also updated the installation info in the docs (a9a2ffe).