Hello! I'm trying to put some pants on my existing...
# general
b
Hello! I'm trying to put some pants on my existing python monorepo. I have a few folders with
pyproject.toml
, and per the guidance (ex1, ex2), and I'm trying to move everything to one requirements.txt file. The problem is that I don't know what to put in the files like frontend/BUILD and backend/BUILD. When I leave them blank, I get warnings that the files can't be found, but when I just leave the default
pants tailor ::
(
poetry_requirements(name="poetry",)
), I get an error that the requirements are reproduced, since they're imported both from the root requirements and from the frontend. What should I do to get this to work properly and pull all the requirements from the root? Thank you so much for your help! . ├── BUILD ├── frontend │ ├── BUILD │ ├── README.md │ ├── frontend │ │ ├── BUILD │ │ ├── init.py │ │ └── main.py │ └── pyproject.toml ├── pants.toml ├── pyrightconfig.json ├── requirements.txt ├── mylockfile.json └── backend ├── BUILD ├── README.md ├── backend │ ├── BUILD │ ├── init.py │ └── main.py └── pyproject.toml
p
python_sources()
b
Thank you! That looks like it's working!
👍 1
Is there a good way to load environment variables from a single shared .env file in my subprojects?
🤷 1
h
So read .env from
repo root/projects/bar
when building that project even though the cwd is the repo root?
b
Yes. I ended up finding that I could just load the environment variables into the current environment manually (
set -a && source .env && set +a
), then run the program
h
Yeah, pretty much
Good solution