toabctl / metaextract

get metadata for python modules
Apache License 2.0
7 stars 4 forks source link

Recover from error in setup.py #8

Closed jayvdb closed 4 years ago

toabctl commented 5 years ago

Can you describe in the commit msg why this is useful? Also a testcase would be good. But in general I'm not convicened that this is a good idea.

jayvdb commented 5 years ago

Typical problem is a setup.py which includes another package which isnt installed on my system.

I've encountered it a few times, with and without setup_requires=.

Currently the result is an ImportError, which the caller is not expecting from this function. (and it might also cause OSError, if setuptools is trying to install the deps when it was not run with sufficient privs)

My use case is py2pack which uses metaextract, and it recovers nicely when metaextract returns nothing, as it uses the metadata from PyPI by default.

If you would prefer, I can document that this function can raise ImportError (and then handle it in py2pack), or I could enhance the setuptools extractmeta command so that emits something more useful into the json.

toabctl commented 5 years ago

I would prefer to handle this in py2pack

jayvdb commented 4 years ago

Closing per above.