Skip to content
Discussion options

You must be logged in to vote

env-vars overrides take KEY=VALUE strings (or an array of those), not a TOML table. That is why the map form raised must be a string or an array.

[tool.hatch.envs.default.overrides]
platform.linux.env-vars = "LD_LIBRARY_PATH={root}/src/pact_ffi{;}{env:LD_LIBRARY_PATH:}"
platform.macos.env-vars = "DYLD_LIBRARY_PATH={root}/src/pact_ffi{;}{env:DYLD_LIBRARY_PATH:}"
platform.windows.env-vars = "PATH={root}/src/pact_ffi{;}{env:PATH:}"

Array form if you want:

platform.linux.env-vars = [
  { key = "LD_LIBRARY_PATH", value = "{root}/src/pact_ffi{;}{env:LD_LIBRARY_PATH:}" },
]

Docs: https://hatch.pypa.io/latest/config/environment/advanced/#types

Pitfall: bare {env:LD_LIBRARY_PATH} errors if unset. …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JP-Ellis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants