You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/10/15 07:22:07 UTC
[GitHub] szha commented on a change in pull request #8244: generate op frontend code for IDE auto-complete
szha commented on a change in pull request #8244: generate op frontend code for IDE auto-complete
URL: https://github.com/apache/incubator-mxnet/pull/8244#discussion_r144711701
##########
File path: python/setup.py
##########
@@ -22,15 +22,31 @@
import sys
# need to use distutils.core for correct placement of cython dll
kwargs = {}
+required_packages = ['numpy', 'requests', 'graphviz']
if "--inplace" in sys.argv:
from distutils.core import setup
from distutils.extension import Extension
+ from distutils.command.install import install
else:
from setuptools import setup
from setuptools.extension import Extension
- kwargs = {'install_requires': ['numpy', 'requests', 'graphviz'], 'zip_safe': False}
+ kwargs = {'install_requires': required_packages,
+ 'setup_requires': required_packages,
+ 'tests_require': required_packages,
+ 'zip_safe': False}
+ from setuptools.command.install import install
from setuptools import find_packages
+class PostInstallCommand(install):
+ """Post-installation for installation mode."""
+ def run(self):
+ install.run(self)
+ from mxnet.base import _generate_op_module_signature
Review comment:
There's no guarantee, and neither is there guarantee that self or install resides in the target site-packages. Currently what this code does in practice is:
1. generate the code in the source code folder first (hence the .gitignore change)
2. copy source codes into $PWD/build/mxnet and add packaging info
3. copy $PWD/build to the site-packages and byte-compile the .py files.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services