[PATCH 0 of 9] Pure modules, setup.py --pure integration

Martin Geisler mg at daimi.au.dk
Sat Jan 24 01:06:48 UTC 2009


Hi,

Here are pure Python versions of the C extensions. The modules are put
in mercurial/pure/ and are not used by default.

To use them one runs setup.py as

  setup.py --pure cmd

where cmd is a command like build or install which will trigger the
build_py command. It is important that build_py is called *before*
build_ext since build_py clears the ext_modules list when the --pure
flag is set. The normal build sequence does this.

It is also important that there is a mercurial.pure module for each
extension -- the osutil module is moved to mercurial.pure for this
reason.

The final patch modifies the Makefile so that it injects a variable
PURE in the spot where "--pure" is in the command line above. So

  make local PURE=--pure

will do a local build without building the extensions. I think this
looks quite ugly, the variable should probably get a better name... so
take this patch as a test only :-)

I've not updated run-tests.py, but it is simple to give it a --pure
flag too, if desired?


More information about the Mercurial-devel mailing list