Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify if script name provided is a file before running it #1155

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

dukecat0
Copy link
Member

  • I have added an entry to docs/changelog.md

Summary of changes

pipx run: Verify whether the script name provided is a file before running it
Closes #1152

Test plan

Tested by running

nox -s tests-3.12

@chrysle
Copy link
Contributor

chrysle commented Dec 18, 2023

Didn't you want to detect whether the file is a valid script?

Co-authored-by: Tzu-ping Chung <[email protected]>
@dukecat0
Copy link
Member Author

Didn't you want to detect whether the file is a valid script?

I think a file that has no .py extension or shebang can be a valid script as well. (At least the Python interpreter doesn't care about it.) That's why I personally believe that checking whether it is a file is enough.

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test please 👍

@dukecat0
Copy link
Member Author

Not sure if we need a test for this...? I personally think this is a very minor bug and doesn't require a test.

@dukecat0 dukecat0 requested a review from gaborbernat January 7, 2024 04:48
@gaborbernat
Copy link
Contributor

gaborbernat commented Jan 8, 2024

Not sure if we need a test for this...? I personally think this is a very minor bug and doesn't require a test.

I disagree. Every bug fix must have a test.

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests please.

@dukecat0
Copy link
Member Author

dukecat0 commented Jan 9, 2024

Tests please.

Added

@dukecat0 dukecat0 requested a review from gaborbernat January 9, 2024 08:20
@gaborbernat gaborbernat merged commit 5563ae6 into pypa:main Jan 10, 2024
12 checks passed
@dukecat0 dukecat0 deleted the verify-script branch January 10, 2024 16:20
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.

pipx 1.3 breaks run <app> if app is also a directory in your cwd
4 participants