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

[Internal] Use sys.executable to make sure dev setup use current env. #2998

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

thy09
Copy link
Contributor

@thy09 thy09 commented Apr 25, 2024

Description

Currently there are some corner case scenarios that pip is not in the subprocess environment. To avoid this issue, we directly use sys.executable to make sure we can use correct pip in the subprocess.

This pull request includes changes to the scripts/dev-setup/main.py file to improve the package installation process. The changes involve importing the sys module and modifying the install_pkg_editable function.

Key changes include:

  • scripts/dev-setup/main.py: Imported the sys module to use the Python interpreter's executable for package installation.
  • def install_pkg_editable(pkg: str, verbose: bool, is_vscode: bool = False) -> No in scripts/dev-setup/main.py: Modified the command used for package installation to use sys.executable instead of directly calling pip. This ensures that the correct Python interpreter is used for the installation process.

All Promptflow Contribution checklist:

  • The pull request does not introduce [breaking changes].
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: suggested workflow.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@thy09 thy09 requested a review from a team as a code owner April 25, 2024 03:44
@thy09 thy09 merged commit cfdb672 into main Apr 25, 2024
10 checks passed
@thy09 thy09 deleted the heta/ensure-dev-setup-using-current-env branch April 25, 2024 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants