Zenith: How to use private dependencies with the Python SDK #6318
-
I would like to utilize Dagger along with the Python SDK to configure my CI pipelines across multiple projects. In order to avoid unnecessary repetition, I intend to externalize certain functions into a shared Python library called [project]
name = "main"
version = "1.0.0"
description = ""
dependencies = [
"my-private-library",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/main.py"]
[tool.hatch.envs.default.env-vars]
PIP_INDEX_URL = "https://token:{env:GITLAB_API_TOKEN}@gitlab.com/api/v4/groups/<group1_path>/-/packages/pypi/simple/"
As it is not currently possible to pass environment variables from the caller's host (see #6112), what alternative solutions could be utilized for using private dependencies? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Answering my own question: It seems that the sdk defined in {
"name": "potato",
"sdk": "../sdk/python/my-custom-runtime",
"root": "../"
} This way I can use a pre-built image that has all batteries included. |
Beta Was this translation helpful? Give feedback.
Answering my own question: It seems that the sdk defined in
dagger.json
is also just a module (great design choice). Hence, it is possible to fully customize the runtime container, wheremy-private-library
is installed in, e.g.:This way I can use a pre-built image that has all batteries included.