Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
userpj committed Nov 7, 2024
1 parent 036c1f7 commit a4b0721
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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={
Expand All @@ -66,3 +79,5 @@
long_description="百度智能云千帆AppBuilder, 开箱即用的组件与框架, 高效开发你的AI原生应用, 更多信息请登录: https://appbuilder.cloud.baidu.com/",
url="https://github.com/baidubce/app-builder",
)

shutil.rmtree(package_dir)

0 comments on commit a4b0721

Please sign in to comment.