Skip to content

target 'library_pytest' not declared in package '' #19

@ibolit

Description

@ibolit

What I am doing:
I copied the WORKSPACE setup verbatim and added a poetry dependency to one of my targets. This configuration worked, then I worked on some other Bazel functionality for my project. When I tried running tests after I was done with my other functionality, the rules_poetry seem to no longer work.

That other functionality has nothing to do with poetry or pip, but it does involve building wheels from my source code, it uses the standard python_rules py_package and py_wheel for that.

What is the problem:
When I run bazel test ..., I get this error:

bazel test ...
ERROR: /Users/me/Work/dialog_platform/_experimental_lib_for_bazel/BUILD.bazel:16:8: no such target '@poetry//:library_fastapi': target 'library_fastapi' not declared in package '' defined by /private/var/tmp/_bazel_me/69e3e7ed8e1fbf19ba79afe448a27e50/external/poetry/BUILD and referenced by '//_experimental_lib_for_bazel:test_experimental_lib_for_bazel'
ERROR: /Users/me/Work/dialog_platform/_experimental_lib_for_bazel/BUILD.bazel:16:8: no such target '@poetry//:library_pytest': target 'library_pytest' not declared in package '' defined by /private/var/tmp/_bazel_me/69e3e7ed8e1fbf19ba79afe448a27e50/external/poetry/BUILD and referenced by '//_experimental_lib_for_bazel:test_experimental_lib_for_bazel'
ERROR: Analysis of target '//_experimental_lib_for_bazel:test_experimental_lib_for_bazel' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.432s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)

This is the complete output of the command.

I tried reproducing this problem on another computer, but couldn't.

I tried running bazel clean and cleaning my poetry caches as well. It did not help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions