rules_pycross icon indicating copy to clipboard operation
rules_pycross copied to clipboard

fix(pdm): support lock-spec >=4.5

Open betaboon opened this issue 1 year ago • 6 comments

We're now running into similar issues as #115.

I know this change is most likely insufficient, but unblocks us for now.

let's take this as a starting point for discussion :)

betaboon avatar Oct 02 '24 13:10 betaboon

I have the same issue. This workaround let me move forward but I can't migrate to Bazel 8.

rparme avatar Jan 22 '25 23:01 rparme

but I can't migrate to Bazel 8.

Because of these rules? There have been some recent Bazel 8 fixes, although they haven't been released to BCR yet.

jvolkman avatar Jan 22 '25 23:01 jvolkman

When I ran into this issue at first, I started to use this workaround with git_override. To migrate to Bazel 8, I needed #133 and until this one (#122) is fixed, I won't be able to have both, am I? I could still apply a patch locally but I'm not that desperate =)

rparme avatar Jan 23 '25 00:01 rparme

i think this workaround is far from correct. I'm not using pdm anymore, so i don't really have the motivation to finish this right now. so anyone that uses pdm: feel free to pick this up.

betaboon avatar Jan 23 '25 07:01 betaboon

Agreed and I'm starting to doubt this is actually the source of my issue. I tried uv instead ofpdm but as soon as I upgrade to pycross 0.7.1 I get the same error:

ERROR: error loading package 'alma/stamp_api': at /home/alma/almaio/tools/build_rules/prelude_bazel:5:6: Encountered error while reading extension file 'requirements.bzl': no such package '@@rules_pycross~~lock_repos~pdm_deps//': no such package '@@rules_pycross~~lock_import~pdm_deps//': Internal command failed: ["/home/alma/.cache/bazel/_bazel_alma/9f48f5f58a3505b48420e308b148cf88/external/rules_pycross~~pycross~rules_pycross_internal/exec_venv/bin/python", "/home/alma/.cache/bazel/_bazel_alma/9f48f5f58a3505b48420e308b148cf88/external/rules_pycross~/pycross/private/tools/pdm_translator.py", "--project-file", "/home/alma/almaio/pyproject.toml", "--lock-file", "/home/alma/almaio/pdm.lock", "--output", "raw_lock.json", "--default", "--require-static-urls"]
Traceback (most recent call last):
  File "/home/alma/.cache/bazel/_bazel_alma/9f48f5f58a3505b48420e308b148cf88/external/rules_pycross~/pycross/private/tools/pdm_translator.py", line 395, in <module>
    main(parse_flags())
  File "/home/alma/.cache/bazel/_bazel_alma/9f48f5f58a3505b48420e308b148cf88/external/rules_pycross~/pycross/private/tools/pdm_translator.py", line 307, in main
    lock_set = translate(
               ^^^^^^^^^^
  File "/home/alma/.cache/bazel/_bazel_alma/9f48f5f58a3505b48420e308b148cf88/external/rules_pycross~/pycross/private/tools/pdm_translator.py", line 264, in translate
    raise MismatchedVersionException(
MismatchedVersionException: Found no packages to satisfy dependency (name=importlib-resources, spec=)

rparme avatar Jan 23 '25 19:01 rparme

To whoever comes here, I managed to migrate to uv following example from e2e/. No more issues.

rparme avatar Feb 14 '25 15:02 rparme