joosthoeks/jhTAlib

Invalid syntax in decorators.py

PoCk3T opened this issue · 4 comments

Describe the bug
See 8b434ec#commitcomment-38003743

It seems like this commit is bringing a new file decorators.py which doesn't run on Python3.5 :
File "/root/venv/lib/python3.5/site-packages/jhtalib/decorators.py", line 20
print(f"Finished {func.name!r} in {run_time:.4f} secs")
^
SyntaxError: invalid syntax

To Reproduce
Steps to reproduce the behavior:

  1. Update jhTAlib to latest version
  2. With Python3.5 : import jhtalib as jhta
  3. Get the error

Expected behavior
No SyntaxError on import jhtalib as jhta

Additional context
Before upgrading jhTAlib, and without any change to my own code, all was working fine

I'm running Python 3.6.9 without any errors. Is it possible too upgrade Python to the latest version and run it again?

If not. Can you post your code what's generate this error?

I unfortunately can't upgrade to Python3.6.9 for compatibility purposes

I tried to create a minimal Docker environment where this issue would reproduce, based on the same Python 3.5.2 and all other libraries I use, I could reproduce the issue with a simple "import jhtalib as jhta", no other code needed

Steps to reproduce:

  1. Download Dockerfile here: https://justpaste.it/5s51d
  2. docker build -f Dockerfile -t jhtalibbugrepro --no-cache .
  3. docker run -it jhtalibbugrepro /bin/bash
  4. python
  5. import jhtalib as jhta
  6. ==> observe that it works fine on jhTAlib==20200211.0
  7. python -m pip install jhtalib --upgrade
  8. python
  9. import jhtalib as jhta
  10. ==> observe that it doesn't work anymore on latest jhTAlib

Wow, less than 20 hours after I opened the issue, well done :)
I will give it a try!

Thank you for that, and thank you for the whole library in general, tremendously helpful
Keep on the good work !