Skip to content

#!/usr/bin/env python3#53

Merged
ericaltendorf merged 2 commits into
ericaltendorf:developmentfrom
altendky:usr_bin_env_python3
Mar 26, 2021
Merged

#!/usr/bin/env python3#53
ericaltendorf merged 2 commits into
ericaltendorf:developmentfrom
altendky:usr_bin_env_python3

Conversation

@altendky

Copy link
Copy Markdown
Collaborator

This allows use in an activated venv, for example.

This allows use in an activated venv, for example.
@altendky

Copy link
Copy Markdown
Collaborator Author

The files where the #! is removed entirely didn't seem to 'do' anything beyond define functions and classes, so there's not much need for them to be directly runnable. Unless I'm missing some bit in them. I updated the execute permissions to match the presence or lack of a #!.

This follows helping someone in #plotman figure out getting latest psutil as noted in #38.

@altendky

Copy link
Copy Markdown
Collaborator Author

Longer term, entry_points console_scripts is a nice part of an installable package with directly runnable files on all systems.

https://chriswarrick.com/blog/2014/09/15/python-apps-the-right-way-entry_points-and-scripts/

Though these days generally declaratively in a setup.cfg instead.

https://github.com/altendky/qtrio/blob/f77f7e009ce7f3985cbf7d4648ec0160096a55fc/setup.cfg#L52-L54

[options.entry_points]
console_scripts =
    qtrio = qtrio._cli:cli

@ericaltendorf ericaltendorf changed the base branch from main to development March 26, 2021 17:22
@ericaltendorf

Copy link
Copy Markdown
Owner

Looks good, thanks for the cleanup. Will look at entry_points and console_scripts.

Changing to development base branch to merge.

@ericaltendorf ericaltendorf merged commit bfffddf into ericaltendorf:development Mar 26, 2021
@altendky altendky deleted the usr_bin_env_python3 branch March 26, 2021 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants