Skip to content

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

Merged
dwoz merged 7 commits into
saltstack:masterfrom
xeacott:fix/pop_build_pip
May 7, 2020
Merged

dwoz merged 7 commits into
saltstack:masterfrom
xeacott:fix/pop_build_pip

Conversation

@xeacott

@xeacott xeacott commented Apr 29, 2020 •

Copy link
Copy Markdown
Contributor

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

@s0undt3ch s0undt3ch left a comment

Copy link
Copy Markdown
Contributor

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

xeacott commented Apr 30, 2020

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Contributor

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
Copy Markdown
Contributor
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
Comment thread salt/modules/pip.py Resolved
Comment thread tests/unit/modules/test_pip.py Resolved
@dwoz
dwoz merged commit d2688ae into saltstack:master May 7, 2020
@sagetherage sagetherage added the ZRelease-Sodium retired label label 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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants