Skip to content

Ability to reference variables across pyproject.toml #1418

Closed Answered by linjer
linjer asked this question in Q&A
Discussion options

You must be logged in to vote

I found a simple workaround for anyone who finds their way here. I defined a special environment called base where I put the python version to be shared.

[tool.hatch.envs.base]
template = "base"
python = "3.11"

[tool.hatch.envs.default]
template = "base"
# ...

[tool.hatch.envs.deploy]
template = "base"
# ...

[tool.hatch.envs.training]
template = "base"
# ...

This does not provide general variables for other uses, but this solved my original problem.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ofek
Comment options

ofek May 7, 2024
Maintainer Sponsor

Answer selected by ofek
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