-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
36 lines (33 loc) · 1.04 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
# Copyright (c) 2023 - 2025, Owners of https://github.com/ag2ai
#
# SPDX-License-Identifier: Apache-2.0
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
from subprocess import check_call
import os
import sys
class PreInstallCommand(install):
"""Pre-installation for installation mode."""
def run(self):
try:
check_call([sys.executable, 'build_frontend.py'])
except Exception as e:
print(f"Error building frontend: {e}")
print("Continuing with installation...")
install.run(self)
class PreDevelopCommand(develop):
"""Pre-installation for development mode."""
def run(self):
try:
check_call([sys.executable, 'build_frontend.py'])
except Exception as e:
print(f"Error building frontend: {e}")
print("Continuing with installation...")
develop.run(self)
setup(
cmdclass={
'install': PreInstallCommand,
'develop': PreDevelopCommand,
}
)