-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
python-setuptools: DistutilsPlatformError #5155
Comments
Yeah, it's not passing an encoding here: https://github.com/sdispater/poetry/blob/b4f9e3fc9303bf4039f52ee19a1bf680684000ca/poetry/masonry/metadata.py#L49 Please file a poetry bug.
Try passing |
@lazka Thanks for the feedback. I opened an issue with Poetry, and I'll try to get a PR submitted to get it fixed. --no-build-isolation only works for non-PEP517 installed packages, and in this case poetry doesn't have a setup.py. I get a |
Oh, I see. No idea :/ |
@lazka What are your thoughts on an overall strategy on fixing these types of Python issues along with #5001. It seems like Python is changing faster than we can patch downstream. Would it at least be worthwhile to start a discussion on the python-dev mailing list about where there is interest in the Python community providing more official support for MSYS2? |
What would be the goal of starting a discussion there? No one there is using it and probably doesn't plan to. We could spin the Python3 package out into a CPython fork with patches on top (+ CI maybe?) and try to push some simple (not MSYS2 specific) things upstream. That would probably make it more visible as its own "platform". But, time.... :) For the setuptools error, we could try to patch msvc9compiler.py (which fails here because it tries to detect the MSVC version Python was built with) to not fail to import, maybe we can then drop the setuptools patch. |
We currently patch setuptools itself to not import distutils.msvc9compiler, which fails because it fails to detect the msvc version and falls back to an unsupported version 6 and raises. This doesn't help much in case setuptools is installed through pip which doesn't contain the fix. This fixes msvc9compiler.py instead to not fail on import but at the compiler instance creation, i.e. the point where the version is actually used. The setuptools fix remains for now to make updates easier. Fixes msys2#5155
This is what I did now in #5260 |
python: better compatibility with unpatched setuptools. Fixes #5155
@lazka Thanks so much for resolving this ❤️ |
Note that installation will still be broken in some cases, not sure when this is relevant for example: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python-setuptools/0001-mingw-python-fix.patch |
We need to keep the old msys base for binary compatibility with older curl, but that version doesn't have the fix for that issue.
We need to keep the old msys base for binary compatibility with older curl, but that version doesn't have the fix for that issue.
We need to keep the old msys base for binary compatibility with older curl, but that version doesn't have the fix for that issue.
We need to keep the old msys base for binary compatibility with older curl, but that version doesn't have the fix for that issue.
We need to keep the old msys base for binary compatibility with older curl, but that version doesn't have the fix for that issue.
When trying to install a package locally, I am getting a UnicodeDecodeError. It looks like Python is trying to use cp1252 while loading the metadata for PEP517. I would expect that it needs to use UTF-8 in order correctly decode the metadata.
locale.getpreferredencoding() is cp1252.
Poetry is not using an encoding when it calls open(), so I forked the project and edited the metadata module. I then tried to install this version:
I have setuptools installed via pacman only. I have also removed all of Python 3 and dependencies, along with the full /lib/python3.7 directory to make sure the distutils installed versions were blow away as well. I only used
pip3 install --user
to prevent any pip vs. pacman conflicts.The text was updated successfully, but these errors were encountered: