mirror of
https://github.com/wassname/ray.git
synced 2026-07-02 03:50:57 +08:00
Python 3.8 compatibility (#7754)
This commit is contained in:
@@ -15,17 +15,21 @@ DOWNLOAD_DIR=python_downloads
|
||||
|
||||
PY_VERSIONS=("3.5.3"
|
||||
"3.6.1"
|
||||
"3.7.0")
|
||||
"3.7.0"
|
||||
"3.8.2")
|
||||
PY_INSTS=("python-3.5.3-macosx10.6.pkg"
|
||||
"python-3.6.1-macosx10.6.pkg"
|
||||
"python-3.7.0-macosx10.6.pkg")
|
||||
"python-3.7.0-macosx10.6.pkg"
|
||||
"python-3.8.2-macosx10.9.pkg")
|
||||
PY_MMS=("3.5"
|
||||
"3.6"
|
||||
"3.7")
|
||||
"3.7"
|
||||
"3.8")
|
||||
|
||||
# The minimum supported numpy version is 1.14, see
|
||||
# https://issues.apache.org/jira/browse/ARROW-3141
|
||||
NUMPY_VERSIONS=("1.14.5"
|
||||
"1.14.5"
|
||||
"1.14.5"
|
||||
"1.14.5")
|
||||
|
||||
@@ -76,7 +80,7 @@ for ((i=0; i<${#PY_VERSIONS[@]}; ++i)); do
|
||||
$PIP_CMD install -q setuptools_scm==3.1.0
|
||||
# Fix the numpy version because this will be the oldest numpy version we can
|
||||
# support.
|
||||
$PIP_CMD install -q numpy==$NUMPY_VERSION cython==0.29.0
|
||||
$PIP_CMD install -q numpy==$NUMPY_VERSION cython==0.29.15
|
||||
# Install wheel to avoid the error "invalid command 'bdist_wheel'".
|
||||
$PIP_CMD install -q wheel
|
||||
# Set the commit SHA in __init__.py.
|
||||
|
||||
@@ -13,11 +13,13 @@ chmod +x /usr/bin/nproc
|
||||
|
||||
PYTHONS=("cp35-cp35m"
|
||||
"cp36-cp36m"
|
||||
"cp37-cp37m")
|
||||
"cp37-cp37m"
|
||||
"cp38-cp38")
|
||||
|
||||
# The minimum supported numpy version is 1.14, see
|
||||
# https://issues.apache.org/jira/browse/ARROW-3141
|
||||
NUMPY_VERSIONS=("1.14.5"
|
||||
"1.14.5"
|
||||
"1.14.5"
|
||||
"1.14.5")
|
||||
|
||||
@@ -55,7 +57,7 @@ for ((i=0; i<${#PYTHONS[@]}; ++i)); do
|
||||
pushd python
|
||||
# Fix the numpy version because this will be the oldest numpy version we can
|
||||
# support.
|
||||
/opt/python/${PYTHON}/bin/pip install -q numpy==${NUMPY_VERSION} cython==0.29.0
|
||||
/opt/python/${PYTHON}/bin/pip install -q numpy==${NUMPY_VERSION} cython==0.29.15
|
||||
# Set the commit SHA in __init__.py.
|
||||
if [ -n "$TRAVIS_COMMIT" ]; then
|
||||
sed -i.bak "s/{{RAY_COMMIT_SHA}}/$TRAVIS_COMMIT/g" ray/__init__.py && rm ray/__init__.py.bak
|
||||
|
||||
@@ -417,7 +417,7 @@ def _numpy_frombuffer(buffer, dtype, shape, order):
|
||||
array = _frombuffer(buffer, dtype, shape, order)
|
||||
# Unfortunately, numpy does not follow the standard, so we still
|
||||
# have to set the readonly flag for it here.
|
||||
array.setflags(write=not buffer.readonly)
|
||||
array.setflags(write=isinstance(buffer, bytearray) or not buffer.readonly)
|
||||
return array
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ setup(
|
||||
# The BinaryDistribution argument triggers build_ext.
|
||||
distclass=BinaryDistribution,
|
||||
install_requires=requires,
|
||||
setup_requires=["cython >= 0.29"],
|
||||
setup_requires=["cython >= 0.29.14"],
|
||||
extras_require=extras,
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
|
||||
Reference in New Issue
Block a user