-
Notifications
You must be signed in to change notification settings - Fork 663
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
GitHub Action to lint Python code #2308
Conversation
Would need to be updated for Python 3, but generally good. I also just added it to CodeFactor: https://www.codefactor.io/repository/github/motioneye-project/motioneye But it makes sense to do all wanted tests via GitHub actions. |
Let’s put the guardrails in now, not later. |
I just want to avoid that we resolve Python 2 specific issues which may not be relevant anymore after #1572 has been merged. Generally I'd vote for doing this as very first step and then concentrate testing and developing for Python 3 only. |
I prefer to see red tests turning green as progress is being made rather than tests that never were red. |
Okay, I get your point. Not sure however whether tests against current Python 2 dev branch and Python 3 can be really compared. Let's see what others think about it. |
May I comment? Until the python3 port is ready for prime time (or beta test of an RC), I know many users would like to see the 'fixes' for python2 that are 'in the queue' be tested and applied. You could make an announcement stating that after they are applied, there will be a 'freeze' on fixes, with focus shifting to python3. I would not flag any python2 specific issues at that point for fixes. It has been nearly 2 years without any fixes, patches, whatever being applied, and for 'normal' end users, it doesn't look good. I've done my best to keep interest alive, but... |
Python 2 died on 1/1/2020 which is almost 800 days ago. |
The original EOL date was to be 2014 (8+ years ago) and kept getting moved. IIRC motionEye was started after the first EOL was announced. (9 years ago by the oldest file in github). Would it kill anyone to do one last patch /update if they already exist? Not fix any new issues, just apply ones that have been requested and ready to apply? And what level are you writing the python3 code? Are you looking to remove any Python3.7 and prior specific instructions? 3.7 EOLs next year, and all the earlier 3.x are already past EOL. (Sorry, I am often an end-user advocate) |
Also should this type conversation be taken to another forum or format? Or leave it public? |
I personally don't see any point in spending any further time on Python 2, at least I won't, of course if anyone else wants to, that is fine. The two forks however, where much effort has been gone into, are Python 3 ones. If anyone really requires it and there is someone which wants to take care of it, we could create a EDIT: I just created a
IMHO everything related to the future of motionEye should be discussed publicly. We need all help and opinions that we can get to keep the project going, and hence the existing community should be involved as much as possible, also or especially regarding the question whether there is indeed still notable need for Python 2 releases. |
I would not put any effort into Python2 code. Let's get motionEye running on Python3 basically and keep provided fixes open. Port those fixes to Python3, if necessary, and merge them then. Let's get onto newest base as everything else has no future. |
#2309 lints legacy Python on the Python 2 branch for those who desire to end-user advocate for an insecure platform. |
"lints legacy Python on the Python 2 branch for those who desire to end-user advocate for an insecure platform." I feel this is a dig at me, please correct me if I'm wrong. |
It was a friendly dig... We are all traveling in the same direction. As you can see in the 17 commits on #2309, it takes a lot of work to make Python 2 continue to sing. That work would be better spent establishing forward progress. |
Sir, I don't appreciate any digs. I won't give them, I won't take them, I don't see why there was a need to make one. |
The GitHub Actions at https://github.com/cclauss/motioneye/actions on this PR and #2309 should now be green. This PR fixes a few basic Python 3 syntax errors like print() function, new style exceptions, and lambda parameters. Those fixes are compatible with both Python 2 and Python 3. |
@starbasessd @cclauss |
I have not asked for any new patches / updates for python2, just apply those that have already been created. They Python3 branch has been out there in various forms for a long time. Do you really believe the python3 version will be instantly stable when presented? Have you taken into consideration of ALL the features and their changes? Dropbox now needs a new method to support their short term key vs long term key. Drop Dropbox Support? Google is changing their GDrive and GMail access for 'non-secure' access May 30. Python3 dropped support for PyCamera library (among other things) that affect PiCam on Bullseye, so YES there are many systems out there that can't go to python3 and still use motionEye, as PyCamera library wasn't all that RPiFoundation broke with Bullseye. Python 3.7 goes EOL next year. Are you being pro-active for removal / changes to currently supported functions? Are you considering migrating to another language since python4 will probably never come about, and python3 will probably end up like the python2 train... |
Also there are many users who have python2 set as default, can you have any references to python that need python3 to specify python3 and pip3? |
They still need to be reviewed, tested etc. Not all of us are sufficiently deep in this project to know all PRs already, whether they are safe to merge etc 😉.
IMO and argument to really focus all efforts on getting it stable as fast as possible.
Is this really Python 3 related or related to changes at Dropbox and Google APIs? I do not use proprietary cloud servers, so I don't know much about this, but I know about the Gmail topic, and that isn't related to Python 3 at all and can be solved very easily by using 2FA and an application key instead of the regular username's password for SMTP authentication. I just did that change for our phpBB instance. PyCamera supports Python 3, or do you mean PiCamera? The latter is as well not related to Python 3 but that Raspberry Pi OS with Bullseye dropped parts of the legacy proprietary GPU libraries and moved to modern upstream libraries like libcamera and V4L2 basis.
On most distros it is and always was so that one needs to install and use |
Co-authored-by: MichaIng <micha@dietpi.com>
Co-authored-by: MichaIng <micha@dietpi.com>
Co-authored-by: MichaIng <micha@dietpi.com>
It does involve the python scripting in motionEye, and that scripting will have to be fixed for email notifications, and file uploading. |
I tell you what. Let's remove me from the 'team'. I may continue helping with the legacy for a bit, but I am not feeling good about the python3 conversion team, attitude, or environment. I wish you luck. |
That is really sad to read. I fully agree that we must talk respectfully with each others, despite possibly different priorities. That naturally comes along with a team. This is meant in both directions, respecting and taking serious a possible demand for further Python 2 support, as well as respecting that free volunteers decide to spend their time on Python 3 supporting code only. IMO we simply must give every contributor the freedom to focus on those aspects personally seen as important. In case of Python 2 vs Python 3 it doesn't conflict at all and doesn't cause any issue if some are keeping Python 2 compatibility up and related code fixed via separate branch, while the others focus on getting Python 3 compatibility stable. There is a sufficient amount of ends where work needs to be done, much of which is unrelated to Python 2 vs Python 3, also on the documentation side, Docker and motionEyeOS, I guess. And reviewing/cleanup of issues and open pull requests is another topic on its own.
But how is this related to Python 2 vs Python 3. Of course if an external API changes, the related Python code needs to be updated, but that affects any Python version. Doing so for two Python versions means the extra I want to avoid for my own contribution time. The major question still is if there is anything which prevents you from switching Python 3, aside of that you will currently run into the one or the other syntax error where fixes will be merged soon (but unrelated to the issues you mentioned)? |
I have several PiCams on RPi hardware, running RPiOS (Debian derived) that has issues with Buster and the newer Python3 and missing libraries. Could they be moved to something else (even with the name 'motionEye'? Possibly, but if they ain't broke... And I won't risk changing them over for a period of time while the python3 is being tested. And with several 'features' that are going to break soon (gdrive, gmail email notifications, or have already done so (dropbox) and the responses that have been given here, if I have to upgrade / change my environments (I use GPS for a timebase and they are still using python2 libraries) the amount of work involved will justify also looking at another product altogether that will still have those features. And if I have to learn another system, I'll end up dropping this one. One reason I have been learning python2/3 for personal use was motionEye. Another question: What is the intent to maintain motionEye/motionEyeOS interoperability? Any? That would be another reason to not shift to Python3, if it won't work with motionEyeOS, too. Several PiZeroW Cameras have motionEueOS on them and they interact with my primary server (Debian 11, python2, motionEye 0.42.1, motion 4.3.2) just fine. To have to drop one to python3 would force me to drop all? Since motionEyeOS is not a priority, does this force me to lose that functionality? |
But how is this related to Python 3? It is an RPi OS distro change, but you can run Python 3 on ancient Raspbian Jessie systems, if you like, as well as Python 2 on Raspberry Pi OS Bullseye, that is not related at all with each other, aside of the fact the Bullseye makes it more difficult to install Python 2 via APT packages. Gmail, GDrive and Dropbox will break for Python 2 just the same way, though I already mentioned that Gmail is easy to fix only by using an application password, so for this there is no motionEye code change required.
Of course the intention is to update motionEyeOS to use the motionEye Python 3 build, once stable. It is one thing to have software which supports EOL libraries/dependencies, but it is irresponsible to ship OS images with EOL software, at least from security point of view.
I need to have a closer look into how multiple instances are communication to each other, but I cannot imagine that the Python version has any effect on this, given that public APIs do not change, just the backends. But this is something which should be tested first of course, e.g. installing a Python 3 motionEye on a dedicated SD card with one RPi Zero and simply test it. And keep in mind that you can run both Python versions concurrently. So while motionEye uses Python 3 any other software you may depend on can use Python 2, and this is true on all Debian/Raspbian versions, on Bullseye at least when installing the |
This project should go to Python 3. Keep already provided pull requests open, migrate then to Python 3 once the Python 3 version runs and then merge those pull requests. An initial version running on Python 3 will not be perfect from its beginning, but we should begin to use Python 3 as everything else is totally outdated and maybe even vulnerable. |
Test results: https://github.com/cclauss/motioneye/actions are now green.
This PR fixes a few basic Python 3 syntax errors like print() function, new style exceptions, and lambda parameters. Those fixes are compatible with both Python 2 and Python 3.
execfile()
,file()
,unicode()
andxrange()
were removed in Python 3. #2310