[Distutils] Accessing tests_require and setup_requires from the setup.py
dholth at gmail.com
Fri Jun 3 09:58:10 EDT 2016
Here is how you can write setup_requires and test_requires to a file, by
adding a plugin to egg_info.writers in setuptools.
On Fri, Jun 3, 2016 at 9:29 AM Paul Moore <p.f.moore at gmail.com> wrote:
> On 3 June 2016 at 14:24, Christopher Baines <mail at cbaines.net> wrote:
> > On 03/06/16 14:19, Paul Moore wrote:
> >> On 3 June 2016 at 13:20, Christopher Baines <mail at cbaines.net> wrote:
> >>> I'm trying to write a script to get information about a source
> >>> distributions requirements (from the source distribution), but I'm not
> >>> sure how to access the tests_require and setup_requires that can
> >>> sometimes be found in the setup.py?
> >>> Apologies if this is really simple, and I've just missed the answer,
> >>> I've searched for it a few times now, and not come up with anything.
> >> If I understand what you're trying to achieve, the only way of getting
> >> the "final" information (i.e, what will actually get used to install)
> >> is by running the setup.py script. That's basically the key issue with
> >> the executable setup.py format - there's no way to know the
> >> information without running the script.
> >> You may be able to get the information without doing a full install by
> >> using the "setup.py egg_info" subcommand provided by setuptools.
> >> That's what pip uses, for example (but pip doesn't look at
> >> tests_require or setup_requires, so you'd have to check if that
> >> information was available by that route).
> > As far as I can see (I checked setuptools and flake8), neither
> > tests_require or setup_requires are present in the egg_info metadata
> > directory.
> > Is there no way of getting setuptools to write the data out to a file?
> Maybe you could write your own command class? Or monkeypatch
> setuptools.setup() to write its arguments to a file?
> I don't know of any non-ugly way, though, sorry...
> Distutils-SIG maillist - Distutils-SIG at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Distutils-SIG