When I try to run docker compose up
after setting up the environment I get the following error when it gets to building books
and reviews
images:
=> [federation-demo-reviews builder 5/6] COPY pyproject.toml pdm.lock /app/
=> ERROR [federation-demo-reviews builder 6/6] RUN pdm export -o requirements.txt
=> [federation-demo-books builder 5/6] COPY pyproject.toml pdm.lock /app/
=> ERROR [federation-demo-books builder 6/6] RUN pdm export -o requirements.txt
------
> [federation-demo-reviews builder 6/6] RUN pdm export -o requirements.txt:
#0 1.309 [PdmUsageError]: Can't export a lock file without environment markers, please re-generate the lock file with `inherit_metadata` strategy.
------
------
> [federation-demo-books builder 6/6] RUN pdm export -o requirements.txt:
#0 1.172 [PdmUsageError]: Can't export a lock file without environment markers, please re-generate the lock file with `inherit_metadata` strategy.
------
The same goes for trying to generate the requirements file outside of a container, in my system (demo uses python:3.10-slim, which is pretty close to my environment):
$> pdm --version
PDM, version 2.19.2
$> pdm export -o requirements.txt
[PdmUsageError]: Can't export a lock file without environment markers, please re-generate the lock file with `inherit_metadata` strategy.
For anyone having the same issue and in need of a quick workaround:
I was able to build the images by writing requirements files manually and just copying them into the images in the dockerfiles. For both GraphQL services they might look something like this:
strawberry-graphql==0.131.1
uvicorn==0.18.2
starlette==0.20.4
Obviously this is not an adequate solution, but works if you just need to quickly set up the demo.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too