Open fazpu opened 5 months ago
Inheritance is based on top-level keys (with the exception of scripts
which acts upon its named keys). Perhaps try extra-dependencies.
@ofek Thank you for the quick response!
Please, what do you mean by Inheritance is based on top-level keys
? What are the top-level keys
?
When you say to try the extra-dependencies - I find the documentation not understandable. It says:
If you define environments with dependencies that only slightly differ from their inherited environments, you can use the extra-dependencies option to avoid redeclaring the dependencies option
This is what I don't understand about the statement:
notebooks
), those dependencies are installed on top of the default env dependencies. -> I don't understand why the system would consider the dependencies
as redeclaring.extra-dependencies
existed in first place?I'm sure the functionality has a good purpose. However, the documentation does not give it justice.
I believe this issue could help improve the documentation. I'm happy to do a PR if I understand what is happening :)
Thank you for all the work!
Let's say you have an environment A that has configuration which is just a mapping of strings to other types. Now you have an environment B that inherits from A. Any key in configuration B will override keys that would be inherited from A. The exception to this is scripts
as there is special logic to inherit the keys in the actual value.
Does that make more sense? So extra-dependencies
exists for the case that you mention where you don't want to redeclare so much.
Based on the documentation in https://hatch.pypa.io/1.9/config/environment/overview/#inheritance, I would expect that the
test
environment would inherit fromnotebooks
environment (template = "notebooks"
).Either the documentation is misleading or the functionality does not work. The
test
environment does not install thenotebooks
dependencies.Hatch version tried: 1.7.0 and 1.9.3