[Distutils] setup_requires for dev environments

Daniel Holth dholth at gmail.com
Thu Mar 19 19:40:20 CET 2015


The reason you should not have to run setup.py to dump out the
setup-requires is that, in the what-people-tend-to-expect definition,
setup.py cannot run without those requirements being installed first.

There is a similar problem with putting setup-requires in the PEP 426
Metadata. As long as we have setup.py we are going to have to generate
the PEP 426 metadata from setup.py itself for any legacy package or
any package where setup.py cannot be overhauled. One option would be
to have a partial PEP 426 metadata for just the setup-requires which
would be overwritten into a .dist-info directory by the data from
setup.py itself when that runs.

On Thu, Mar 19, 2015 at 12:56 PM, Chris Barker <chris.barker at noaa.gov> wrote:
> On Thu, Mar 19, 2015 at 9:26 AM, Ionel Cristian Mărieș <contact at ionelmc.ro>
> wrote:
>>
>> The --record is for making a list of installed files. You don't need it if
>> you don't use record.txt anywhere.
>
>
> thanks -- I"ll take that out... This was a cut and paste form teh net after
> much frustration -- once I got somethign that worked, I decided I was done
> -- I had no energy for figuring out why it worked...
>
>>
>> As for --single-version-externally-managed, that's unrelated to your
>> setup_requires pain - you probably already have the eggs around, so they
>> aren't redownloaded.
>
>
> well, what conda does to build a package is create a whole new empty
> environment, then install the dependencies (itself, without pip or
> easy_install, or...), then runs setup.py install (for python packages
> anyway). In this case, that step failed, or got ugly, anyway, as setuptools
> didn't think the dependent packages were installed, so tried to install them
> itself -- maybe that's because the dependency wasn't installed as an egg?
>
> I can't recall at the moment whether that failed (I think so, but not sure
> why), but I certainly didn't want all those eggs re-installed.
>
>>
>> What --single-version-externally-managed does is force the package to
>> install in non-egg form (as distutils would).
>
>
> hmm -- interesting -- this really was a dependency issue -- so it must
> change _something_ about how it looks for dependencies...
>
>>
>> That also means only setup.py that uses setuptools will have the
>> --single-version-externally-managed option available.
>
>
> yup -- so I need to tack that on when needed, and can't just do it for all
> python packages...
>
> Thanks -- that does make things a bit more clear!
>
> -CHB
>
>
>
>>
>>
>> Thanks,
>> -- Ionel Cristian Mărieș, http://blog.ionelmc.ro
>>
>> On Thu, Mar 19, 2015 at 6:17 PM, Chris Barker <chris.barker at noaa.gov>
>> wrote:
>>>
>>> On Thu, Mar 19, 2015 at 9:12 AM, Ionel Cristian Mărieș
>>> <contact at ionelmc.ro> wrote:
>>>>
>>>> Worth considering, if you can afford it, to have a local patch that you
>>>> apply before building. Then you have all the necessary fixes (like remove
>>>> the setup_requires) in that patch file.
>>>
>>>
>>> yup -- that's a option -- but a really painful one!
>>>
>>> I did, in fact, find an incantation that works:
>>>
>>> $PYTHON setup.py install --single-version-externally-managed
>>> --record=/tmp/record.txt
>>>
>>> but boy, is that ugly, and hard to remember  why not a --no-deps flag?
>>>
>>> (and I have no idea what the --record thing is, or if it's even
>>> neccessary...
>>>
>>> -Chris
>>>
>>>
>>>> This is a popular approach in Debian packages - they can have all kinds
>>>> of fixes for the upstream code.
>>>>
>>>>
>>>>
>>>> Thanks,
>>>> -- Ionel Cristian Mărieș, http://blog.ionelmc.ro
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Christopher Barker, Ph.D.
>>> Oceanographer
>>>
>>> Emergency Response Division
>>> NOAA/NOS/OR&R            (206) 526-6959   voice
>>> 7600 Sand Point Way NE   (206) 526-6329   fax
>>> Seattle, WA  98115       (206) 526-6317   main reception
>>>
>>> Chris.Barker at noaa.gov
>>
>>
>
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker at noaa.gov
>
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>


More information about the Distutils-SIG mailing list