Closed danyeaw closed 5 years ago
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:
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.
I have setuptools installed via pacman only.
Try passing --no-build-isolation
to pip install
@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 FileNotFoundError: [Errno 2] No such file or directory: 'setup.py'
error.
--no-build-isolation only works for non-PEP517 installed packages, and in this case poetry doesn't have a setup.py. I get a
FileNotFoundError: [Errno 2] No such file or directory: 'setup.py'
error.
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.
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.
This is what I did now in #5260
@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
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.