-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Import from Poetry fails #1384
Comments
Where is the key It is unfair to blame PDM if the field isn't documented at all. |
Well, of course it's unfair so i'm just letting community know that there is a problem, no blame at all. |
Well, but |
Would it be acceptable:
|
I've opened an issue on Poetry to document the schema for dependencies: python-poetry/poetry#6600 I agree, I'm sure how you were supposed to know. Edit: They've provided this helpful link! https://github.com/python-poetry/poetry-core/blob/main/src/poetry/core/json/schemas/poetry-schema.json |
The unrecognized arguments will be ignored now, close this issue |
Make sure you run commands with
-v
flag before pasting the output.Steps to reproduce
You need a poetry formatted
pyproject.toml
with dependency described like this:"uvloop = {version = "^0.16", optional=true,
platform="linux"
}"then run:
>>> pdm import -f poetry pyproject.toml -v
Actual behavior
But instead of success receive an error: TypeError: init() got an unexpected keyword argument 'platform'
if key "platform" removed from from pyproject.tom then pdm imports poetry file without errors.
Traceback (most recent call last):
File "/Users/user/.pyenv/versions/prj/bin/pdm", line 8, in
sys.exit(main())
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/core.py", line 254, in main
return Core().main(args)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/core.py", line 187, in main
raise cast(Exception, err).with_traceback(traceback)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/core.py", line 182, in main
f(options.project, options)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/cli/commands/import_cmd.py", line 35, in handle
do_import(project, options.filename, options.format, options)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/cli/actions.py", line 734, in do_import
project_data, settings = FORMATS[key].convert(project, filename, options)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/formats/poetry.py", line 210, in convert
return converter.convert()
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/formats/base.py", line 59, in convert
self._data[key] = func(self, value)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/formats/poetry.py", line 137, in dependencies
req = _convert_req(key, req_dict)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/formats/poetry.py", line 91, in _convert_req
return Requirement.from_req_dict(name, req_dict).as_line()
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/models/requirements.py", line 188, in from_req_dict
return NamedRequirement.create(name=name, **req_dict)
File "/Users/user/.pyenv/versions/3.9.13/envs/prj/lib/python3.9/site-packages/pdm/models/requirements.py", line 151, in create
return cls(**kwargs)
TypeError: init() got an unexpected keyword argument 'platform'
Expected behavior
## Environment Information
The text was updated successfully, but these errors were encountered: