Skip to content

Conversation

pabloyoyoista
Copy link

@pabloyoyoista pabloyoyoista commented Sep 9, 2025

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

Added the option in argparse for pipx run, and used inject_dep

Test plan

I've used test-driven development, and there is a test for a simple case that should prove this feature is working

TODOs:

  • If this approach is considered acceptable, refactor _download_and_run to just download, so that we can inject the dependency also in the cases where the if venv.has_app == True branch in run_package
  • Given this approach is considered acceptable, add parametrized tests

Closes #1607

Copy link
Member

@dukecat0 dukecat0 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@pabloyoyoista
Copy link
Author

pabloyoyoista commented Sep 17, 2025

Thanks a lot for running the tests! I'm a bit confused about the macos failure though (https://github.com/pypa/pipx/actions/runs/17588256767/job/50365801078?pr=1666). It seems related to the code here, but I fail to see why it fails there. Any tips you might be able to have?

@dukecat0
Copy link
Member

It seems related to the code here

It's not related to your code here, it also failed in every other PRs. Don't worry! :D

@pabloyoyoista
Copy link
Author

CI green 🥳

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 run --with=extra_dependency my_tool

2 participants