librariesio / bibliothecary

:notebook_with_decorative_cover: Libraries.io Package Manager Manifest Parsers
https://libraries.io/rubygems/bibliothecary
GNU Affero General Public License v3.0
89 stars 36 forks source link

Support setup.cfg for Python packages #459

Open brainwane opened 5 years ago

brainwane commented 5 years ago

On PyPI, packages sometimes include requirements in the install_requires section of the setup.cfg file. Examples (from @jaraco who is a Tidelift lifter):

It might be a good idea to fix this in one fell swoop along with #76.

brainwane commented 5 years ago

(In particular I noticed this because fogbugz-bis heavily depends on Beautiful Soup, which is also a Tidelift-supported project, yet https://libraries.io/pypi/fogbugz_bis does not reflect that dependency.)

jaraco commented 5 years ago

+1 to supporting more than just setup.py.

But I wonder if there's perhaps a better place to support this need. Both setup.py and setup.cfg (and other PEP 517 builders) will produce a package (wheel) with metadata. Perhaps the better model would be to extract the install requirements from the built-package's metadata. If you need it from source, you could use something like pep517#48... or if you could rely on published wheels, it should be sufficient to inspect them directly with importlib_metadata.

astrofrog commented 5 years ago

+1 on parsing setup.cfg, many projects are using this these days.

I'm not sure what your policy is on optional dependencies, but setup.cfg can also have sections to define extras_require, e.g https://github.com/astropy/astropy/blob/master/setup.cfg#L47 - it would be great to parse these too if possible.

brainwane commented 4 years ago

Another liftable package that uses setup.cfg: flake8. Seems to have zero dependencies on libraries.io.