Skip to content

Commit

Permalink
Switch to real (non-debugging) loops
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Mar 21, 2024
1 parent 5f9009c commit bc09eb2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/scripts/merge_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,13 @@ def iter_envs(envs: Iterable[str]) -> Iterable[Tuple[str, str]]:
elif len(python_versions) < len(all_python_versions - python_versions):
# requirement present on less Python versions than not
python_version_marker = " or ".join(
f"python_version == '{env_name}'" for env_name in envs
# f"python_version == '{python_version}'" for python_version in python_versions
f"python_version == '{python_version}'" for python_version in python_versions
)
else:
# requirement present on more Python versions than not
python_version_marker = " and ".join(
f"python_version != '{env_name}'" for env_name in all_envs - envs.keys()
# f"python_version != '{python_version}'"
# for python_version in all_python_versions - python_versions
f"python_version != '{python_version}'"
for python_version in all_python_versions - python_versions
)

platform_marker = ""
Expand All @@ -153,14 +151,12 @@ def iter_envs(envs: Iterable[str]) -> Iterable[Tuple[str, str]]:
elif len(platforms) < len(all_platforms - platforms):
# requirement present on less platforms than not
platform_marker = " or ".join(
f"sys_platform == '{env_name}'" for env_name in envs
# f"sys_platform == '{platform}'" for platform in platforms
f"sys_platform == '{platform}'" for platform in platforms
)
else:
# requirement present on more platforms than not
platform_marker = " and ".join(
f"sys_platform != '{env_name}'" for env_name in all_envs - envs.keys()
# f"sys_platform != '{platform}'" for platform in all_platforms - platforms
f"sys_platform != '{platform}'" for platform in all_platforms - platforms
)

if python_version_marker and platform_marker:
Expand Down

0 comments on commit bc09eb2

Please sign in to comment.