ambitious-actor-36781
06/24/2021, 12:39 AMpython_distribution
instead of a python_library
in tests.
... I have a library that I'm trying to bring into the fold that makes heavy use of setuptools entrypoints and ... stuff.
Which doesn't seem to play nice at all with pants.enough-analyst-54434
06/24/2021, 12:46 AMambitious-actor-36781
06/24/2021, 12:48 AM$ pants dependencies //src/python/sportr_app:sportr_app_dist
src/python/sportr_app/__init__.py
src/python/sportr_app/app.py
src/python/sportr_app/initialization.py
src/python/sportr_app/main.py
src/python/sportr_app/plugins/__init__.py:../sportr_app
src/python/sportr_app/plugins/console_commands.py:../sportr_app
src/python/sportr_app/system_plugins/__init__.py:../sportr_app
src/python/sportr_app/system_plugins/app_loader.py:../sportr_app
src/python/sportr_app/system_plugins/logging/__init__.py:../../sportr_app
src/python/sportr_app/system_plugins/logging/logging.py:../../sportr_app
src/python/sportr_app/system_plugins/logging/logging_formatter.py:../../sportr_app
src/python/sportr_app/system_plugins/logging/loglimiter.py:../../sportr_app
src/python/sportr_app/system_plugins/logging/source_monitoring_logging.py:../../sportr_app
src/python/sportr_app/system_plugins/plugin_loader.py:../sportr_app
src/python/sportr_app/system_plugins/settings.py:../sportr_app
src/python/sportr_app/utils.py
Yet, when the test runs, it errors with import problems
from .logging import init_system, setting_mergers, DEFAULT_SETTINGS, PRIORITY
E ModuleNotFoundError: No module named 'sportr_app.system_plugins.logging.logging'
If we find out which files it's looking at:
-> raise self.CollectError(
(Pdb) import sportr_app
(Pdb) pp sportr_app
<module 'sportr_app' from '/tmp/.tmpOY2Dm4/src/python/sportr_app/__init__.py'>
We've only got a small subset of the files?
╰─➤ find /tmp/.tmpOY2Dm4/src/python/sportr_app/ -name "*.py" 1 ↵
/tmp/.tmpOY2Dm4/src/python/sportr_app/__init__.py
/tmp/.tmpOY2Dm4/src/python/sportr_app/initialization.py
/tmp/.tmpOY2Dm4/src/python/sportr_app/system_plugins/logging/__init__.py
/tmp/.tmpOY2Dm4/src/python/sportr_app/system_plugins/logging/logging_formatter.py
/tmp/.tmpOY2Dm4/src/python/sportr_app/system_plugins/__init__.py
/tmp/.tmpOY2Dm4/src/python/sportr_app/utils.py
/tmp/.tmpOY2Dm4/src/python/sportr_app/app.py
python_tests(
name="tests",
dependencies=[
],
runtime_package_dependencies=[
"//src/python/sportr_app:sportr_app_dist",
"./sportr_app_test_package",
]
)
hundreds-father-404
06/24/2021, 3:50 AMambitious-actor-36781
06/24/2021, 4:04 AMsportr_app
fine.
It's picking up the right files, it's putting them all in the wheel, and if you install that wheel in a virtualenv it does the importing fine.
But when I use runtime_package_dependencies
in it's tests it doesn't look like all the files from the wheel make it into the test environmentstill might not work when things it depends on are brought into the fold.
The other things that I'm going to bring into the pants repo depend on this, and make use of the overcomplicated setuptools hooks. But I'll probably just do workarounds for thatruntime_package_dependencies
doesn't actually /install/ the output of pants package
it just sticks the output in the test-target path.
Duh, no wonder it's not working like I expectproud-dentist-22844
06/24/2021, 3:59 PM