Cygwin now on Python 3? What about Mercurial?

Russell VT russellvt@gmail.com
Thu Mar 4 08:45:40 GMT 2021


Cygwin Enthusiasts!

Well, I was going to hold back on this one, but having now watched the list
for a bit, I think this is a fair question (feel free to smack me if I'm
feeling too entitled, albeit maybe a bit on the rambling side).

TLDR; Cygwin 64 Mercurial (5.5.1) blows chunks with default Python install.
I'm still not sure if this is a package dependency error, given the recent
Python 2.7 Deprecation "worldwide," or the way that Mercurial is packaged,
or even if the package installation order on-down the line screwed me up at
some point in the past.

TLDR2; Am I really the "only" one on Cygwin still using Mercurial in a
Complex Python Environment?

Here;s my primary operating environment, devoid of whatever tricks I may
try to play with Python Development environments (read: Path to /usr/bin
with no funny stuff getting in the way)
.

Cygwin: CYGWIN_NT-10.0 3.17(0.340/5/3) 2020-08-22 17:48 x86_64
Python: 3.8.7
Python2: 2.7.18
Python3: 3.8.7

$ ls -1 /usr/bin/python[0-9\.]*

/usr/bin/python2@

/usr/bin/python2.7.exe*

/usr/bin/python3@

/usr/bin/python3-config@

/usr/bin/python3.5@

/usr/bin/python3.5m.exe*

/usr/bin/python3.6@

/usr/bin/python3.6-config@

/usr/bin/python3.6m-config*

/usr/bin/python3.6m.exe*

/usr/bin/python3.7@

/usr/bin/python3.7m.exe*

/usr/bin/python3.8-config*

/usr/bin/python3.8.exe*



Now, running mercurial (hg) with no real options, trying to let python just
use the meta version (3.8.7), and it starts to break with JSONDecoder
issues.

ImportError: cannot import name 'JSONDecodeError'

Of course, Mercurial is also *evil*, and embeds annoying pieces of code,
like the following...
 (pretty much making my "fix" necessary - potentially intentional, to make
people fix their mercurial package prior to the end of the year, as well)

    >> libdir = '../lib/python2.7/site-packages'

...and REALLY hates pylint/pyflakes (in case your vim editor hates-on your
non PEP-8 code as much as mine is set to do.

So, with all that in-mind, here is whatt I summarize:

*Fixes and Workarounds:*
Update /etc/alternatives to point at Python2 (Bad Idea! No no no!)
Update Mercurial to specify /usr/bin/python2 to "stay behind" (Well, "it
works")
 . But, I think "the default" is that it should work... which either means
updating Python

So, digging deeper, and correct me if I'm wrong... but iott looks like the
meta version of Python on Cygwin is now at Python3, which is a good thing.
But with Mercurial depending on the meta Python, rather than sticking
themselves on Python2 (since the JSON import blows). So, the current
Mercurial seems to be 5.5.1 on Cygwin x86_64... which is only a short time
behind. But that's pretty easy, right?

Or to channel my BOFH persona (only because it's already the third month
following a long anticipated date), the Python 2 deprecation wasn't loud
enough for everyone? And now we're only two revisions behind (one major and
one bug fix)... though did Mercurial ever "force" Python 3, or at least get
"sensitive" to it?

So, I understand... that's a LONG way to go to ask all of y'all, how do we
fix this thing? Can someone point me at a good reference to being a Cygwin
contributor, to the point that I can actually help move some things along,
like this, rather than bitching to all y'all about getting it fixed? (Read:
Can I compile this myself, and submit it back to chief stakeholders so that
they may publish a new package? I'm "git" and "devops" fluent, though my C
and its close relatives are on the weak-side, these days - one of
the reasons I want good Python environments!)

Cheers!
Russell VT

-- 
Russell M. Van Tassell <russellvt@gmail.com>


More information about the Cygwin mailing list