Open flying-sheep opened 7 months ago
Thank you for expanding on how the resolution would work! I am open to this 🙂
Somewhat unrelated, but would this functionality be useful to you? https://github.com/pypa/hatch/discussions/1124#discussioncomment-7832642
Thank you for expanding on how the resolution would work! I am open to this 🙂
Let’s ask people if they want this. It was just an idea that I had to ease transition. I’m personally committed to Hatch lol
Somewhat unrelated, but would this functionality be useful to you? https://github.com/pypa/hatch/discussions/1124#discussioncomment-7832642
answered there
since the proposed feature adapts one of the many non-standard practices in the ecosystem, i propose to implement this in an Environment Collector plugin.
+1 My use case is that I have an application project which requires everyone on the team to be on the same Python version as the one deployed in production. However, my team has not adopted Hatch.
Having .python-version
along side hatch.toml
would let us enforce a Python version without enforcing Hatch.
project.requires_python
can be an alternative, but pyproject.toml
is not ideal for project-manager-agnostic application projects (yet).
pyenv and Rye both use a .python-version file to define what version they use.
Pros
Hatch could use it as a default for
hatch.envs.default.python
, and itCons
Impact
It would make the fallback chain for the Python version look something like the following
hatch.envs.<env>.overrides.<matching condition>.python
hatch.envs.<env>.python
hatch.envs.default.python
(assuminghatch.envs.<env>.template = 'default'
or unspecified)project.requires_python