You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ pdm export -v
Traceback (most recent call last):
File "/Users/niklas.rosenstein/.local/bin/pdm", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/pdm/core.py", line 346, in main
return core.main(args or sys.argv[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/pdm/core.py", line 264, in main
raise cast(Exception, err).with_traceback(traceback) from None
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/pdm/core.py", line 259, in main
self.handle(project, options)
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/pdm/core.py", line 195, in handle
command.handle(project, options)
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/pdm/cli/commands/export.py", line 99, in handle
content = FORMATS[options.format].export(project, packages, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/pdm/formats/requirements.py", line 230, in export
url = source["url"]
~~~~~~^^^^^^^
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/tomlkit/items.py", line 1506, in __getitem__
return cast(Item, self._value[key])
~~~~~~~~~~~^^^^^
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/tomlkit/container.py", line 624, in __getitem__
item = self.item(key)
^^^^^^^^^^^^^^
File "/Users/niklas.rosenstein/.local/pipx/venvs/pdm/lib/python3.12/site-packages/tomlkit/container.py", line 466, in item
raise NonExistentKey(key)
tomlkit.exceptions.NonExistentKey: 'Key "url" does not exist.'
Actual behavior
PDM errors because of the missing url key in [[tool.pdm.source]]{name="pypi"}, but other commands fall back to the standard PyPI URL as expected (e.g. pdm install/pdm lock/etc.)
Expected behavior
pdm export understands name = "pypi" and assumes the default URL.
Environment Information
# Paste the output of `pdm info && pdm info --env` below:
PDM version:
2.17.3
Python Interpreter:
/Users/niklas.rosenstein/myproject/.venv/bin/python (3.10)
Project Root:
/Users/niklas.rosenstein/myproject
Local Packages:
{
"implementation_name": "cpython",
"implementation_version": "3.12.4",
"os_name": "posix",
"platform_machine": "arm64",
"platform_release": "23.6.0",
"platform_system": "Darwin",
"platform_version": "Darwin Kernel Version 23.6.0: Fri Jul 5 17:56:39 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T8122",
"python_full_version": "3.10.14",
"platform_python_implementation": "CPython",
"python_version": "3.10",
"sys_platform": "darwin"
}
The text was updated successfully, but these errors were encountered:
Make sure you run commands with
-v
flag before pasting the output.Steps to reproduce
Running
pdm export -v
givesActual behavior
PDM errors because of the missing
url
key in[[tool.pdm.source]]{name="pypi"}
, but other commands fall back to the standard PyPI URL as expected (e.g.pdm install
/pdm lock
/etc.)Expected behavior
pdm export
understandsname = "pypi"
and assumes the default URL.Environment Information
The text was updated successfully, but these errors were encountered: