Skip to content

Commit

Permalink
Add pip install bigdl (intel#3245)
Browse files Browse the repository at this point in the history
* add pip install bigdl

* change description
  • Loading branch information
shanyu-sys authored Oct 26, 2021
1 parent 4714ff3 commit eb39853
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
72 changes: 72 additions & 0 deletions python/dev/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash

#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -e
RUN_SCRIPT_DIR=$(cd $(dirname $0) ; pwd)
echo $RUN_SCRIPT_DIR
BIGDL_PYTHON_DIR="$(cd ${RUN_SCRIPT_DIR}/..; pwd)"
echo $BIGDL_PYTHON_DIR

if (( $# < 3)); then
echo "Usage: release.sh platform version upload"
echo "Usage example: bash release.sh linux default false"
echo "Usage example: bash release.sh mac 0.14.0.dev1 true"
exit -1
fi

platform=$1
version=$2
upload=$3 # Whether to upload the whl to pypi

if [ "${version}" != "default" ]; then
echo "User specified version: ${version}"
echo $version > $BIGDL_PYTHON_DIR/version.txt
fi

bigdl_version=$(cat $BIGDL_PYTHON_DIR/version.txt | head -1)

if [ "$platform" == "mac" ]; then
verbose_pname="macosx_10_11_x86_64"
elif [ "$platform" == "linux" ]; then
verbose_pname="manylinux1_x86_64"
else
echo "Unsupported platform"
fi

cd $BIGDL_PYTHON_DIR
if [ -d "${BIGDL_PYTHON_DIR}/build" ]; then
rm -r ${BIGDL_PYTHON_DIR}/build
fi

if [ -d "${BIGDL_PYTHON_DIR}/dist" ]; then
rm -r ${BIGDL_PYTHON_DIR}/dist
fi

if [ -d "${BIGDL_PYTHON_DIR}/bigdl.egg-info" ]; then
rm -r ${BIGDL_PYTHON_DIR}/bigdl.egg-info
fi

wheel_command="python setup.py bdist_wheel --plat-name ${verbose_pname} --python-tag py3"
echo "Packing python distribution: $wheel_command"
${wheel_command}

if [ ${upload} == true ]; then
upload_command="twine upload dist/bigdl-${bigdl_version}-py3-none-${verbose_pname}.whl"
echo "Please manually upload with this command: $upload_command"
$upload_command
fi
54 changes: 54 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env python

#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import os
from setuptools import setup

bigdl_home = os.path.abspath(__file__ + "/../../")
exclude_patterns = ["*__pycache__*", "*ipynb_checkpoints*"]

VERSION = open(os.path.join(bigdl_home, 'python/version.txt'), 'r').read().strip()


def setup_package():
metadata = dict(
name='bigdl',
version=VERSION,
description='Building Large-Scale AI Applications for Distributed Big Data',
author='BigDL Authors',
author_email='bigdl-user-group@googlegroups.com',
license='Apache License, Version 2.0',
url='https://github.com/intel-analytics/analytics-zoo',
install_requires=['bigdl-orca=='+VERSION, 'bigdl-nano=='+VERSION, 'bigdl-chronos=='+VERSION,
'bigdl-friesian=='+VERSION, 'bigdl-serving=='+VERSION],
dependency_links=['https://d3kbcqa49mib13.cloudfront.net/spark-2.0.0-bin-hadoop2.7.tgz'],
include_package_data=True,
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython'],
platforms=['mac', 'linux']
)

setup(**metadata)


if __name__ == '__main__':
setup_package()

0 comments on commit eb39853

Please sign in to comment.