ampledata / aprs

Python APRS Module
https://github.com/ampledata/aprs
Other
95 stars 53 forks source link

invalid syntax #21

Closed aceat64 closed 5 years ago

aceat64 commented 7 years ago

This is with version 7.0.0 of the library.

Traceback (most recent call last):
  File "receive.py", line 2, in <module>
    import aprs
  File "/usr/local/lib/python3.5/dist-packages/aprs/__init__.py", line 33, in <module>
    from .functions import (parse_frame, parse_callsign,   # NOQA
  File "/usr/local/lib/python3.5/dist-packages/aprs/functions.py", line 120
    parsed_callsign: AprsCallsign = aprs.Callsign()
                   ^
SyntaxError: invalid syntax

https://github.com/ampledata/aprs/blob/2f06fef42a6935b704c747a1a0d1b6c041a937cb/aprs/functions.py#L120

ampledata commented 7 years ago

Hi @aceat64 Thanks for the feedback. Currently this library requires Python 3.6 and up.

castlebbs commented 6 years ago

@ampledata I'd like to use your library on a "stock" Raspbian (Python 3.5.3). How big of a job do you think it is to make the library backward compatible? I can give it a shot.

ampledata commented 6 years ago

Hi @castlebbs, I've added a bunch of syntactic-sugar to utilize Python 3.6's static-type-hinting: https://docs.python.org/3/library/typing.html

You could strip that stuff out since it's just additive syntax and doesn't actually change the code.

Alternatively I'd recommend using pyenv to install 3.6 into a python virtual-environment, so-as not to be constrained by whatever the Raspbian bundles: https://github.com/pyenv/pyenv

stroobandt commented 6 years ago

Same issue here on Xubuntu LTS which is still running python 3.5.2 by default.