Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
pip package starter (#4754)
Browse files Browse the repository at this point in the history
  • Loading branch information
piiswrong authored Jan 22, 2017
1 parent 0ea996e commit ead4be4
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/pip_package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MXNet Python Package
====================
MXNet is a deep learning framework designed for both *efficiency* and *flexibility*.
It allows you to mix the flavours of deep learning programs together to maximize the efficiency and your productivity.


Installation
------------
To install, check [Build Instruction](http://mxnet.io/get_started/setup.html)
1 change: 1 addition & 0 deletions tools/pip_package/make_pip_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python setup.py bdist_wheel
41 changes: 41 additions & 0 deletions tools/pip_package/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# pylint: disable=invalid-name, exec-used
"""Setup mxnet package."""
from __future__ import absolute_import
import os
import sys
import shutil

from setuptools import setup, find_packages
from setuptools.extension import Extension
from setuptools.dist import Distribution

# We can not import `mxnet.info.py` in setup.py directly since mxnet/__init__.py
# Will be invoked which introduces dependences
CURRENT_DIR = os.path.dirname(__file__)
libinfo_py = os.path.join(CURRENT_DIR, '../../python/mxnet/libinfo.py')
libinfo = {'__file__': libinfo_py}
exec(compile(open(libinfo_py, "rb").read(), libinfo_py, 'exec'), libinfo, libinfo)

LIB_PATH = libinfo['find_lib_path']()
__version__ = libinfo['__version__']

class BinaryDistribution(Distribution):
def is_pure(self):
return False
def has_ext_modules(self):
return True

shutil.rmtree(os.path.join(CURRENT_DIR, 'mxnet'))#, ignore_errors=True)
shutil.copytree(os.path.join(CURRENT_DIR, '../../python/mxnet'),
os.path.join(CURRENT_DIR, 'mxnet'))
shutil.copy(LIB_PATH[0], os.path.join(CURRENT_DIR, 'mxnet'))

setup(name='mxnet',
version=__version__,
description=open(os.path.join(CURRENT_DIR, 'README.md')).read(),
zip_safe=False,
packages=find_packages(),
package_data={'mxnet': [os.path.join('mxnet', os.path.basename(LIB_PATH[0]))]},
include_package_data=True,
distclass=BinaryDistribution,
url='https://github.com/dmlc/mxnet')

0 comments on commit ead4be4

Please sign in to comment.