Skip to content

Commit bf1a70a

Browse files
committed
Force install to run build
1 parent 4ac5f11 commit bf1a70a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
try:
1313
from setuptools import setup
14+
from setuptools.command.install import install as _install
1415
using_setuptools = True
1516
except ImportError:
1617
from distutils.core import setup
18+
from distutils.command.install import install as _install
1719
using_setuptools = False
1820

1921
try:
@@ -36,8 +38,14 @@
3638
except ImportError:
3739
using_sphinx = False
3840

41+
class install(_install):
42+
"""Force install to run build target."""
3943

40-
cmdclass = dict(build_py=build_py, build=build)
44+
def run(self):
45+
self.run_command('build')
46+
_install.run(self)
47+
48+
cmdclass = dict(build_py=build_py, build=build, install=install)
4149
translations_dir = os.path.join(package_dir, 'translations')
4250

4351
# localization options

0 commit comments

Comments
 (0)