Skip to content

Commit

Permalink
fix(packages): improve finding the packages and their versions
Browse files Browse the repository at this point in the history
This commit adds the ability to find the packages when they are using `[]` in the name. An example is `honeybee-display[full]`.
  • Loading branch information
mostaphaRoudsari committed May 17, 2023
1 parent f521460 commit bee228f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pollination_dsl/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ def get_requirement_version(package_name, dependency_name):
str(package.specifier).replace('=', '').replace('>', '').replace('<', '')
requirements[package.project_name] = version

# catch the case of using [] in name e.g. honeybee-display[full]
requirements = {
package.split('[')[0].strip(): version
for package, version in requirements.items()
}

assert dependency_name in requirements, \
f'{dependency_name} is not a requirement for {package_name}.'

Expand Down

0 comments on commit bee228f

Please sign in to comment.