joosthoeks / jhTAlib

Technical Analysis Library Time-Series
https://joosthoeks.github.io/jhTAlib/
GNU General Public License v3.0
152 stars 44 forks source link

Invalid syntax in decorators.py #14

Closed PoCk3T closed 4 years ago

PoCk3T commented 4 years ago

Describe the bug See https://github.com/joosthoeks/jhTAlib/commit/8b434ec70a1cde608e6473e67a794f327ce5fe36#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 {runtime:.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

joosthoeks commented 4 years ago

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?

PoCk3T commented 4 years ago

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
joosthoeks commented 4 years ago

Fixed: https://github.com/joosthoeks/jhTAlib/commit/6db3b5e094973936660616fbb0ede3547645d008

PoCk3T commented 4 years ago

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 !