dephell / dephell

:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.
https://dephell.org/
MIT License
1.77k stars 119 forks source link

Tell your use case #208

Open orsinium opened 5 years ago

orsinium commented 5 years ago

Maybe, you have some interesting use case for DepHell that we can't even imagine. You know, with some tricky commands and configuration. Add it into recipes section.

schuderer commented 4 years ago

I wonder whether DepHell could help one in bundling dependencies for deploying projects to a different architecture (in my case a Linux server) which cannot access any repository due to network restrictions. I currently (on a Windows machine) run pip download --no-deps --platform manylinux2010... on a frozen requirements.txt to download wheels for packaging with the project. Unfortunately, this only tries exactly the specified platform before falling back to sources instead of wheels, whereas pip's own algorithm tries several platforms (and versions, abis, etc.) in a specific order, e.g. first manylinux2010, then manylinux1, then linux... (cf. python -c "from pip import _internal; print(_internal.pep425tags.get_supported())") The fact that it falls back to downloading source tar.gz files for C-backed packages in combination with --no-deps leads to it trying and failing to compile them on the Linux machine.

Looking at DepHell's documentation yesterday, I found a lot of information of resolving versions, but not much on specific platform tags like manylinux... (whose handling/matching can also be thought of a kind of dependency resolution I guess). Right now I am thinking of having the packaging do a pip-ish thing by trying manylinux2010, manylinux1 etc. in order to get a wheel if one exists, but wonder wether there is a smarter way, and particularly whether/how DepHell could help in resolving these dependencies from the Windows machine.

I am aware that the setup sounds like I deliberately chose to make life hard for myself (dev on Windows, deploy on Linux without internet connection or private package repository, no Docker, ...), but this is the reality I sort of have to work with right now. 😬 That said, I am open to suggestions like "just do X", as I am of course quite motivated to change the situation (I'm doing this in a corporate environment, but that doesn't mean you can't improve things :) ).

orsinium commented 4 years ago

DepHell resolves releases and then delegates the installation of particular releases to pip. Then pip choice dists to use for every given release. So, choosing the best platform is still on pip.