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

export fails for project with no name #126

Closed
1 task done
jmfederico opened this issue Jun 23, 2020 · 0 comments
Closed
1 task done

export fails for project with no name #126

jmfederico opened this issue Jun 23, 2020 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@jmfederico
Copy link

When exporting dependencies from a project which is not a library (is not self installable) an error is raised due to it not being available in the calculated dependencies.
https://github.com/frostming/pdm/blob/master/pdm/cli/commands/export.py#L40-L41

A simple solution is to change line https://github.com/frostming/pdm/blob/master/pdm/cli/commands/export.py#L41 to temp.pop(project.meta.name, None).

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

Steps to reproduce

Actual behavior

❯ pdm export -v
Traceback (most recent call last):
  File "/Users/my_user/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/Users/my_user/.local/pipx/venvs/pdm/lib/python3.8/site-packages/pdm/core.py", line 68, in __call__
    return self.main(*args, **kwargs)
  File "/Users/my_user/.local/pipx/venvs/pdm/lib/python3.8/site-packages/pdm/core.py", line 100, in main
    raise err.with_traceback(traceback)
  File "/Users/my_user/.local/pipx/venvs/pdm/lib/python3.8/site-packages/pdm/core.py", line 96, in main
    f(options.project, options)
  File "/Users/my_user/.local/pipx/venvs/pdm/lib/python3.8/site-packages/pdm/cli/commands/export.py", line 41, in handle
    temp.pop(project.meta.name)
KeyError: None

Expected behavior

❯ pdm export
click==7.1.2; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4" \
    --hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc \
    --hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a```
...

Environment Information

❯ pdm info && pdm info --env
PDM version:        0.8.4
Python Interpreter: /Users/federico/.pyenv/shims/python3.8 (3.8.3)
Project Root:       /Volumes/Development/test-project
{
  "implementation_name": "cpython",
  "implementation_version": "3.8.3",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "19.5.0",
  "platform_system": "Darwin",
  "platform_version": "Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64",
  "python_full_version": "3.8.3",
  "platform_python_implementaiton": "CPython",
  "python_version": "3.8",
  "sys_platform": "darwin"
}
@jmfederico jmfederico added the 🐛 bug Something isn't working label Jun 23, 2020
frostming added a commit that referenced this issue Jun 24, 2020
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

1 participant