Does someone know if there is a way to compile python programs to some sort of static binary? I have a GPS watch and some old Python 2 script to export the data (found it online (unmaintained) a few years ago). However, when Python 2 will be sunsetted I am a bit worried that Linux distributions will stop packaging the dependencies of said script, but I would like to keep using it until the watch breaks.
You could give py2exe a try. They have an old python2 version that might work for you. https://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/
Sunsetting Python 2
721–730 of 733 posts
Re: Sunsetting Python 2
#722Does someone know if there is a way to compile python programs to some sort of static binary? I have a GPS watch and some old Python 2 script to export the data (found it online (unmaintained) a few years ago). However, when Python 2 will be sunsetted I am a bit worried that Linux distributions will stop packaging the dependencies of said script, but I would like to keep using it until the watch breaks.
Docker could do what you want, though it's definitely not an efficient solution.
Re: Sunsetting Python 2
#723Earlier quoted context omitted.
The Py3 string handling was beyond frustrating prior to 3.6. For what I do, Unicode complexity is not required. Having to stuff it into everything was more trouble than it was worth.
The ubiquity of emoji alone mean that Unicode is everyone's problem in 2010+, and ignoring it won't make it go away. It's Python 2.x where dealing with Unicode (which is everywhere) is far too complex, and more trouble than it is worth. The "complexity" of Python 3 string handling is worth it, and no worse (even < 3.6) than any other modern programming language, and possibly easier than some by making clear runtime e…
Re: Sunsetting Python 2
#724Earlier quoted context omitted.
How did you get the older Perls working? (I've tried and failed to get them to build on Ubuntu.)
Manually patching the source in a few places, most of the time it's just adding a header file or two since some of them predate ANSI C and the standardized header files. The other things have to do with adding -DHAS_... to force them to know that opendir and friends are actually present, so that make install will actually work.
Re: Sunsetting Python 2
#725Earlier quoted context omitted.
> (Unless your manager makes drive-by commits of py2-only code, months after you all agreed that all new code should be py3-compatible, and then leaves town for a multi-week vacation...) Isn't what code review and CI/CD is for?
Isn't force-merging without waiting for code review or test results what managers are for?
As a manager one should be extra careful to be _seen_ eating your vegetables, flossing your teeth and getting your code reviewed.
(What you do in private is a different matter. In some companies office politics can require some skullduggery.)
Re: Sunsetting Python 2
#726Earlier quoted context omitted.
What free things are supported for 60 years in engineering applications? Name one.
Fairly ancient Fortran compiles OK in open source compilers. Not quite 60 years old, yet, but it'll be there soon.
Re: Sunsetting Python 2
#727Earlier quoted context omitted.
Isn't force-merging without waiting for code review or test results what managers are for?
Sounds like you should get a new manager. As a manager one should be extra careful to be _seen_ eating your vegetables, flossing your teeth and getting your code reviewed. (What you do in private is a different matter. In some companies office politics can require some skullduggery.)
Re: Sunsetting Python 2
#728Earlier quoted context omitted.
Having used quite a few different brands over years,I'd say that most of the more expensive ones are just good enough.All the nitty gritty details why Makita does a better job than HILTI or that Milwaukee will last forever are mainly personal experiences.
Personally, I'm biased towards Milwaukee's RED Fuel cordless stuff, because I used a cordless hammer drill of theirs at work and it lasted hours, which signaled to me that if something like a hammer drill going through 1-1/2 foot concrete continuously can last a long time, then a normal drill or an impact driver probably won't die on me while working. I do like the grips and ergonomics of some brands more than others…
Re: Sunsetting Python 2
#729Earlier quoted context omitted.
> By experience, people with large Python projects often overblown the difficulty of porting in their head. ... most projects get away with 2 weeks of investment. Where did you come up with this "2 weeks" estimate? That has not at all been my experience.
What has been your experience?
Many months.
Step zero is education. Your team has been programming in Python 2. You need to make sure they know the differences in the environments, how to use create cross-compatible code, and how to use six. They also need to setup a second dev enthronement, and become comfortable switching between 2 and 3 regularly.
Step 1/2 is prioritizing. Determine how important is the move to Python 3, and what other features and dev work will you have to sacrifice to make it happen. While having a nice plan in place may provide some level of comfort to management, you can be sure it will thrown out, amended, extended, and/or ignored throughout the project. Upgrading Python dev environments brings no near or mid term value to the company. So expect developers to continue their current work-load while also attending to this tech debt.
Step one is getting the libraries into shape. This is easy if your project only relies on actively developed libraries with good teams behind them, but nearly impossible for abandoned libraries with no new commits in the last few years. Sure in retrospect, it was a bad idea to use these libraries, but at the time, they were incredibly powerful or popular. Generally, for abandoned libraries, it's easier to find a newer Python 3 library than work on fixing someone else's code. But this may mean rewriting large parts of an app, and may alter functionality, so constant communication with product mangers and a flexible approach is necessary.
Second step is working on your own code. One or two modules is no problem. But more than a dozen takes time. Scripts like 2to3 are not helpful, you need to use tools like six and modernize.
Third step is testing. If you have a good team, then you should already have good tests with known coverage. In that case, you should make sure your coverage matches, and take a very hard look at the code that is not covered. If your tests cover less than say 60% of code, you need to invest quite a bit of time of either testing directly, or building many more tests.
Step 4 is partial rollout. There will inevitably be issues you didn't think about or catch, so you need to plan the roll-out carefully and either split traffic or at the very least be able to quickly revert.
Step 5 is to watch carefully for customer complaints. Any complaint may or may not be related to the switch from 2 to 3, and you need someone on your team who stays on top of that, and can communicate the issue to the correct module owner.
Step 6 is deciding when to drop support for Python 2 altogether, as there will have to be a time where you have the two environments running side-by-side while you're testing. After all of this work, you'd think this part would be easy, but in every organization some folks will be wary about dropping support for something that already works.
Obviously, this isn't just a linear progression, you can do some of these in parallel, and will likely have to take a step back a few times. My back-of-the napkin, experience based, non-scientific estimate suggests that a 100k LOC project can be managed by two developers in two-three weeks, but a 1M LOC project (including libraries) is roughly 5-8X that much work.
Re: Sunsetting Python 2
#730Does someone know if there is a way to compile python programs to some sort of static binary? I have a GPS watch and some old Python 2 script to export the data (found it online (unmaintained) a few years ago). However, when Python 2 will be sunsetted I am a bit worried that Linux distributions will stop packaging the dependencies of said script, but I would like to keep using it until the watch breaks.
I would be interested to see if I can update to python 3.