Skip to content

[BUG] build_editable does not emit #!python shebang for scripts #4863

@sbidoul

Description

@sbidoul

setuptools version

75.8.2

Python version

3.13, probably irrelevant

OS

linux, probably irrelevant

Additional environment information

No response

Description

Assume a script like this

#!/usr/bin/env python3
from pkga import main

main()

and a setup.py like this

setup(
    name="pkga",
    scripts=["scripts/pkga-script"]
)

When running build_editable on such a project, the file pkga-0.1.0.data/scripts/pkga-script in the editable wheel produced has the path to the python interpreter used for the build.

This is unexpected. When running build_wheel, the shebang is #!python.

Note that script entry points correctly emit #!python both for regular and editable wheels.

Expected behavior

The shebang in the script in the editable wheel should be #!python too.

How to Reproduce

I don't have packaged the repro in a self-contained repo, but the example above should be explicit enough. Let me know if you need more information to reproduce.

Output

...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions