[PATCH] setup.py: attempt to use setuptools

Adrian Buehlmann adrian at cadifra.com
Fri Jan 16 13:26:45 CST 2015



On 2015-01-16 19:03, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1421431223 28800
> #      Fri Jan 16 10:00:23 2015 -0800
> # Node ID 711fa69653f69a7059966fff1dae1a352244b781
> # Parent  049a9e3a078d7c988cb12ed456aad6ec2779ea69
> setup.py: attempt to use setuptools
> 
> The Python Packaging User Guide recommends setuptools over distutils
> (https://packaging.python.org/en/latest/distributing.html).
> 
> setuptools.setup should be a drop-in replacement for
> distutils.core.setup and this patch should "just work." That being said,
> setuptools does differ from distutils. I wouldn't be surprised if this
> change broke Mercurial packaging somewhere. If it does, it should be
> easy enough to revert.
> 
> With this patch applied, I did notice a new warning when running
> setup.py:
> 
>   UserWarning: The version specified requires normalization, consider
> using '3.2.4+668.41fac217e2e4' instead of '3.2.4+668-41fac217e2e4'.
> 
> Furter research indicates that setuptools may break our current
> dev versioning format in the future.
> 
> The impetus for this patch is to work around
> https://bugs.python.org/issue23246, which was preventing me from easily
> building Mercurial on Windows using the Visual C++ for Python
> distribution.
> 
> In the future, this patch may open the door to other distribution
> potentials for Mercurial, including wheels, which the Python world is
> slowly moving to. On my machine, |python setup.py bdist_wheel| does
> produce a wheel. But I haven't tested whether the wheel is sane.

I'm pretty much out of this business, but in the past, I spent quite
some time documenting what was needed to install a Windows computer that
was able to build TortoiseHg MSI installers for Windows (32 and 64 bit).
Building Mercurial for Windows using the Visual C++ compiler was part of it.

Perhaps you may find the Readme.txt at

  https://bitbucket.org/tortoisehg/thg-winbuild/src

useful in some way. It contains some hints about vcvars and the like,
which may or may not apply to your issue.

Perhaps Steve Borho can provide specific feedback for your patch. I
guess he's the one who would notice first if this patch here breaks
anything that is done when building for Windows.


More information about the Mercurial-devel mailing list