-
-
Notifications
You must be signed in to change notification settings - Fork 355
Open
Description
I'm using hatch with a private PyPI-compatible repository, and I'm trying to avoid hardcoding the PIP_EXTRA_INDEX_URL or UV_EXTRA_INDEX_URL directly in pyproject.toml (since the repo can change per environment).
Here's my setup:
os: macOs [tried on ubuntu as well]
hatch version: 1.13.0
python version: 3.12.7
[tool.hatch.env]
requires = ["hatch-pip-compile"]
[tool.hatch.envs.default]
type = "pip-compile"
lock-filename = "requirements.lock.txt"
pip-compile-hashes = trueI’ve tried setting the repo URL using the hatch global config file (~/.config/hatch/config.toml or ~/.hatch/config.toml):
[envs.default.env-vars]
PIP_EXTRA_INDEX_URL = "http://192.168.50.189:32009/simple"
UV_EXTRA_INDEX_URL = "http://192.168.50.189:32009/simple"❌ Issues:
hatch shelldoes not expose these variables.hatch env createorhatch rundoes not seem to pass them to the environment.uvandpip-compilefail with "dependency not found" unless the repo is set inside[tool.hatch.envs.default.env-vars]inpyproject.toml.- Variables from the global
config.tomlare not respected during dependency resolution.
✅ What works:
- Hardcoding the repo in
pyproject.tomlunder[tool.hatch.envs.default.env-vars]works, but I want to avoid this since it's committed to version control. - Using a wrapper shell script with
exportworks outside Hatch, but breaks the portability of the Hatch config and goes against its philosophy.
🔍 My expectation:
That PIP_EXTRA_INDEX_URL and UV_EXTRA_INDEX_URL set in global config should be respected during:
hatch env createhatch run- any resolution using
uvorhatch-pip-compile
Please let me know if:
- I’m missing something in the configuration,
- or if this is a bug/missing feature.
n-toscano
Metadata
Metadata
Assignees
Labels
No labels