From 92f10f2c340f3a009a64f054c58e1c85c9b6d819 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 22 Jun 2022 15:06:04 +0200 Subject: [PATCH] pyln: Fix relative path dependencies when publishing to PyPI So this was quite a journey: - We want relative depdendencies (using the `path` argument) whenever developing locally. Otherwise we would have to install each dependency every time we change a single character, which undoubtedly would cause us to waste time trying to debug an issue just because we forgot to install. - When publishing however we want to rely on the version number, since the repo context gets lost upon publishing, and path dependencies cause failures. The solution then it seems is to use `dev-dependencies` (not that surprising once you find it) with relative paths, so that `poetry install` uses these over the normal dependencies (no idea how they dedup them) and use `dependencies` when publishing. The paths are still in there when publishing, but `pip install` ignores them. I checked that `poetry install` from an unrelated project doesn't accidentally use the path dependencies, even when adding them as dev-dependencies. This should hopefully also allow installing them as a repo link, though I can't test that right now. --- contrib/pyln-client/pyproject.toml | 6 ++++-- contrib/pyln-proto/pyproject.toml | 2 +- contrib/pyln-testing/pyproject.toml | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/contrib/pyln-client/pyproject.toml b/contrib/pyln-client/pyproject.toml index c47607ad7..a3dfffe8a 100644 --- a/contrib/pyln-client/pyproject.toml +++ b/contrib/pyln-client/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyln-client" -version = "0.11.0" +version = "0.11.1" description = "Client library and plugin library for Core Lightning" authors = ["Christian Decker "] license = "BSD-MIT" @@ -13,10 +13,12 @@ packages = [ [tool.poetry.dependencies] python = "^3.7" pyln-bolt7 = "^1.0" -pyln-proto = "^0.10.2" +pyln-proto = "^0.11" [tool.poetry.dev-dependencies] pytest = "^7.0.1" +pyln-bolt7 = { path = "../pyln-spec/bolt7", develop = true } +pyln-proto = { path = "../pyln-proto", develop = true} [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/contrib/pyln-proto/pyproject.toml b/contrib/pyln-proto/pyproject.toml index 7ffa53476..8c7ed3411 100644 --- a/contrib/pyln-proto/pyproject.toml +++ b/contrib/pyln-proto/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyln-proto" -version = "0.11.0" +version = "0.11.1" description = "This package implements some of the Lightning Network protocol in pure python. It is intended for protocol testing and some minor tooling only. It is not deemed secure enough to handle any amount of real funds (you have been warned!)." authors = ["Christian Decker "] license = "BSD-MIT" diff --git a/contrib/pyln-testing/pyproject.toml b/contrib/pyln-testing/pyproject.toml index d21ea10c6..784bbe23c 100644 --- a/contrib/pyln-testing/pyproject.toml +++ b/contrib/pyln-testing/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyln-testing" -version = "0.11.0" +version = "0.11.1" description = "Test your Core Lightning integration, plugins or whatever you want" authors = ["Christian Decker "] license = "BSD-MIT" @@ -17,11 +17,13 @@ ephemeral-port-reserve = "^1.1.4" psycopg2-binary = "^2.9.3" python-bitcoinlib = "^0.11.0" jsonschema = "^4.4.0" -pyln-client = "^0.10.2" +pyln-client = "^0.11" Flask = "^2.0.3" cheroot = "^8.6.0" psutil = "^5.9.0" + [tool.poetry.dev-dependencies] +pyln-client = { path = "../pyln-client", develop = true} [build-system] requires = ["poetry-core>=1.0.0"]