Skip to content

Commit

Permalink
Fix the CI (#2721)
Browse files Browse the repository at this point in the history
  • Loading branch information
HandSonic authored May 11, 2024
1 parent 7864fde commit 3be84af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tasks/make_zipapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def get_dependencies(whl, version):
platforms = []
platform_positions = WheelDownloader._marker_at(markers, "sys_platform")
deleted = 0
for pos in platform_positions: # can only be ore meaningfully
for pos in platform_positions: # can only be or meaningfully
platform = f"{markers[pos][1].value}{markers[pos][2].value}"
deleted += WheelDownloader._del_marker_at(markers, pos - deleted)
platforms.append(platform)
Expand Down
8 changes: 3 additions & 5 deletions tests/unit/activation/test_python_activator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, session) -> None:
sys.executable,
activate_script="activate_this.py",
extension="py",
non_source_fail_message="You must use exec(open(this_file).read(), {'__file__': this_file})",
non_source_fail_message="You must use import runpy; runpy.run_path(this_file)",
)
self.unix_line_ending = not IS_WIN

Expand All @@ -36,6 +36,7 @@ def _get_test_lines(activate_script):
import os
import sys
import platform
import runpy
def print_r(value):
print(repr(value))
Expand All @@ -47,10 +48,7 @@ def print_r(value):
file_at = {str(activate_script)!r}
# CPython 2 requires non-ascii path open to be unicode
with open(file_at, "r", encoding='utf-8') as file_handler:
content = file_handler.read()
exec(content, {{"__file__": file_at}})
runpy.run_path(file_at)
print_r(os.environ.get("VIRTUAL_ENV"))
print_r(os.environ.get("VIRTUAL_ENV_PROMPT"))
print_r(os.environ.get("PATH").split(os.pathsep))
Expand Down

0 comments on commit 3be84af

Please sign in to comment.