[PATCH] setup: use setuptools on Windows (issue5400)

Matt Harbison mharbison72 at gmail.com
Sun Apr 9 16:40:06 EDT 2017


On Sun, 09 Apr 2017 09:28:04 -0400, Yuya Nishihara <yuya at tcha.org> wrote:

> On Sat, 08 Apr 2017 20:30:53 -0400, Matt Harbison wrote:
>> On Thu, 09 Mar 2017 23:06:34 -0500, Gregory Szorc
>> <gregory.szorc at gmail.com> wrote:
>>
>> > # HG changeset patch
>> > # User Gregory Szorc <gregory.szorc at gmail.com>
>> > # Date 1489118392 28800
>> > #      Thu Mar 09 19:59:52 2017 -0800
>> > # Node ID b51f9adb41e68d9f3d88582f044d2742ae29ce09
>> > # Parent  cd29673cebdbe2d998009322e4c3657389d6aed0
>> > setup: use setuptools on Windows (issue5400)
>> >
>> > We've had a long, complicated history with setuptools. We want to
>> > make it the universal default. But when we do, it breaks things.
>> >
>> > `python setup.py build` is broken on Windows today. Forcing
>> > the use of setuptools via FORCE_SETUPTOOLS=1 unbreaks things.
>> >
>> > Since the previous bustage with making setuptools the default
>> > was on !Windows, it seems safe to move ahead with the setuptools
>> > transition on Windows. So this patch does that.
>>
>> I'm not sure why, or what we should do about it, but test-hghave.t fails
>> with this on Windows.  I can get a similar failure on Linux with
>> FORCE_SETUPTOOLS=1.  Is this an expected diff with setuptools (and
>> deserving a '(glob) (?)'?
>>
>> --- c:/Users/Matt/Projects/hg/tests/test-hghave.t
>> +++ c:/Users/Matt/Projects/hg/tests/test-hghave.t.err
>> @@ -19,7 +19,11 @@
>>     >   foo
>>     > EOF
>>     $ run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
>> +  warning: Testing with unexpected mercurial lib:
>> C:\Users\Matt\AppData\Local\Temp\hgtests.ie8k3minstall\lib\python\mercurial-4.1.1-py2.7-win-amd64.egg\mercurial
>> +           (expected
>> C:\Users\Matt\AppData\Local\Temp\hgtests.ie8k3m\install\lib\python\mercurial)
>
> Perhaps this assumption isn't true for setuptools.
>
> https://www.mercurial-scm.org/repo/hg/file/4.1.2/tests/run-tests.py#l2469
>
> I have no idea if setuptools can be configured to use simple installation
> layout.

That's a good tip, thanks.  The output above is from the original patch,  
but it is simpler for @ committed:

+  warning: Testing with unexpected mercurial lib:  
c:\Users\Matt\Projects\hg\mercurial
+           (expected  
C:\Users\Matt\AppData\Local\Temp\hgtests.q1ldmg\install\lib\python\mercurial)

Without setuptools:

expecthg:  
C:\Users\Matt\AppData\Local\Temp\hgtests.kshzjl\install\lib\python\mercurial
actualhg:  
C:\Users\Matt\AppData\Local\Temp\hgtests.kshzjl\install\lib\python\mercurial
bindir:   C:\Users\Matt\AppData\Local\Temp\hgtests.kshzjl\install\bin
pydir:     
C:\Users\Matt\AppData\Local\Temp\hgtests.kshzjl\install\lib\python
tmpdir:   C:\Users\Matt\AppData\Local\Temp\hgtests.kshzjl\install\bin

With setuptools:

expecthg:  
C:\Users\Matt\AppData\Local\Temp\hgtests.q1ldmg\install\lib\python\mercurial
actualhg: c:\Users\Matt\Projects\hg\mercurial
bindir:   C:\Users\Matt\AppData\Local\Temp\hgtests.q1ldmg\install\bin
pydir:     
C:\Users\Matt\AppData\Local\Temp\hgtests.q1ldmg\install\lib\python
tmpdir:   C:\Users\Matt\AppData\Local\Temp\hgtests.q1ldmg\install\bin

So it seems like the test is importing the 'hg' module that the main test  
runner is using?  It looks like test-run-tests.t papers over this by  
invoking run-tests.py with '--with-hg=`which hg`', which also works here.   
But someone who understands the underlying issue should take a look before  
doing that.  The function you referenced bails in this case, so it feels  
like subverting a valid check.


More information about the Mercurial-devel mailing list