diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index f0d30bf2..7cd677f8 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1978,7 +1978,15 @@ fi # Compile with `--enable-unicode=ucs4` by default (#257) if [[ "$PYTHON_CONFIGURE_OPTS" != *"--enable-unicode="* ]]; then if ! is_mac; then - package_option python configure --enable-unicode=ucs4 + # Skip specifying `--enable-unicode` for CPython 3.3+ (#912) + case "${DEFINITION_PATH##*/}" in + "2."* | \ + "3.0" | "3.0."* | "3.0-"* | \ + "3.1" | "3.1."* | "3.1-"* | \ + "3.2" | "3.2."* | "3.2-"* ) + package_option python configure --enable-unicode=ucs4 + ;; + esac fi fi diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index 42ca4b08..b86168ee 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -61,7 +61,7 @@ assert_build_log() { @test "yaml is installed for python" { cached_tarball "yaml-0.1.6" - cached_tarball "Python-3.2.1" + cached_tarball "Python-3.6.2" stub brew false stub_make_install @@ -81,8 +81,8 @@ yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " yaml-0.1.6: --prefix=$INSTALL_ROOT make -j 2 make install -Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " -Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4 +Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " +Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib make -j 2 make install OUT @@ -90,7 +90,7 @@ OUT @test "apply python patch before building" { cached_tarball "yaml-0.1.6" - cached_tarball "Python-3.2.1" + cached_tarball "Python-3.6.2" stub brew false stub_make_install @@ -113,8 +113,8 @@ yaml-0.1.6: --prefix=$INSTALL_ROOT make -j 2 make install patch -p0 --force -i $TMP/python-patch.XXX -Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " -Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4 +Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " +Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib make -j 2 make install OUT @@ -122,7 +122,7 @@ OUT @test "apply python patch from git diff before building" { cached_tarball "yaml-0.1.6" - cached_tarball "Python-3.2.1" + cached_tarball "Python-3.6.2" stub brew false stub_make_install @@ -145,15 +145,15 @@ yaml-0.1.6: --prefix=$INSTALL_ROOT make -j 2 make install patch -p1 --force -i $TMP/python-patch.XXX -Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " -Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4 +Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " +Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib make -j 2 make install OUT } @test "yaml is linked from Homebrew" { - cached_tarball "Python-3.2.1" + cached_tarball "Python-3.6.2" brew_libdir="$TMP/homebrew-yaml" mkdir -p "$brew_libdir" @@ -172,15 +172,15 @@ OUT unstub make assert_build_log < "$definition" <<<"echo python-build" run pyenv-install "$definition" assert_success assert_output <<-OUT -before: ${PYENV_ROOT}/versions/3.2.1 +before: ${PYENV_ROOT}/versions/3.6.2 python-build after: 0 rehashed @@ -41,16 +41,16 @@ OUT stub pyenv-hooks "uninstall : echo '$HOOK_PATH'/uninstall.bash" stub pyenv-rehash "echo rehashed" - mkdir -p "${PYENV_ROOT}/versions/3.2.1" - run pyenv-uninstall -f 3.2.1 + mkdir -p "${PYENV_ROOT}/versions/3.6.2" + run pyenv-uninstall -f 3.6.2 assert_success assert_output <<-OUT -before: ${PYENV_ROOT}/versions/3.2.1 -rm -rf ${PYENV_ROOT}/versions/3.2.1 +before: ${PYENV_ROOT}/versions/3.6.2 +rm -rf ${PYENV_ROOT}/versions/3.6.2 rehashed after. OUT - refute [ -d "${PYENV_ROOT}/versions/3.2.1" ] + refute [ -d "${PYENV_ROOT}/versions/3.6.2" ] } diff --git a/plugins/python-build/test/pyenv_ext.bats b/plugins/python-build/test/pyenv_ext.bats index 823662c0..b79ac37a 100644 --- a/plugins/python-build/test/pyenv_ext.bats +++ b/plugins/python-build/test/pyenv_ext.bats @@ -93,13 +93,13 @@ resolve_link() { } @test "apply built-in python patch before building" { - cached_tarball "Python-3.2.1" + cached_tarball "Python-3.6.2" stub brew false stub_make_install stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log' - echo | install_patch definitions/vanilla-python "Python-3.2.1/empty.patch" + echo | install_patch definitions/vanilla-python "Python-3.6.2/empty.patch" # yyuu/pyenv#257 stub uname '-s : echo Linux' @@ -110,8 +110,8 @@ resolve_link() { assert_build_log <> build.log' - echo "foo" | install_patch definitions/vanilla-python "Python-3.2.1/foo.patch" - echo "bar" | install_patch definitions/vanilla-python "Python-3.2.1/bar.patch" - echo "baz" | install_patch definitions/vanilla-python "Python-3.2.1/baz.patch" + echo "foo" | install_patch definitions/vanilla-python "Python-3.6.2/foo.patch" + echo "bar" | install_patch definitions/vanilla-python "Python-3.6.2/bar.patch" + echo "baz" | install_patch definitions/vanilla-python "Python-3.6.2/baz.patch" # yyuu/pyenv#257 stub uname '-s : echo Linux' @@ -142,8 +142,8 @@ OUT patch: bar patch: baz patch: foo -Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " -Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs4 +Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " +Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib make -j 2 make install OUT @@ -153,7 +153,7 @@ OUT } @test "allow custom make install target" { - cached_tarball "Python-3.2.1" + cached_tarball "Python-3.6.2" stub brew false stub "$MAKE" \ @@ -168,8 +168,8 @@ OUT assert_success assert_build_log <