forked from frappe/builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
39 lines (31 loc) · 1.02 KB
/
setup.py
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
32
33
34
35
36
37
38
39
import os
import atexit
import subprocess
from setuptools import find_packages, setup
from setuptools.command.develop import develop
with open("requirements.txt") as f:
install_requires = f.read().strip().split("\n")
# get version from __version__ variable in builder/__init__.py
from builder import __version__ as version
def install_playwright():
python_path = os.path.join("..", "..", "env", "bin", "python")
print(subprocess.run(f"{python_path} -m playwright install chromium", shell=True))
class RunDevelopCommand(develop):
def __init__(self, *args, **kwargs):
super(RunDevelopCommand, self).__init__(*args, **kwargs)
# This is a hack to ensure that the command is run
# after all the dependencies are installed
atexit.register(install_playwright)
setup(
name="builder",
version=version,
author="Suraj Shetty",
author_email="[email protected]",
packages=find_packages(),
zip_safe=False,
include_package_data=True,
install_requires=install_requires,
cmdclass={
"develop": RunDevelopCommand,
},
)