<#20292 Support to output the true command execute...
# github-notifications
c
#20292 Support to output the true command execute on the sandbox. New discussion created by hackrole Hi, I am stuck into pants now. I have python project using pants. It have following structure, as I think this is the most common structure pattern on python project. image We write test with
pytest
, and using
pytest-dotenv
to setup some environment for pytest to work, for example MYSQL_DB_HOST. My
agent/build
file look like this:
Copy code
resources(name="test_env", sources=[".test.env"])

poetry_requirements(name="poetry_deps")

python_sources(name="agent", sources=["app/**/*.py"], dependencies=[":poetry_deps"])

python_sources(name="test_agent", sources=["tests/**/*.py"])

python_tests(name="tests", sources=["tests/**/test_*.py"], dependencies=[":agent", ":test_agent", ":test_env"])
But current the .test.env seems not load. I have save and enter the sandbox diretory. Run pytest in the sandbox with virtualenv is working. But the pants complains about the MYSQL_DB_HOST not defined. I am guess the problem is that pants run command in wrong directory or with wrong paramters. But I have no idea to figure out what exactly the pants run. This add too much difficulty on debug and fix issues. I am sorry If I miss somthing in the doc. But I checkout the pants document without ways to do such things. It will be nice to be able to see what the pants really execute. pantsbuild/pants