Defined Cargo features for Python3, making them overall simpler to
use, hooked them in build and made mercurial.rustext importable.
This is tested with Python 3.6.7.
hg-reviewers |
Defined Cargo features for Python3, making them overall simpler to
use, hooked them in build and made mercurial.rustext importable.
This is tested with Python 3.6.7.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Queued, thanks.
We'll probably need to add suffix to the filename to disambiguate py2/3
modules. It's $PYTHON-config --extension-suffix on my Linux machine, but
I don't know if it can be obtained directly in setup.py.
@yuja great, thanks. Didn't know about this suffix, apparently it can be obtained through the sysconfig module (thats what $PYTHON-config does)
~ $ python2 -c "import sysconfig; print(sysconfig.get_config_var('SO'))" .so ~ $ python3 -c "import sysconfig; print(sysconfig.get_config_var('SO'))" -c:1: DeprecationWarning: SO is deprecated, use EXT_SUFFIX .cpython-37m-x86_64-linux-gnu.so ~ $ python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" .cpython-37m-x86_64-linux-gnu.so
I suppose that's also the thing to use to build for Windows or other operating systems.