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

pdm export raises KeyError #2407

Closed
1 task done
j1g5awi opened this issue Nov 15, 2023 · 1 comment
Closed
1 task done

pdm export raises KeyError #2407

j1g5awi opened this issue Nov 15, 2023 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@j1g5awi
Copy link

j1g5awi commented Nov 15, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

  1. clone nonepkg/plugin-all4one@0482129
  2. pdm export -v

Actual behavior

The exported requirements file is no longer cross-platform. Using it on other platforms may cause unexpected result.
STATUS: Resolving packages from lockfile...
Traceback (most recent call last):
  File "/home/jigsaw/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 295, in main
    return Core().main(args or sys.argv[1:])
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 208, in main
    raise cast(Exception, err).with_traceback(traceback) from None
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 203, in main
    self.handle(project, options)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 157, in handle
    command.handle(project, options)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/cli/commands/export.py", line 69, in handle
    candidates = resolve_candidates_from_lockfile(project, requirements.values())
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/cli/actions.py", line 142, in resolve_candidates_from_lockfile
    mapping, *_ = resolve(
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/resolver/core.py", line 36, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/resolvelib/resolvers.py", line 426, in resolve
    name = min(unsatisfied_names, key=self._get_preference)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/resolvelib/resolvers.py", line 203, in _get_preference
    return self._p.get_preference(
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/resolver/providers.py", line 91, in get_preference
    deps = self.get_dependencies(candidate)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/resolver/providers.py", line 214, in get_dependencies
    deps, requires_python, _ = self.repository.get_dependencies(candidate)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/models/repositories.py", line 103, in get_dependencies
    requirements, requires_python, summary = getter(candidate)
  File "/home/jigsaw/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/models/repositories.py", line 555, in _get_dependencies_from_lockfile
    return self.candidate_info[self._identify_candidate(candidate)]
KeyError: ('pydantic[dotenv]', '1.10.11', None, False)

Expected behavior

no KeyError

Environment Information

PDM version:
  2.10.1
Python Interpreter:
  /home/jigsaw/Documents/Program/nonepkg/nonebot-plugin-all4one/.venv/bin/python (3.10)
Project Root:
  /home/jigsaw/Documents/Program/nonepkg/nonebot-plugin-all4one
Local Packages:

{
  "implementation_name": "cpython",
  "implementation_version": "3.10.12",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.1.55",
  "platform_system": "Linux",
  "platform_version": "#1-NixOS SMP PREEMPT_DYNAMIC Sat Sep 23 09:11:13 UTC 2023",
  "python_full_version": "3.10.12",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "linux"
}

related: #1786

@j1g5awi j1g5awi added the 🐛 bug Something isn't working label Nov 15, 2023
@frostming
Copy link
Collaborator

See #2358

@frostming frostming closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
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