🐛 Implement get_env_var_option() method - #109
Conversation
Add get_env_var_option method to retrieve environment variable values.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #109 +/- ##
==========================================
+ Coverage 92.16% 92.23% +0.07%
==========================================
Files 14 14
Lines 893 902 +9
Branches 76 76
==========================================
+ Hits 823 832 +9
Misses 40 40
Partials 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Refactor environment variable retrieval to handle different Hatch versions.
Added a test for the `get_env_var_option` method to verify environment variable handling.
Add type ignore comments for PLUGIN_NAME assignments.
Add a comment explaining the workaround for PLUGIN_NAME.
|
@juftin hey 👋🏽 this PR us ready for review |
|
@juftin 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"And I need to use an environment variable here as the |
|
Merged. Thanks for the patience, I got delayed on vacation in Hawaii due to a hurricane and just got home. |
# [v1.11.8](v1.11.7...v1.11.8) (2026-08-20) ## 🐛 Bug Fixes - [`5053a34`](5053a34) Implement `get_env_var_option()` method (#109) (Issues: [`#109`](#109)) [skip ci]
|
🎉 This PR is included in version 1.11.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
That was quick! Thank you for the release 😍 |
Add get_env_var_option method to retrieve environment variable values.
The
get_env_var_option()method in Hatch'sEnvironmentInterfacedoes not replace dash with underscore in thePLUGIN_NAME. This is problematic as providing options via environment variable for "pip-compile" environments (type: "pip-compile") must be done viaHATCH_ENV_TYPE_PIP-COMPILE_<option>(notice the dash).See pypa/hatch#2397