lionheart/pinboard.py

"bad interpreter" when running CLI

bhrutledge opened this issue ยท 5 comments

Looks like the shebang line on the script is hard-coded to somebody's local environment:

$ python3 -m pip install pinboard==2.1.6

$ pinboard -h
bash: /usr/local/bin/pinboard: /Users/dan/Projects/pinboard.py/venv/bin/python3: bad interpreter: No such file or directory

$ head -n1 /usr/local/bin/pinboard
#!/Users/dan/Projects/pinboard.py/venv/bin/python3

It works in 2.1.4:

$ python3 -m pip install pinboard==2.1.4

$ pinboard -h
usage: pinboard [-h] [--raw]
...

$ head -n1 /usr/local/bin/pinboard
#!/usr/local/opt/python/bin/python3.6

It's broken in 2.1.5, but nothing jumps out to me when I compare that tag with 2.1.4.

I don't know enough (yet) about how package distributions are built to offer a fix.

FWIW, it works when installed from a clone of the repo via python3 -m pip install .

dlo commented

For some reason the shebang line in the binary is getting dynamically rewritten to my local environment when pushing to PyPi. This is a new thing, so seeing what part of the submission process is causing this.

dlo commented

Version 2.1.8 just deployed to PyPi. Hopefully this nips it in the bud

@bhrutledge could you give it a shot when it's available and let me know if things look ok?

For future reference: https://duckduckgo.com/?q=shebang+wrong+wheel+pypi+&t=osx&ia=web

๐Ÿ‘ Thanks!

$ python3 -m pip install pinboard==2.1.8

$ pinboard -h
usage: pinboard [-h] [--raw]
...

$ head -n1 /usr/local/bin/pinboard
#!/usr/local/opt/python/bin/python3.7

@dlo Also for future reference: it seems the general recommendation for exposing executable scripts is to use something like:

setup(
    # ...
    entry_points={
        'console_scripts': [
            'pinboard=pinboard:main',
        ],
    },
)

IE, instead of the scripts argument. I wonder if that would avoid the shebang issue.