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.
Make sure you run commands with -v flag before pasting the output.
Steps to reproduce
Generate a PDM project which uses a custom index
Set-up the index configuration like described in the docs (name + url in pyproject.toml, username + password in the config file)
Generate a second PDM project which does not use the custom index
Use PDM commands (like pdm install) in the second PDM project
Observe AssertionError: Source URL must not be empty for <custom_index>
Actual behavior
Traceback
pdm install -v
Lock file hash doesn't match pyproject.toml, packages may be outdatedUpdating the lock file...Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "c:\users\<username>\.local\bin\pdm.exe\__main__.py", line 7, in <module> File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 290, in main return Core().main(args or sys.argv[1:]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 208, in main raise cast(Exception, err).with_traceback(traceback) from None File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 203, in main self.handle(project, options) File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 157, in handle command.handle(project, options) File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\cli\commands\install.py", line 85, in handle actions.do_lock( File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\cli\actions.py", line 78, in do_lock provider = project.get_provider(strategy, tracked_names, ignore_compatibility=cross_platform) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\project\core.py", line 426, in get_provider repository = self.get_repository(ignore_compatibility=ignore_compatibility) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\project\core.py", line 393, in get_repository sources = self.sources or [] ^^^^^^^^^^^^ File "C:\Users\<username>\.local\pipx\venvs\pdm\Lib\site-packages\pdm\project\core.py", line 383, in sources assert source.url, f"Source URL must not be empty for {source.name}"AssertionError: Source URL must not be empty for <custom_index>
I believe this happens, because the URL of the custom index is neither stored in the config file, nor stored in the pyproject.toml file of the second PDM project. Therefore, the index configuration merging logic fails.
This can be mitigated by storing the URL in the config file as well, but this defeats the purpose of index configuration merging IMO.
Expected behavior
There should be no error in the second project. The custom index should be skipped, because it is not used.
Environment Information
# Paste the output of `pdm info && pdm info --env` below:
PDM version:
2.8.0
Python Interpreter:
F:\python-pdm\.venv\Scripts\python.exe (3.11-32)
Project Root:
F:/python-pdm
Local Packages:
{
"implementation_name": "cpython",
"implementation_version": "3.11.2",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_release": "10",
"platform_system": "Windows",
"platform_version": "10.0.22621",
"python_full_version": "3.11.2",
"platform_python_implementation": "CPython",
"python_version": "3.11",
"sys_platform": "win32"
}
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
Set-up the index configuration like described in the docs (name + url in
pyproject.toml
, username + password in the config file)pdm install
) in the second PDM projectAssertionError: Source URL must not be empty for <custom_index>
Actual behavior
Traceback
I believe this happens, because the URL of the custom index is neither stored in the config file, nor stored in the
pyproject.toml
file of the second PDM project. Therefore, the index configuration merging logic fails.This can be mitigated by storing the URL in the config file as well, but this defeats the purpose of index configuration merging IMO.
Expected behavior
There should be no error in the second project. The custom index should be skipped, because it is not used.
Environment Information
The text was updated successfully, but these errors were encountered: