Replies: 2 comments 5 replies
-
Issue 7When using |
Beta Was this translation helpful? Give feedback.
4 replies
-
Why do you convert this into a discussion? It's clearly an issue since there's no way to do monorepos right now with both dev+prod builds without hacking around poetry. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is not a discussion, but a collection of bug reports.
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: macos 12.3.1
Poetry version: 1.1.12
Background
Related to but not same as #1168 (comment)
I build whl files of my project as well as its libs that are in sibling folders in the source tree, outside of the Dockerfile, because it makes it faster to install, not to have to go through dependency resolution. The whl files, both of libs and the service itself, are copied into the dockerfile.
Issue 1
When you use Path dependencies like
libpg = {path = "../../libs/libpg"}
, the resulting PKG-INFO file haslibpg @ ../../libs/libpg
.Expectation:
poetry build
, when building dependencies that are path-linked, would output not justservice-X.Y.Z-...whl
but also every dependency it was responsible for building as part of thebuild
operation, and it would use version constraints inPKG-INFO
, not path dependencies.Issue 2
When you use dependencies like
libpg = {path = "./dist/deps/libpg-0.4.0-py3-none-any.whl"}
, again, the service-...whl file is built to depend ondist/deps/...
instead of the versions.Expectation: again, if I reference packages, it should
build
packages that depend on packages with versions and leave the indexing and source resolution up to the runtime (e.g. when I do pip install)Issue 3
When you use dependencies like
libpg = {path = "../../libs/libpg", develop = true}
, see issue #1168Expectation: #1168 and in particular allowing development dependencies to override this, and to have this override checked in (because: monorepo!) always.
Issue 4
If you use dependencies like
libpg = "^0.4.0"
in[tool.poetry.dependencies]
butlibpg = {path = "../../libs/libpg", develop = true}
under[tool.poetry.dev-dependencies]
, poetry complains and won't install.Expectation: since you can run
poetry install --no-dev
I would have expected dev-dependencies to be overriding non-dev dependencies, andbuild
to ignore dev dependencies. Similar to how env files work in NextJS https://nextjs.org/docs/basic-features/environment-variables#default-environment-variablesIssue 5
When you create a new venv for developing, and you manually replace
libpg = "^0.4.0"
withlibpg = {path = "../../libs/libpg", develop = true}
, you have to runpoetry update libpg
. If this library now depend on sayopentelemetry.exporters.jaeger.thrift
which requires setuptools, the initialisation of your development environment fails, becausepoetry update
crashes with an error that "setuptools is not available in your environment so I can't install the thrift package". You now have to use bothpip
andpoetry
.Expectation: pip, setuptools and poetry are all locked when using poetry
Issue 6
A bit counter-intuitively when thinking of issue 4 above, if I:
I have to:
libpg = "^0.4.0"
as a dependencyThis means that if I don't first install libpg with pip (not with poetry because of issue 2), poetry will query pypi for this library, leaving me open to supply-chain attacks if someon guess this library name. Because the aim of poetry.lock is to avoid precisely this, and
libpg
is private, if issues 1..5 are unresolved (and even so), I should want to lock down the source — in this case "never install from any source if it's not already installed manually". If the above issues are fixed, I should want it to lock down that it's installed from a filesystem path and not from an index. Otherwise, I'm indeed open to supply-chain attacks if I forget tomake packages
beforemake image
(as the packages are built from the outside of the Dockerfile).In general, poetry should focus on maintaining, installing and building packages coherently. Not on trying to create a runtime for them. Only once package management is solved should the tool set up environments for packages to run in (source deps, linking to relative paths, shell).
Beta Was this translation helpful? Give feedback.
All reactions