gentle-painting-24549
11/29/2022, 5:17 PMconda install gdcm
inside of tox to run our tests. Without having access to Conda an alternative I’ve found is to use python-gdcm
instead which is a Python wrapper for GDCM. I’ve tried to attach this dependency to the tests using a `python_requirement`:
python_requirement(
name="gdcm",
requirements=["python-gdcm"],
)
python_tests(
name="tests",
sources=[
"tests/**/test_*.py",
"tests/test_*.py",
],
dependencies=[
":conftest",
":test-resources",
":gdcm",
],
)
However this doesn’t work and python-gdcm
doesn’t get installed into the underlying testing PEXs unless I add this snippet to one of my test files:
try:
import gdcm # noqa
except ImportError:
pass
How can I have the tests depend on python-gdcm
without the attempted import? Or alternatively, how can I give Pants access to the underlying gdcm binary (for example, one that was installed by brew or conda on the host system)?