Skip to content

Changing a dependency in pyproject.toml and poetry.lock does not get updated in bazel #2

Description

@ruidc

in my pyproject.toml

...
[tool.poetry.dependencies]
python = "3.7.6"
click = "7.1.1"
...

and my BUILD:

load("@rules_python//python:defs.bzl", "py_test")
load("@solution_pip//:requirements.bzl", "requirement")

py_test(
    name = "test_example",
    srcs = ["test_example.py"],
    deps = [
        requirement("click"),
    ],
)

and my test_example.py:

import sys
import unittest
import click

class TestExample(unittest.TestCase):
    def test_version(self):
        assert (platform.python_version() == "3.7.6")
        print(os.getcwd())
        print(sys.executable)
        print(click.__version__)
        assert ('poetry' in sys.executable)
        assert (click.__version__ == "7.1.1")
        # self.assertEqual(True, False)


if __name__ == '__main__':
    unittest.main()

running bazel test //packages/example/test:test_example
works fine, updating click to 7.1.2 via poetry update sets the lockfile and toml correctly, but in the temp directory created by bazel, it doesn't update where I would have expected it to do so.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions