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

Bump it for Python 3.10.5 #194

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Bump it for Python 3.10.5 #194

wants to merge 34 commits into from

Conversation

md8n
Copy link
Contributor

@md8n md8n commented Dec 17, 2022

Description

Objective: Try it all out for Python 3.10.5

Not much Python bumping here. Instead, this one is bumping the JavaScript libraries. In particular it makes use of npm to set up a package.json file and install all of the JS libraries used via that. This also ensures that other dependencies get pulled in as well.

And then because I grabbed the latest and greatest, it also meant dealing with the technical debt of the JS libraries not being updated for so long ...

@md8n md8n self-assigned this Dec 17, 2022
@md8n md8n changed the base branch from bump_everything to master December 17, 2022 07:59
@Orob-Maslow
Copy link
Contributor

Orob-Maslow commented Dec 24, 2022

This is the response I get when trying to run your branch on my linux laptop. EDIT: I created a new Pyenv and virtualenv with a new git clone and pip install setup with the requirements.txt file when testing this.


[2022-12-24 10:12:42,845] WARNING in init: WebSocket transport not available. Install gevent-websocket for improved performance.
Latest pyrelease: 0.94
None
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)

so i pip installed gevent-websocket after installing gevent-websocket:


The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)

so this is unsupported. the web page still loads and it appears to be functional except when one goes to use the menu. No pop up windows or supporting menus work at all. This is the same reason why I'm still using 3.8 in Linux. I would be willing to test additional versions, but not sure how best to fix this.

@md8n
Copy link
Contributor Author

md8n commented Dec 26, 2022

The client is using an unsupported version of the Socket.IO

@Orob-Maslow - I found this myself a couple of days back. I had failed to upgrade the socket.io client Javascript package to match the python socket-io backend package.

I have found the matching socket.io JS package and put that in the static/scripts folder where the previous version was, however, it seems that we don't have any package management for the front end JS libraries. So just to make sure that we can get the right versions called out, I'll be adding that as well.

@Orob-Maslow
Copy link
Contributor

Orob-Maslow commented Dec 26, 2022

I updated the socket.io-2.1.1.js file in the static scripts folder from v.2.1.1 to socket.io.js version 4.5.4 (the latest release from GitHub) and the error above went away, but the page still doesn't function as expected, so something is not right still.

@md8n
Copy link
Contributor Author

md8n commented Dec 26, 2022

@Orob-Maslow I went full npm on this thing (i.e. some kinda proper management of JS packages). It's still not right, but I wanted to make sure the work so far isn't sitting only on my machine.

Fixes some problems, breaks others. Real issue here is the tech debt related to using really old versions of JS libraries.

@Orob-Maslow
Copy link
Contributor

the working branch I'm using is Python10version2022 in the webcontrolcnc/webcontrol repository. I just committed the version I'm using with the updated socketio.js file.

@madgrizzle
Copy link
Collaborator

hey all. I still get messages from time to time for commits and such and want to make sure those that are actively developing aren't running into permissions issue to do what you need. If someone needs higher access setting, let me know.

@Orob-Maslow
Copy link
Contributor

Tested this branch in ubuntu 20.04 with python version 3.10.5. Tested in chrome, brave, firefox: all behave the same. Also tested with and without mega controller attached. Web page will load and it appears to be ok, but the menus are broken. Action page will not show whether loaded in full page or smaller mobile page size (when browser window is reduced in size). There appears to be no error in the browser as before when the versions were wrong, but something still isn't right.

Would it make sense that this a local issue with the test setup?

@md8n
Copy link
Contributor Author

md8n commented Dec 29, 2022

Tested this branch in ubuntu 20.04 with python version 3.10.5. Tested in chrome, brave, firefox: all behave the same. Also tested with and without mega controller attached. Web page will load and it appears to be ok, but the menus are broken. Action page will not show whether loaded in full page or smaller mobile page size (when browser window is reduced in size). There appears to be no error in the browser as before when the versions were wrong, but something still isn't right.

Would it make sense that this a local issue with the test setup?

The issue is that the socket in the browser is not connecting, which impacts menu selections, pretty much everything. I spent some time yesterday narrowing it down.

Fix that and I reckon it will be ready for more review. Thanks so much for all the testing you are doing at the moment

@md8n
Copy link
Contributor Author

md8n commented Dec 31, 2022

@Orob-Maslow I found that creating the threads in the socket connect handlers was silently dying, which meant that no socket connection every properly responded. For now I've just commented that out.

Currently I've got it to the stage where the modal dialogs should be presented, but are not. So this is next on my list of stuff to fix..

@md8n
Copy link
Contributor Author

md8n commented Jan 1, 2023

@Orob-Maslow I found that creating the threads in the socket connect handlers was silently dying, which meant that no socket connection every properly responded. For now I've just commented that out.

Currently I've got it to the stage where the modal dialogs should be presented, but are not. So this is next on my list of stuff to fix..

So there's been a change in how sockets have to be created, which means that every argument needs to be named (especially if you're going from flask_socketio to socketio to engineio to actual python's socket), or the first argument has to be set to None.

I've moved the thread creation to main.py for UIProcessor, MCP and Logs

@Orob-Maslow
Copy link
Contributor

Python multi threading is challenging with this running gevent. The serial communication uses a thread. I tried to start a separate thread for gpio and pendant handling and found that that it was better to start a separate process (app) rather than thread it. That may have been a limitation of my understanding or may be the same issue you are seeing with the silent death of the threads. The last commit before this did not load the web page properly at all. I figured you were still working on it so I've been waiting for the test signal to run through all the features.

@Orob-Maslow
Copy link
Contributor

Tried testing the latest code in your branch, but python throws an error with flask, but I may have tried between commits this evening.

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