crate-archive / crate-site

OBSOLETE, SEE crate.io, crate.web, and crate.pypi
https://crate.io/
BSD 2-Clause "Simplified" License
87 stars 13 forks source link

[Feature Request] API for obtaining requirements of a package #55

Open kracekumar opened 12 years ago

kracekumar commented 12 years ago

From crate.io website, crate.io is planning to provide api to access information about packages, it would be great if the api can provide dependencies. For certain packages requirements.txt is needed(web)and others mention in setup.py, if crate.io can provide both as json list, it would be great.

dstufft commented 12 years ago

This is something I want to provide, however there is a fairly large issue.

The issue is that it's nearly impossible to accurately get the requirements from setuptools. This is because setup.py is programmed.

Example:

if sys.platform == "win32": install_requires += ["pywin32"]

or

if sys.version_info[1] < 6: install_requires += ["simplejson"]

It is however something i've thinking of very hard on how to reliably do it for setuptools.

The good news is for distutils2/packaging this information is very easy to get.

kracekumar commented 12 years ago

Correct me if I am wrong, disutils2 is for python 3.3+ right?

dstufft commented 12 years ago

In 3.3+ it's called packaging. distutils2 is a backport of packaging. I don't think it's exactly ready for prime time but the future is brighter.

That being said I do plan on implementing this for setuptools, the gotcha will just be that it isn't guaranteed to be accurate (but I will attempt to cover the common use cases).

kracekumar commented 12 years ago

I got packing is only for py 3.3+

kracekumar commented 12 years ago

Good stuff, since I am also in the same state, if this dependency graph is solved, I would go ahead and release my parallelpip version .