incalculable-yacht-22392
02/08/2025, 6:19 PMpants dependencies blah/blah to do much more than spit out hundreds of lines of sad text. And tests to be able to find libraries in the existing requirements.txt. So a đź§µif anyone is will to help fill in some gaps in my understandingincalculable-yacht-22392
02/08/2025, 6:25 PMincalculable-yacht-22392
02/08/2025, 6:27 PMincalculable-yacht-22392
02/08/2025, 6:28 PMincalculable-yacht-22392
02/08/2025, 6:31 PMpython_tests(
name="tests",
)
python_requirement(
name="pytest-sockets",
requirements=["pytest-socket==0.7.0", "pytest==8.3.4"],
dependencies=["beam/requirements.txt:reqs"]
)incalculable-yacht-22392
02/08/2025, 6:31 PMPlugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ModuleNotFoundError: No module named 'pytest_socket' (from beam/conftest.py)
For more information see <https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning>
config = pluginmanager.hook.pytest_cmdline_parse(
ImportError while loading conftest 'beam/conftest.py'.
beam/conftest.py:2: in <module>
from pytest_socket import disable_socket
E ModuleNotFoundError: No module named 'pytest_socket'incalculable-yacht-22392
02/08/2025, 6:32 PMpython_requirements(
name="reqs",
source="requirements.txt",
)incalculable-yacht-22392
02/08/2025, 6:37 PMsource="/beam/requirements.txt to reference a file above in the folder hierarchy is not allowed.incalculable-yacht-22392
02/08/2025, 6:41 PMincalculable-yacht-22392
02/08/2025, 7:50 PMsetup.py which enables that upper level package folder to be referenced as say package,models This was done long before my time so I have some reading up to dohappy-kitchen-89482
02/08/2025, 10:25 PMpython_requirements(
name="reqs",
source="requirements.txt",
)
needs to be in a BUILD file that is a sibling of the requirements.txt file.happy-kitchen-89482
02/08/2025, 10:26 PMhappy-kitchen-89482
02/08/2025, 10:26 PMpants roots will list them)quick-monkey-24518
02/10/2025, 9:01 AMpython_test_utils(
name="test_utils",
dependencies=[
# add your dependencies here
)incalculable-yacht-22392
02/10/2025, 1:39 PMpackage.models or package.utilities not ../package/models and there is no manipulation of sys.path.incalculable-yacht-22392
02/10/2025, 1:40 PMpython_test_utils that could be very helpful, thankshappy-kitchen-89482
02/10/2025, 5:09 PMfrom foo.bar import baz then the dir structure should be <source root>/foo/bar.py or whatever)happy-kitchen-89482
02/10/2025, 5:11 PMhappy-kitchen-89482
02/10/2025, 5:13 PMincalculable-yacht-22392
02/10/2025, 8:10 PMrun, list and test and the pants dependencies output looks clean. I'll work on the requirements_*.txt files next.
I interpreted the documentation to say something different:
Typically, there would be one BUILD file in every directory containing source code and any other resources you may want to use as part of your builds. Also pants tailor :: places many BUILD files throughout the code base, not just at my source root.
After running pants tailer :: again on my working setup, I only need to remove this from the abs root BUILD file
python_sources(
name="root"
)