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
[ ✓] I have searched the issue tracker and believe that this is not a duplicate.
I'm trying to set credentials for a private pypi repo globally in /etc/xdg/pdm/config.toml. The exact same settings work fine when added to the user-specific $XDG_CONFIG_HOME/pdm/config.toml but results in the error TypeError: pdm._types.RepositoryConfig() argument after ** must be a mapping, not RepositoryConfig when added to the global config.
$ pdm init -v .
Traceback (most recent call last):
File "/usr/local/bin/pdm", line 8, in<module>sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/pdm/core.py", line 290, in main
returnCore().main(args or sys.argv[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pdm/core.py", line 208, in main
raise cast(Exception, err).with_traceback(traceback) from None
File "/usr/local/lib/python3.11/site-packages/pdm/core.py", line 203, in main
self.handle(project, options)
File "/usr/local/lib/python3.11/site-packages/pdm/core.py", line 136, in handle
self.ui.set_theme(project.global_config.load_theme())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pdm/project/config.py", line 265, in load_theme
return rich.theme.Theme({k[6:]: v fork, vinself.items() if k.startswith("theme.")})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pdm/project/config.py", line 265, in<dictcomp>return rich.theme.Theme({k[6:]: v fork, vinself.items() if k.startswith("theme.")})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen _collections_abc>", line 861, in __iter__
File "/usr/local/lib/python3.11/site-packages/pdm/project/config.py", line 297, in __getitem__
repo = self.get_repository_config(parts[1], parts[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pdm/project/config.py", line 400, in get_repository_config
repositories[key] = RepositoryConfig(**v, name=key, config_prefix=prefix)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: pdm._types.RepositoryConfig() argument after ** must be a mapping, not RepositoryConfig
The same behaviour results from trying to add a package to an existing project with pdm add.
Actual behavior
pdm init dies with an error and no pyproject.toml is generated.
Expected behavior
pdm init results in the project being initialized.
Environment Information
# Paste the output of `pdm info && pdm info --env` below:
$ pdm info && pdm info --env
[TypeError]: pdm._types.RepositoryConfig() argument after ** must be a mapping, not RepositoryConfig
Add '-v' to see the detailed traceback
I'm trying to set credentials for a private pypi repo globally in
/etc/xdg/pdm/config.toml
. The exact same settings work fine when added to the user-specific$XDG_CONFIG_HOME/pdm/config.toml
but results in the errorTypeError: pdm._types.RepositoryConfig() argument after ** must be a mapping, not RepositoryConfig
when added to the global config.Steps to reproduce
Write to /etc/xdg/pdm/config.toml
Try to initialize a project
The same behaviour results from trying to add a package to an existing project with
pdm add
.Actual behavior
pdm init
dies with an error and nopyproject.toml
is generated.Expected behavior
pdm init
results in the project being initialized.Environment Information
After deleting
/etc/xdg/pdm/config.toml
:The text was updated successfully, but these errors were encountered: