-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow to create empty python package #6247
Comments
I'm also trying to install a project with Curiously, the Still, I would like to be allowed to have an explicitly empty packages list even when installing with |
But what is pip installing in that case? just the dependencies? This smells a lot like an a-b problem, what is your end goal, what you are reaching to happen in the end? |
Yes
In my case I'm trying to setup a mono-repo with multiple subprojects and to create a "meta-project" which just includes them all as dependencies together with some useful dev-dependencies. I'm not sure it is the best possible approach, but in general I think there can be other use cases (like the one described by the OP) where declaring a "dependencies-only" package could be useful. |
I guess a namespace package is suitable for this use case? According to python's official documentation:
|
+1, having this exact same issue currently.
The end goal here is: it should be possible to create a virtualenv (i.e. successfully run In a Dockerfile, it is considered best practice to install virtualenv/dependencies in a separate image layer than installing the application itself. This is to take best advantage of Docker's layer caching, as it avoids invalidating the dependency layer cache when the dependency itself doesn't actually change, as recreating virtualenv+installing dependencies is very expensive and dependencies usually change at a much slower pace than the application. In poetry, this is something that should have been doable by copying just |
I think this is the same issue as #5052. |
Currently, my work around for this is to create another docker layer where I have full poetry just so I can do |
Mostly a specialized duplicate of #1132 with regard to the immediate ask of not requiring a valid package to use Poetry. The Docker-specific stuff is better tracked elsewhere as a combination of best-practices patterns and possible features driven by the process of developing those best practices. |
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. |
There is no way to create empty packages with poetry. If we set
tool.poetry.packages
to an empty array[]
, pip install raises the following error:I understand this is a valid validation error, but there are cases where we need to install the package and dependencies separately, Dockerfiles. To leverage docker layer cache we generally install dependencies first and then install the project code in another command so that changes in project code does not require installing dependencies again.
Right now a simple workaround is to create a dummy python module (
my_project.py
iftool.poetry.name = my-project
) to install dependencies.If we could create empty packages like setuptools, then we could just set
tool.poetry.packages = []
instead of tricking poetry-core with a dummy python module.The text was updated successfully, but these errors were encountered: