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

Return pip binary without -m flag when using onedir #56988

Merged
merged 7 commits into from May 7, 2020

Conversation

xeacott
Copy link
Contributor

@xeacott xeacott commented Apr 29, 2020

What does this PR do?

When using the onedir inside dist/run from pop-build, pip is provided and therefore cannot handle the -m flag. The pip module needs to handle this case.

What issues does this PR fix or reference?

Fixes:
https://github.com/saltstack/release-planning/issues/239

Previous Behavior

Remove this section if not relevant

New Behavior

Remove this section if not relevant

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@xeacott xeacott requested a review from a team as a code owner April 29, 2020 19:52
@ghost ghost requested review from garethgreenaway and removed request for a team April 29, 2020 19:52
Copy link
Member

@s0undt3ch s0undt3ch left a comment

Choose a reason for hiding this comment

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

Should we keep functionality as it was and provide an alternate logic if the app is frozen and/or has the sys._MEIPASS attribute?

@xeacott
Copy link
Contributor Author

xeacott commented Apr 30, 2020

@s0undt3ch I'm open to taking this in a different direction. The heart of the issue is that the executable that sys.executable is reporting is not python, just something else; in the case of the onedir it's ./run. So the -m that gets passed around isn't going to a python binary but rather the pip binary.

@s0undt3ch
Copy link
Member

Sure, and we should handle that. Draw your own conclusions and solution when running under pyinstaller.
If it's not running under pyinstaller, then the logic should remain as it is today.

Makes sense?

@s0undt3ch
Copy link
Member

if under_pyinstaller:
     ...
else:
    ...

@xeacott xeacott changed the title [WIP] Return pip binary without -m flag when using onedir Return pip binary without -m flag when using onedir May 1, 2020
salt/modules/pip.py Show resolved Hide resolved
tests/unit/modules/test_pip.py Outdated Show resolved Hide resolved
@dwoz dwoz merged commit d2688ae into saltstack:master May 7, 2020
@sagetherage sagetherage added the ZRelease-Sodium retired label label May 18, 2020
@sagetherage sagetherage added this to Done in Sodium May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZRelease-Sodium retired label
Projects
No open projects
Sodium
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants