Skip to content
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

series of issues when converting from poetry in a complex, multiplatform project #745

Closed
earonesty opened this issue Nov 18, 2021 · 4 comments
Labels
🐛 bug Something isn't working

Comments

@earonesty
Copy link

earonesty commented Nov 18, 2021

VERSION: pdm, version 1.10.3

Each number represents some sort of bug/issue:

ISSUE 1 (MINOR). using pyenv-windows, outside of a virtualenv, pdm was not installed to scripts directory. other things install properly. inside of a venv, pdm also installs correctly.

solution: python -mdm

ISSUE 2. import poetry doesn't work with platform specifiers

python -mpdm import -vf poetry ./pyproject.toml
Error: TypeError: __init__() got an unexpected keyword argument 'platform'

Reason: pywin32 = {version = ">=228", platform = "win32"}

solution: removed all platform specifiers (hoping to put them back later)

ISSUE 3 (SEVERE). pdm uses an odd/broken package called pythonfinder, which is incompatible with pyenv-win32, and results in it simply not working because C:/Users/erik/.pyenv/pyenv-win/shims/python is not a binary executable

hardcoded things in the path until it wasn't broken. todo: maybe patch pdm to not use pythonfinder or patch pythonfinder to work with pyenv-win (it calls popen on the result... what if it's a bash script... fails)

ISSUE 4. git@dependencies don't work with platform specifiers: "vidarelay @ git+ssh://git@gitlab.com/atakama/ccserver.git; sys_platform=='win32'" didn't work, i got: pip._vendor.pkg_resources.RequirementParseError: Parse error at "'sys_plat'": Expected stringEnd

removing those specifiers (which is bad, but i wanted to see what happend) finally worked!

ISSUE 5 (WORKAROUND). solver got stuck in an infinite loop : see https://pastebin.com/1NU3HvHp

Solution: remove flake8 (hoping it would help) ... it did!

Finally...solving took a bit longer than poetry... but it worked!

ISSUE 6 (PIP INI, NO GOOD WORKAROUND): installation failures when extra-index-url is required to resolve. the bug seems to be that it is using the SAME --extra-index-url and the --index-url (even thought they are different in my pip.ini) example of pip.ini

[global]
index-url = https://erik:XXXXX@artifacts.XXX.io/repository/vida-pi/simple
extra-index-url = https://pypi.org/simple

output of failure

Traceback (most recent call last):
...
  File "C:\venvs\465ba029bf6c0fbcb108914b9e956119.3a0542912274a141\lib\site-packages\pdm\builders\base.py", line 86, in log_subprocessor
    raise BuildError(
pdm.exceptions.BuildError: Call command ['C:/venvs/465ba029bf6c0fbcb108914b9e956119.3a0542912274a141/Scripts/python.EXE', '-Esm', 'pip', 'install', '--isolated', '--ignore-installed', '--pre
fix', 'C:\\Users\\erik\\AppData\\Local\\Temp\\pdm-build-env-hyq3qnvo-shared', '--index-url', 'https://erik:xxxx@artifacts.xxxxx.io/repository/vida-pi/simple', '--extra-inde
x-url', 'https://erik:xxxxx@artifacts.xxxx.io/repository/vida-pi/simple/', '-r', 'C:\\Users\\erik\\AppData\\Local\\Temp\\pdm-build-reqs-pv9bgtkg.txt'] return non-zero statu
s(1).

Giving up for now :( will revisit later.

@earonesty earonesty added the 🐛 bug Something isn't working label Nov 18, 2021
@frostming
Copy link
Collaborator

ISSUE 2: I didn't see poetry support keyword platform from the docs, change to environment markers would be fine.

ISSUE 4: You need to put a space between the URL and semicolon like vidarelay @ git+ssh://git@gitlab.com/atakama/ccserver.git ; sys_platform=='win32', otherwise it will be parsed as part of the URL

ISSUE 5: might be solved in the main branch, care to have a test?

Other issues might be potential bugs, I will look into them soon. Thanks!

frostming added a commit that referenced this issue Nov 19, 2021
@frostming
Copy link
Collaborator

ISSUE 6: Do you have any source in your project.toml? Only index_url from pip.ini will be read by PDM.

@earonesty
Copy link
Author

earonesty commented Nov 19, 2021

yes we have a source (also your change above fixes the issue with win32, thanks)

name = "nexus"
url = "https://artifacts.xxxxx.io/repository/vida-pi/simple/"

really we need 2 sources though. removing it changed the error in the logs

now i get this:

ERROR: No matching distribution found for setuptools>=40.8.0

it's weird because the solver solved for everything.... the installer just isn't installing.

this is the thing it's trying to install... which is weird, since setuptools is already installed at version 59.2.0 . also not sure why it makes all these little installations to temp files. why not just install everything to the current venv (if one is present) or to the pdm-managed venv?

setuptools >= 40.8.0
wheel

@frostming
Copy link
Collaborator

frostming commented Nov 22, 2021

It is trying to set up an isolated and ephemeral environment for PEP 517 build, pip and build are also doing this way.

Can you show the source table in pyprojec.toml, the pip.ini content, and the output of pdm config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants