Hi Guix! Reza Housseini <[email protected]> writes: > [...] > The general idea to make propagated inputs, normal inputs is the > following: Every Python package hard codes it's inputs dependency paths > in a file in the site-packages directory (could also be in METADATA or > any other similar file). We add an additional finder to the import > machinery, either to sys.meta_path or sys.path_hooks or we modify the > existing PathFinder. The new or modified finder has one addition: if an > import happens from a package residing inside the guix store, it first > checks if the file or location of the hard coded dependecies are present > and loads the module from there before processing with the standard > import process. > [...]
> In general this boils down to define dependencies globally > (propagated-inputs) or per package (inputs). I argue doing things per > package reduces complexity. > It may be true that most Python packages should use the same lower > dependency versions in a profile, but I think first that this it is > not the role of propagated-inputs to enforce this behavior. Second, > that Python packages are normally tested against a specific dependency > version and should strive to use this version and this may easily > conflict with other packages and third that there are valid reasons to > mix package versions in the same profile, e.g. for testing reasons. So > in short, this gives us flexibility to use different package versions > if we need to, but still allows us to enforce a "global" dependency > version if we want to. If I understand you correctly, if python-hjkl depends on python-asdf and python-qwer which both depend on python-zxcv, the idea is to somehow check (through pinning, transitive dependency checking, or something else) that asdf and qwer don't depend on different versions of zxcv, is that correct? I think that doing this on a per-package level would turn python-development in guix into a minefield: if this were to be adopted and I then run `guix shell python python-asdf python-qwer -- python3` where asdf and qwer both depend on different versions of python-zxcv, I *want* an error to occur - otherwise, if I import both asdf and qwer in my python shell, a myriad of cryptic incompatibilities may occur, which seem like they will be rather difficult to debug. Therefore, it is in my opinion not sufficient to solve this on a per-package basis: the fundamental idea of allowing several versions of a python dependency in a single profile is a massive footgun, as other packages aren't the only "consumers" of python APIs. I strongly appreciate attempts to lessen the number of propagated inputs, but this seems counterproductive to me, I think there is more to be gained in adding wrapper scripts to python-based utilities/executables. Kind regards, pinoaffe
