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

TypeError when downgrading package during pdm sync #1010

Closed
Hnasar opened this issue Mar 31, 2022 · 1 comment · Fixed by #1550
Closed

TypeError when downgrading package during pdm sync #1010

Hnasar opened this issue Mar 31, 2022 · 1 comment · Fixed by #1550
Labels
⬆️ upstream bug Caused by a bug from the upstream dependencies

Comments

@Hnasar
Copy link
Contributor

Hnasar commented Mar 31, 2022

  • [☑️ ] 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. In windows with python 3.8
  2. pdm install with pyproject.toml that depends on pyqtgraph==0.12.4
  3. modify the pyproject.toml and change to pyqtgraph==0.12.1
  4. pdm install

Actual behavior

...
Update pyside2 5.15.2.1 -> 5.14.2.3 successful
  Retry failed jobs
Update pyqtgraph 0.12.4 -> 0.12.1 failed
Error occurs: 
Traceback (most recent call last):
  File "c:\users\containeradministrator\scoop\apps\python38\current\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\synchronizers.py", line 204, in update_candidate
    self.manager.uninstall(dist)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\manager.py", line 47, in uninstall
    remove_path = self.get_paths_to_remove(dist)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\manager.py", line 43, in get_paths_to_remove
    return StashedRemovePaths.from_dist(dist, environment=self.environment)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\uninstallers.py", line 155, in from_dist
    elif dist.files:
  File "c:\users\containeradministrator\scoop\apps\python38\current\lib\importlib\metadata.py", line 262, in files
    return file_lines and list(starmap(make_file, csv.reader(file_lines)))
TypeError: make_file() takes from 1 to 3 positional arguments but 6 were given
ERRORS:
update pyqtgraph failed:
Traceback (most recent call last):
  File "c:\users\containeradministrator\scoop\apps\python38\current\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\synchronizers.py", line 204, in update_candidate
    self.manager.uninstall(dist)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\manager.py", line 47, in uninstall
    remove_path = self.get_paths_to_remove(dist)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\manager.py", line 43, in get_paths_to_remove
    return StashedRemovePaths.from_dist(dist, environment=self.environment)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\uninstallers.py", line 155, in from_dist
    elif dist.files:
  File "c:\users\containeradministrator\scoop\apps\python38\current\lib\importlib\metadata.py", line 262, in files
    return file_lines and list(starmap(make_file, csv.reader(file_lines)))
TypeError: make_file() takes from 1 to 3 positional arguments but 6 were given
Traceback (most recent call last):
  File "c:\users\containeradministrator\scoop\apps\python38\current\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\containeradministrator\scoop\apps\python38\current\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\builds\software\my-app\venv\Scripts\pdm.exe\__main__.py", line 7, in <module>
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\core.py", line 233, in main
    return Core().main(args)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\core.py", line 168, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\core.py", line 163, in main
    f(options.project, options)
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\cli\commands\sync.py", line 26, in handle
    actions.do_sync(
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\cli\actions.py", line 190, in do_sync
    handler.synchronize()
  File "C:\builds\software\my-app\venv\lib\site-packages\pdm\installers\synchronizers.py", line 352, in synchronize
    raise InstallationError("Some package operations are not complete yet")
pdm.exceptions.InstallationError: Some package operations are not complete yet

Expected behavior

No type error.
Update pyqtgraph 0.12.4 -> 0.12.1 successful

Environment Information

$ pdm info
PDM version:        1.13.6
Python Interpreter: C:\builds\software\my-app\venv\Scripts\python.exe (3.8)
Project Root:       C:/builds/software/my-app
Project Packages:   None
$ pdm info --env
{
  "implementation_name": "cpython",
  "implementation_version": "3.8.10",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.17763",
  "python_full_version": "3.8.10",
  "platform_python_implementation": "CPython",
  "python_version": "3.8",
  "sys_platform": "win32"
}

Extra Information

Source code:

Wheels:

By the way, thank you very much for making PDM! I am very impressed. 非常感谢您!

@Hnasar Hnasar added the 🐛 bug Something isn't working label Mar 31, 2022
@frostming
Copy link
Collaborator

This is an upstream bug, which is reported pypa/installer#117 and a fix has been proposed: pypa/installer#118

@frostming frostming added ⬆️ upstream bug Caused by a bug from the upstream dependencies and removed 🐛 bug Something isn't working labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ upstream bug Caused by a bug from the upstream dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants