Skip to content

Commit

Permalink
Core: clean python package build.
Browse files Browse the repository at this point in the history
- added script to build the package into build/python
- added cleanup class to setup.py
  • Loading branch information
GPMueller committed May 28, 2017
1 parent 26603fb commit 2f834d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions build_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mkdir -p build/python
cd core/python
python setup.py egg_info --egg-base ../../build/python sdist -d ../../build/python bdist_wheel -d ../../build/python
python setup.py clean
15 changes: 13 additions & 2 deletions core/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sys

from distutils.util import get_platform
from setuptools import setup
from setuptools import setup, Command
from wheel.bdist_wheel import bdist_wheel as bdist_wheel_


Expand Down Expand Up @@ -74,6 +74,17 @@ def finalize_options(self):
self.plat_name = platform_name


class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')


if __name__ == "__main__":
long_description = read('README.md')
setup(
Expand All @@ -94,5 +105,5 @@ def finalize_options(self):
package_data={
'spirit': ['libSpirit.dylib', 'libSpirit.so', 'libSpirit.dll'],
},
cmdclass={'bdist_wheel': bdist_wheel},
cmdclass={'bdist_wheel': bdist_wheel, 'clean': CleanCommand},
)

0 comments on commit 2f834d9

Please sign in to comment.