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

Only install dependencies #444

Closed
alex007sirois opened this issue May 6, 2021 · 1 comment · Fixed by #469
Closed

Only install dependencies #444

alex007sirois opened this issue May 6, 2021 · 1 comment · Fixed by #469
Labels
⭐ enhancement Improvements for existing features

Comments

@alex007sirois
Copy link

I recently changed my Dockerfile to use multi-stage builds.
I thought PDM would be perfect because of it's use of a __pypackage__ directory.
When building a docker image, you want the layers in order from least to most susceptible to change.
In that way, we want to install dependencies before the code as to not reinstall them every time the code change.
However, it is not possible right now with PDM.

Example:

FROM python AS builder

WORKDIR /

RUN pip install pdm
COPY pdm.lock
pdm install --only-dependencies  # <-- this flag does not exist in PDM 1.5.2

FROM python

ENV PYTHONPATH=src:packages
COPY --from=builder /__pypackage__/3.9/lib packages
COPY src src

ENTRYPOINT ["python", "src/main.py"]

Describe the solution you'd like

Poetry has a --no-root option when installing that has this behavior.

By default, the above command will also install the current project. To install only the
  dependencies and not including the current project, run the command with the
  --no-root option like below:

   poetry install --no-root

I think adding a similar flag to pdm install would be best.
Although, I find that name confusing and would prefer something like --only-dependencies, but I don't really mind, as long as such an option exists.

@alex007sirois alex007sirois added the ⭐ enhancement Improvements for existing features label May 6, 2021
@pawamoy
Copy link
Contributor

pawamoy commented May 18, 2021

I see @frostming is working on this issue as well as #443 in #456 ❤️

@frostming frostming mentioned this issue May 20, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants