stale-nightfall-29801
10/22/2021, 9:17 AMcore
is working fine (it's tests run and it packages from what I can tell) and it's BUILD file looks like this:
python_library(
name = "core",
sources = ["core/*.py"],
)
python_tests(
name="test",
sources = ["test/test_*.py"],
dependencies=["core"],
)
python_distribution(
name="dist",
dependencies=["core"],
setup_py_commands=["bdist_wheel", "sdist"],
provides=setup_py(
name='core',
version="1.0.0",
description='blah, blah, blah',
),
)
foo
which depends on core can not find core as per this error:
________________ ERROR collecting foo/test/test_cherrypy.py _________________
ImportError while importing test module '/tmp/process-executionLlK5rO/foo/test/test_cherrypy.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/home/james/.pyenv/versions/3.8.12/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
foo/test/test_cherrypy.py:11: in <module>
from core.test_utils import token
E ModuleNotFoundError: No module named 'core.test_utils'
foo
's BUILD looks like this:
python_library(
name = "foo",
sources = ["foo/jwtutils.py", "foo/jwthug.py", "foo/jwtcherry.py"],
dependencies = ["core:core"]
)
python_tests(
name="test",
sources = ["test/test_*.py"],
dependencies=[
"core:core",
"thirdparty/python:cherrypy"
],
)
python_distribution(
name="dist",
dependencies=["foo"],
setup_py_commands=["bdist_wheel", "sdist"],
provides=setup_py(
name='foo',
version="1.0.0",
description='foo library',
),
)
My expectation is that the dependencies
in python_tests
make the core
library available to foo, is this assumption incorrect?