forked from baidubce/app-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,27 @@ | |
Date: 2023/12/01 11:19:24 | ||
""" | ||
|
||
import os | ||
import shutil | ||
import datetime | ||
from setuptools import setup, find_packages | ||
|
||
with open('requirements.txt') as f: | ||
requirements = f.read().splitlines() | ||
|
||
packages = [p.replace("python", "appbuilder") for p in find_packages()] | ||
package_data = {} | ||
|
||
now = datetime.datetime.now() | ||
timestamp_str = now.strftime("%Y%m%d_%H%M%S") | ||
package_dir = f"appbuilder_sdk_{timestamp_str}" | ||
if not os.path.exists(package_dir): | ||
os.makedirs(package_dir) | ||
|
||
shutil.copytree("python", os.path.join(package_dir, "appbuilder")) | ||
shutil.copy("requirements.txt", package_dir) | ||
|
||
packages = find_packages(where=package_dir) | ||
package_data = {} | ||
print(packages) | ||
for package in packages: | ||
if package.startswith('appbuilder.utils'): | ||
package_data[package] = ["*.md"] | ||
|
@@ -46,7 +59,7 @@ | |
author_email="[email protected]", | ||
packages=packages, | ||
package_data=package_data, | ||
package_dir={"appbuilder": "python"}, | ||
package_dir={'': package_dir}, | ||
install_requires=requirements, | ||
python_requires=">=3.9", | ||
extras_require={ | ||
|
@@ -66,3 +79,5 @@ | |
long_description="百度智能云千帆AppBuilder, 开箱即用的组件与框架, 高效开发你的AI原生应用, 更多信息请登录: https://appbuilder.cloud.baidu.com/", | ||
url="https://github.com/baidubce/app-builder", | ||
) | ||
|
||
shutil.rmtree(package_dir) |