nutritious-hair-72580
03/17/2021, 10:49 AMpython_library()
is required for tests to do imports (relative in my case). I only picked this up by looking at the example-python repo.
Say i have
• project1
• project2
◦ some-nesting
▪︎ greet
• greeting_test.py
• greeting.py
• BUILD
Then to do import Greeting from .greeting
in the test file, i need to both have the source root as /project2/some-nesting
and in the build file
python_library()
python_test(name="greet")
Reading the docs (https://www.pantsbuild.org/docs/python-test-goal), I got the impression that python_library was only required for test utils and/or binaries.hundreds-father-404
03/17/2021, 2:04 PMnutritious-hair-72580
03/17/2021, 3:54 PM