Skip to content

Commit

Permalink
add extrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ying Chen committed Mar 30, 2024
1 parent 7cb5642 commit 4a41843
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/installer/windows/scripts/generate_dependency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ast
import toml
import re
import subprocess
import copy
Expand Down Expand Up @@ -81,6 +82,17 @@ def get_package_dependencies(package_name_list):
direct_package_dependencies = get_package_dependencies(dependencies)
all_packages = list(set(dependencies) | set(direct_package_dependencies))

# get promptflow-** extra packages
extra_packages = []
for package in all_packages:
if package.startswith('promptflow'):
data = toml.load(get_git_base_dir() / "src" / package / "pyproject.toml")
extras = data.get("tool", {}).get("poetry", {}).get("extras", {})
for _, values in extras.items():
extra_packages.extend(values)
extra_packages_names = extract_package_names(extra_packages)
all_packages.extend(extra_packages_names)

# remove all packages starting with promptflow
all_packages = [package for package in all_packages if not package.startswith('promptflow')]

Expand Down

0 comments on commit 4a41843

Please sign in to comment.