Environment info
Bazel version: 9.0.0rc3
rules_python: 1.6.3
rules_pycross: 0.8.1
Description
I just created a Poetry project with poetry init and integrated it with rules_pycross right away. However, because I haven't started working on it, it doesn't have any dependencies yet. As a result, it appears that both raw_lock.json and lock.json in the generated repository omit the packages key, and I get the following error:
ERROR: /home/agni/.cache/bazel/_bazel_agni/72d70f606e4bf63ec51519992d448765/external/rules_pycross+/pycross/private/package_repo.bzl:198:20: An error occurred during the fetch of repository 'rules_pycross++lock_repos+project_requirements':
Traceback (most recent call last):
File "/home/agni/.cache/bazel/_bazel_agni/72d70f606e4bf63ec51519992d448765/external/rules_pycross+/pycross/private/package_repo.bzl", line 198, column 20, in _package_repo_impl
packages = lock["packages"].values()
Error: key "packages" not found in dictionary
Later, I added a dependency using poetry add pyyaml, but kept getting the same error. Recent versions of Poetry seem to be using the project.dependencies section of pyproject.toml, with this syntax:
[project]
# ...
dependencies = [
"pyyaml (>=6.0.3,<7.0.0)"
]
I changed it to be a tool.poetry.dependencies section again, and this time rules_pycross worked.
I think there's one bug and one missing feature here:
- Fix handling of zero-dependency packages.
- Handle
project.dependencies in pyproject.toml.
Environment info
Bazel version: 9.0.0rc3
rules_python: 1.6.3
rules_pycross: 0.8.1
Description
I just created a Poetry project with
poetry initand integrated it withrules_pycrossright away. However, because I haven't started working on it, it doesn't have any dependencies yet. As a result, it appears that bothraw_lock.jsonandlock.jsonin the generated repository omit thepackageskey, and I get the following error:Later, I added a dependency using
poetry add pyyaml, but kept getting the same error. Recent versions of Poetry seem to be using theproject.dependenciessection ofpyproject.toml, with this syntax:I changed it to be a
tool.poetry.dependenciessection again, and this timerules_pycrossworked.I think there's one bug and one missing feature here:
project.dependenciesinpyproject.toml.