able-shampoo-44547
07/08/2022, 12:56 PMtests/test_hyperspec.py F [100%]
=================================== FAILURES ===================================
_________________________________ test_import __________________________________
def test_import():
> import sphinxcontrib.hyperspec
E ModuleNotFoundError: No module named 'sphinxcontrib.hyperspec'
tests/test_hyperspec.py:19: ModuleNotFoundError
- generated xml file: /tmp/process-execution1Z9sbF/tests.test_hyperspec.py.tests0.xml -
=========================== short test summary info ============================
FAILED tests/test_hyperspec.py::test_import - ModuleNotFoundError: No module ...
============================== 1 failed in 0.08s ===============================
I can see the files there, but i can't seem to actually import the module
$ find sphinxcontrib tests
sphinxcontrib
sphinxcontrib/cldomain.lisp
sphinxcontrib/cldomain.py
sphinxcontrib/test.lisp
sphinxcontrib/__init__.py
sphinxcontrib/package.lisp
sphinxcontrib/hyperspec.py
sphinxcontrib/version.lisp-expr
tests
tests/test_cldomain.py
tests/__init__.py
tests/__pycache__
tests/__pycache__/__init__.cpython-38.pyc
tests/__pycache__/test_cldomain.cpython-38-pytest-7.1.2.pyc
I went into the directory directly and tested with a local python and with the sandbox python, but the cached one can't import stuff? I commented out the contents of the files completely, to make sure it wasn't an issue with loading them
$ cd /tmp/.tmpDGxM5D
$ python
Python 3.8.5 (default, Aug 13 2020, 15:51:26)
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sphinxcontrib
>>> import sphinxcontrib.cldomain
>>>
$ /home/russell/.cache/pants/named_caches/pex_root/venvs/s/a67a3153/venv/bin/python3.8
Python 3.8.5 (default, Aug 13 2020, 15:51:26)
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sphinxcontrib
>>> import sphinxcontrib.cldomain
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sphinxcontrib.cldomain'
>>>
any idea what could be going on? i'm on pants 2.12.0narrow-vegetable-37489
07/08/2022, 1:00 PM./pants dependencies tests/test_hyperspec.py
?able-shampoo-44547
07/08/2022, 1:02 PM$ ./pants dependencies tests/test_hyperspec.py
15:02:26.55 [INFO] Initializing scheduler...
15:02:26.75 [INFO] Scheduler initialized.
//:sphinxcontrib-cldomain
sphinxcontrib/__init__.py:lib
sphinxcontrib/cldomain.py:lib
sphinxcontrib/hyperspec.py:lib
curved-television-6568
07/08/2022, 1:08 PMpython_requirement
target is meant for a single dist per target only.
https://www.pantsbuild.org/docs/reference-python_requirement#coderequirementscodeable-shampoo-44547
07/08/2022, 1:17 PMcurved-television-6568
07/08/2022, 1:18 PMpython_requirements
are usually used to source a requirements.txt
file into corresponding python_requirement
targets, which is preferable if you have more than a few 3rdparty dependencies.enough-analyst-54434
07/08/2022, 2:23 PMpython_requirement
being the name used for dep inference? IOW you could also correct by adding module mappings for all requirements. Not that you'd want to do this, just to avoid misunderstanding what was going on there (the assumption being sphinxcontrib
was using pkg_resources
to effect a namespace package).able-shampoo-44547
07/08/2022, 2:50 PMpython_requirements
to declare my library dependencies, do i also need to declare them in the setup.cfg
? or does it propagate through?sphinx
if it's in the requires in any way, it breaks importing. i have restructured my library and that seems to have helped