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

Poetry doesn't appear to allow for efficient docker caching when using /src #2549

Closed
2 tasks done
curtiscook opened this issue Jun 12, 2020 · 5 comments
Closed
2 tasks done
Labels
status/duplicate Duplicate issues

Comments

@curtiscook
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

From: https://python-poetry.org/docs/pyproject/#packages%C2%A0

If your package is included in a subdirectory (i.e. /src), you need to include the path as follows:

[tool.poetry]
# ...
packages = [
    { include = "my_package", from = "src" },
]

The problem is that if you have an actively developed package it's generally more efficient to cache requirements in the base image. This is normally easily accomplished by running poetry install --no-dev --no-interaction

Unfortunately, if you have a /src directory and implement the package syntax, poetry will fail if the package is not there with the following error

/src/my_package does not contain any element

Suggestion/feature request: a flag to skip the packages block when installing the base image

@curtiscook curtiscook added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jun 12, 2020
@finswimmer
Copy link
Member

Hello @curtiscook,

I don't really understand your use-case. But is the --no-root parameter for poetry install what you are looking for?

fin swimmer

@curtiscook
Copy link
Author

it's not clear that --no-root supports skipping packages?

If it does, it could possibly work?

As for my use case --

I want to install the base image with deps into an intermediate container & then install my package into a new container. This increases docker's ability to cache the repo. Currently, it wants to just fail the build. Maybe this should throw a warning w/ a suggestion with --no-root?

I was able to work around it, but everything feels very abusive/hacky so I think that there should be more direct support (or documentation) for docker builds

@finswimmer
Copy link
Member

I want to install the base image with deps into an intermediate container & then install my package into a new container.

I'm not familiar with the docker stuff. But that sounds exactly like what --no-root is doing. It installs all you dependencies, but will not install the project's package itself.

@abn abn added area/error-handling Bad error messages/insufficient error handling kind/enhancement Not a bug or feature, but improves usability or performance and removed kind/feature Feature requests/implementations status/triage This issue needs to be triaged kind/enhancement Not a bug or feature, but improves usability or performance labels Jun 19, 2020
@neersighted
Copy link
Member

Duplicate #1132.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
@neersighted neersighted added status/duplicate Duplicate issues and removed area/error-handling Bad error messages/insufficient error handling labels Oct 4, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

4 participants