python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.05k stars 2.25k forks source link

Consumable Public 'Debug Resolve' API #194

Closed cooperlees closed 5 years ago

cooperlees commented 6 years ago

Thanks for making this project, it's a shame it needs to exist, but Python really needs a nice solid resolver. I, along with a coworker tried to get JSON output added to pip download, but that was not received well (https://github.com/pypa/pip/pull/5400).

How do you feel about making the debug:resolve friendlier for other packages to import and use? I have a system where I wrap pip and build wheels for my build build system to consume (the are then also built with my version of gcc, openssl etc.). Today I use pip without the --no-deps option, but this means every time someone asks for a new module we build every single dep again, wasting time and resources (as I just skip uploading them to my internal PEP381 mirror if they already exist). Combining this system with poetry I could add the --no-deps to pip and pre calculate what I need to build.

For example, we request x:

I hacked up an example file that poetry.console.commands.debug.resolve could then use: https://pastebin.com/AfHz4a2m (Naturally without the Py3 only stuff)

If this is to invasive, would you accept a PR that makes --format=json work or some parsable friendly output be generated from:

With debug:resolve I seem to get:

[NoSuchOption]
The "--format" option does not exist.

Thanks, Cooper

ambv commented 6 years ago

@sdispater, if you'd be fine with making --format=json wok with debug:resolve, we're happy to make that PR for you.

sdispater commented 6 years ago

I think adding a --format option can be a good feature for the debug:resolve command if it can help get a dependency set consumable by other tools.

PR welcome :-)

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.