tuttle-dev / tuttle

🪰 Tuttle - time and money management for freelancers
GNU General Public License v3.0
63 stars 12 forks source link

Test: Time tracking from Toggl #213

Closed clstaudt closed 1 year ago

clstaudt commented 1 year ago

Branch dev: Ready for testing with real data:

  1. configure projects, contracts, clients
  2. import time tracking data recorded with Toggl from .csv file
  3. generate invoices and timesheets
tsterbak commented 1 year ago

If I run python app/app.py in python 3.9 on the current dev branch, I get the following error:

Traceback (most recent call last):
  File "/home/tobias/Repositories/tuttle/app/app.py", line 14, in <module>
    from auth.view import ProfileScreen, SplashScreen
  File "/home/tobias/Repositories/tuttle/app/auth/view.py", line 19, in <module>
    from core import utils, views
  File "/home/tobias/Repositories/tuttle/app/core/views.py", line 84, in <module>
    class THeading(Text):
  File "/home/tobias/Repositories/tuttle/app/core/views.py", line 94, in THeading
    expand: bool | int | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'type'
vlad-ed-git commented 1 year ago

@tsterbak can you try now (get latest dev changes). I suspect it has something to do with the bool | int | None = None type hint.

clstaudt commented 1 year ago

@tsterbak @vlad-ed-git The reason for the error is that this syntax for union types is only available from Python 3.10.

https://www.blog.pythonlibrary.org/2021/09/11/python-3-10-simplifies-unions-in-type-annotations/

Since we still support Python 3.9 it's a bug and should be changed, even though I prefer the new syntax. It's probably a bit early to drop support for Python 3.9.

ps. I am working on adding a test to the CI/CD pipeline that checks whether the app starts across all supported Python versions.