Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdm export error when building service images #15

Open
disco-king opened this issue Oct 25, 2024 · 2 comments
Open

pdm export error when building service images #15

disco-king opened this issue Oct 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@disco-king
Copy link

disco-king commented Oct 25, 2024

Describe the Bug

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.

System Information

  • Operating system: Linux debian 6.1.0-26-amd64

Additional Context

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.

@disco-king disco-king added the bug Something isn't working label Oct 25, 2024
@patrick91
Copy link
Member

@disco-king did you figure out a solution? otherwise I can try to find some time to update this repo 😊

@disco-king
Copy link
Author

@patrick91 no, I didn't try to, just went with the hack. It would be helpful if you updated the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants