hmm – I wonder if it even needs to be that complicated – the hardest part (I think) is mapping of names (and versions) between different package providers.
And at least with the Python stuff, PyPi is the only namespace that matters, and more and more, conda-forge is the primary namespace for conda packages.
So that takes care of:
-
the default index URL to use
-
any supplementary index URLs to use
(not that there’s any harm in specifying the url)
-
a list of packages that must be installed via the platform rather than via Python-specific tools
That’s tricky – I suppose there are some, but at least in the pip - conda world, it’s a question of: “use the conda package if there is one” – not that anything in particular needs to be the conda one.
- the version constraints for those platform provided packages
This ties in with the naming – you need names and versions.
- installation of a platform-provided version of a package
Hmm --so, e.g. pip would install a conda package if there is one? I suppose that could be done, but maybe it would be better if conda (or whatever environment manager) simply did it all. e.g. conda could provide a wrapper around pip that would use pip to figure out the dependencies of a package, look for conda packages to resolve them, and then install anything that couldn’t be found in conda.
However: maybe we could just focus on making it easier, and maybe even automatic in the easy cases, to make conda packages. If we had the name mapping, it wouldn’t be too hard for any pure python (or any self contained package).
Thinking out loud here:
It should be doable to build a service where there is an API to request a conda package for a given PyPi package. With greyskull that can “jsut work” for the simple cases.
(in fact, such a service already exists (almost): Marcelo Duarte Trevisani)
I’m not sure if it comes with grayskull, but you can right now combine grayskull and conda-build and get a package ready to go. So what to do with that package?
So why not build that service into conda-forge? One reason is that conda-forge is curated, at least to a point – there are many ways that auto-generating a conda package can lead to problems – it’s good to put some eyes on it first.
But: a “built_from_pypi” channel could be created, and the system could auto-generate a package from pypi, and put it on the built_from_pypi channel. Then any user could add the built_from_pypi channel on their channel list, at a lower priority than conda-forge, and they would be able to get access to all those packages.
And it could be used as a test bed for packages to be added to conda-forge later on.
Would this work for all the packages on PyPi? no, not at all, but it could work for a lot, and I think it would be about as reliable as pip installing within conda.
The primary missing piece is the name mapping – many PyPi names match conda-forge names, but not all, and there are some fatal clashes.
Maybe a first draft namespace mapping could be done by scanning all of conda-forge’s feedstocks, looking in the recipe, and determining what it is built from – if it’s a PyPI source download – we know the PyPI name.
Anyway, I know ideas like this have been bouncing around the conda world for a while – so I’m sure there are reasons it wouldn’t work – or just no one has stepped up to do it.