EmbarkStudios / pdm-plugin-torch

A tool for managing torch-variants with PDM.
Apache License 2.0
32 stars 5 forks source link

pdm torch lock fails with PDM 2.10.0 #15

Closed lucidfrontier45 closed 1 year ago

lucidfrontier45 commented 1 year ago

It look like the internal API of PDM changed.

Traceback (most recent call last):
  File "/home/du/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/data/home/du/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 295, in main
    return Core().main(args or sys.argv[1:])
  File "/data/home/du/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 208, in main
    raise cast(Exception, err).with_traceback(traceback) from None
  File "/data/home/du/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 203, in main
    self.handle(project, options)
  File "/data/home/du/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm/core.py", line 157, in handle
    command.handle(project, options)
  File "/data/home/du/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm_plugin_torch/main.py", line 405, in handle
    results[api] = do_lock(
  File "/data/home/du/.local/pipx/venvs/pdm/lib/python3.10/site-packages/pdm_plugin_torch/main.py", line 183, in do_lock
    data = format_lockfile(project, mapping, dependencies)
TypeError: format_lockfile() missing 2 required positional arguments: 'groups' and 'strategy'

pyproject.toml is as follows

[project]
name = ""
version = ""
description = ""
dependencies = []
requires-python = ">=3.11"
readme = "README.md"
license = {text = "MIT"}

[tool.pdm.plugins.torch]

dependencies = [
   "torch==2.1.0"
]

lockfile = "torch.lock"
enable-cpu = true
enable-cuda = true
cuda-versions = ["cu121", "cu118"]
tgolsson commented 1 year ago

Thanks for the report! Seems like every version of PDM there's some form of breakage in the APIs :(

tgolsson commented 1 year ago

Fixed in next release, hopefully made this afternoon! Thanks for the report.