Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade flet version to latest #224

Merged
merged 7 commits into from
Apr 27, 2024
Merged

Upgrade flet version to latest #224

merged 7 commits into from
Apr 27, 2024

Conversation

eeintech
Copy link
Contributor

No description provided.

@eeintech eeintech requested a review from T0jan April 19, 2024 18:05
@eeintech
Copy link
Contributor Author

eeintech commented Apr 19, 2024

@T0jan Mind telling me if you find any issue with this branch? Intent is to upgrade the flet version to the latest hopefully without breaking things 😄

@T0jan
Copy link
Collaborator

T0jan commented Apr 19, 2024

@eeintech I assume you rebuilt it for flet-0.22.0? They seem to have included a lot of libraries since 0.19.0 which can't be easily installed on non-debian/fedora linux which is certainly a choice. As I am using Arch privately I was only able to get Ki-nTree running with flet-0.19.0 but it doesn't show anything in the window except the top bar. I will try to check on my work machines next week, where I have more mainstream OS to work with.

@second-string
Copy link

I pulled this and built it locally on macOS and everything looks solid at first glance.
Bildschirmfoto 2024-04-20 um 21 24 30
I have to actually figure out how to set up the connections and whatnot to use the functionality but let me know if you want me to test anything specific.

@eeintech
Copy link
Contributor Author

@eeintech I assume you rebuilt it for flet-0.22.0? They seem to have included a lot of libraries since 0.19.0 which can't be easily installed on non-debian/fedora linux which is certainly a choice. As I am using Arch privately I was only able to get Ki-nTree running with flet-0.19.0 but it doesn't show anything in the window except the top bar. I will try to check on my work machines next week, where I have more mainstream OS to work with.

For Flet 0.19 and older the build methods of views was called _build therefore the views won't be constructed with this branch as never called. Mainstream OS would be nice to test with as I'm not familiar with Arch linux and the issues with latest Flet versions.

I have to actually figure out how to set up the connections and whatnot to use the functionality but let me know if you want me to test anything specific.

@second-string Thanks please let me know if you find anything weird after setting up the full part creation flow 👍

T0jan
T0jan previously requested changes Apr 23, 2024
Copy link
Collaborator

@T0jan T0jan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some issue here, confirmed on windows, ubuntu 20 and ubuntu 22:

def reset_field(field):
if isinstance(field, ft.ProgressBar):
field.value = 0
else:
field.value = None
field.update()

As soon as I try to search for a second part (or the same part on a different supplier) there is an unrecoverable UI crash:

Traceback (most recent call last):
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "~/.local/lib/python3.10/site-packages/flet_core/page.py", line 528, in wrapper
    handler(*args)
  File "~/workspace/github/Ki-nTree/kintree/gui/views/main.py", line 300, in run_search
    self.reset_view(e, ignore=['part_number', 'supplier'])
  File "~/workspace/github/Ki-nTree/kintree/gui/views/main.py", line 289, in reset_view
    return super().reset_view(e, ignore=ignore, hidden=hidden_fields)
  File "~/workspace/github/Ki-nTree/kintree/gui/views/main.py", line 162, in reset_view
    reset_field(value)
  File "~/workspace/github/Ki-nTree/kintree/gui/views/main.py", line 156, in reset_field
    field.update()
  File "~/.local/lib/python3.10/site-packages/flet_core/control.py", line 293, in update
    assert self.__page, "Control must be added to the page first."
AssertionError: Control must be added to the page first.

Linux installations need an additional package to be installed before flet>0.19 can work, for debian based systems the package is covered by APT:

sudo apt -y install libmpv1


requirements.txt needs to be updated. Apart from the the obvious flet requirement the Inventree API should be updated also to the latest version (13.3, have checked all functions and found no issues):

inventree>=0.12.1,<1.0

@eeintech
Copy link
Contributor Author

eeintech commented Apr 23, 2024

Thanks @T0jan for the review, I will try to get the PR updated soon.

Maybe this should be 1.1.0 as it is more changes than usual.

@second-string
Copy link

I also get the same AssertionError: Control must be added to the page first., but it's not crashing on macOS. It just prints in the terminal silently but the app stays open (albeit with no reaction).

@T0jan
Copy link
Collaborator

T0jan commented Apr 24, 2024

Yeah I meant the UI getting unresponsive with 'unrecoverable UI crash'. Program stays open but no no part can be searched anymore.

@second-string
Copy link

ah I see. my UI is still responsive (as in, buttons still show the hover state if I hover over them, etc). If I switch to a different tab on the left hand column, then switch back, the original tab will work again for another search.

@T0jan
Copy link
Collaborator

T0jan commented Apr 24, 2024

Oh that's true on my systems as well as I just noticed. so there is probably just an update missing after the search is done?

Copy link
Contributor Author

@eeintech eeintech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be all fixed now thanks!

@eeintech eeintech dismissed T0jan’s stale review April 27, 2024 00:45

Completed changes

@eeintech eeintech merged commit b3d5b57 into 1.0.x Apr 27, 2024
@eeintech eeintech mentioned this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants