Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion relenv/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def format_shebang(python, tpl=SHEBANG_TPL):
"""
Return a formatted shebang.
"""
return tpl.format(python).strip()
return tpl.format(python).strip() + "\n"


def build_arch():
Expand Down
4 changes: 4 additions & 0 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ def test_shebang_tpl_macos():
assert proc.returncode == 0


def test_format_shebang_newline():
assert format_shebang("python3", SHEBANG_TPL_LINUX).endswith("\n")


def test_relative_interpreter_default_location():
assert relative_interpreter(
"/tmp/relenv", "/tmp/relenv/bin", "/tmp/relenv/bin/python3"
Expand Down
34 changes: 34 additions & 0 deletions tests/test_verify_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,40 @@ def test_install_with_target_shebang(pipexec, build, minor_version):
)


@pytest.mark.skip_unless_on_linux
def test_install_shebang_pip_24_2(pipexec, build, minor_version):
subprocess.run(
[str(pipexec), "install", "--upgrade", "pip==24.2"],
check=True,
)
subprocess.run(
[str(pipexec), "install", "cowsay"],
check=True,
)
ret = subprocess.run(
[str(build / "bin" / "cowsay"), "-t", "moo"],
check=False,
)
assert ret.returncode == 0


@pytest.mark.skip_unless_on_linux
def test_install_shebang_pip_25_2(pipexec, build, minor_version):
subprocess.run(
[str(pipexec), "install", "--upgrade", "pip==25.2"],
check=True,
)
subprocess.run(
[str(pipexec), "install", "cowsay"],
check=True,
)
ret = subprocess.run(
[str(build / "bin" / "cowsay"), "-t", "moo"],
check=False,
)
assert ret.returncode == 0


@pytest.mark.skip_unless_on_linux
def test_install_with_target_uninstall(pipexec, build):
env = os.environ.copy()
Expand Down
Loading