Skip to content

Fix env var formatting in get_env_var() function - #2397

Open
valentinoli wants to merge 7 commits into
pypa:masterfrom
valentinoli:patch-5
Open

Fix env var formatting in get_env_var() function#2397
valentinoli wants to merge 7 commits into
pypa:masterfrom
valentinoli:patch-5

Conversation

@valentinoli

@valentinoli valentinoli commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

PLUGIN_NAME might contain dashes, for example pip-compile. This PR replaces dashes with underscores in the plugin name when formatting the environment variable for a Hatch environment option.

Closes #2402

@valentinoli

Copy link
Copy Markdown
Contributor Author

@cjames23 can you please review this bug fix?

@valentinoli

Copy link
Copy Markdown
Contributor Author

@cjames23 I would appreciate if this gets fixed soon as variables containing a dash are currently not made available in Hatch

For instance, the below variable is not exposed:

[tool.hatch.envs.default.env-vars]
"HATCH_ENV_TYPE_PIP-COMPILE_UV_PATH" = "{root:real}/scripts/uv"

@cjames23

Copy link
Copy Markdown
Member

@valentinoli I will look at this when I have some free time. Keep in mind that Ofek and I both do this outside of our regular jobs so we might not be looking every single day at PRs and issues created

@valentinoli

Copy link
Copy Markdown
Contributor Author

@valentinoli I will look at this when I have some free time. Keep in mind that Ofek and I both do this outside of our regular jobs so we might not be looking every single day at PRs and issues created

I completely understand, take your time as always and thank you for your dedication to this project. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in derivation of env var name

2 participants