-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
31 lines (28 loc) · 921 Bytes
/
setup.py
File metadata and controls
31 lines (28 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from setuptools import setup, find_packages
from setuptools.command.install import install
import subprocess
import os
def read_requirements():
"""Read the requirements.txt file and return a list of requirements."""
with open('requirements.txt') as req_file:
return req_file.read().splitlines()
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
install.run(self)
# Run `npm install` in the node directory
node_dir = os.path.join(self.install_lib, 'pybruno', 'node')
subprocess.check_call(['npm', 'install'], cwd=node_dir)
setup(
name='pybruno',
version='0.1',
packages=find_packages(),
install_requires=read_requirements(),
cmdclass={
'install': PostInstallCommand,
},
include_package_data=True,
package_data={
'pybruno': ['node/*.js', 'node/package.json'],
},
)