Skip to content

feat(vscode): .env file into python env#4764

Merged
benfdking merged 1 commit intomainfrom
tests_for_python_env
Jun 19, 2025
Merged

feat(vscode): .env file into python env#4764
benfdking merged 1 commit intomainfrom
tests_for_python_env

Conversation

@benfdking
Copy link
Copy Markdown
Contributor

@benfdking benfdking commented Jun 19, 2025

  • Picks up the .env file specified through the Python extension and places it into the Python environment that the extension calls are made in.

@benfdking benfdking force-pushed the tests_for_python_env branch from 1baccfb to 718c81b Compare June 19, 2025 13:28
@benfdking benfdking requested a review from Copilot June 19, 2025 13:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the VS Code extension to load environment variables (including those from a .env file) into the Python environment for SQLMesh commands, and refactors test helpers for TCloud setup.

  • Extract common TCloud authentication and version helpers into tcloud_utils.ts
  • Introduce getPythonEnvVariables and merge its output into sqlmeshExec and sqlmeshLspExec
  • Add end-to-end tests (python_env.spec.ts) to verify .env variable injection

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vscode/extension/tests/tcloud_utils.ts New shared helpers for TCloud authentication and version setup
vscode/extension/tests/tcloud.spec.ts Removed duplicate helpers and import from tcloud_utils.ts
vscode/extension/tests/python_env.spec.ts New tests for verifying .env variable injection in Python env
vscode/extension/src/utilities/sqlmesh/sqlmesh.ts Merge Python env vars into process environment for SQLMesh cmds
vscode/extension/src/utilities/common/python.ts Add getPythonEnvVariables to fetch env vars from Python ext
Comments suppressed due to low confidence (1)

vscode/extension/tests/python_env.spec.ts:16

  • [nitpick] The parameter name sushi_path uses snake_case, which is inconsistent with the project's camelCase convention. Rename it to sushiPath for consistency.
function writeEnvironmentConfig(sushi_path: string) {

Comment thread vscode/extension/src/utilities/sqlmesh/sqlmesh.ts Outdated
Comment thread vscode/extension/src/utilities/sqlmesh/sqlmesh.ts
@benfdking benfdking force-pushed the tests_for_python_env branch from 718c81b to 044246c Compare June 19, 2025 14:04
@benfdking benfdking force-pushed the tests_for_python_env branch from 044246c to 40726e6 Compare June 19, 2025 14:09
@benfdking benfdking merged commit 461fb79 into main Jun 19, 2025
25 checks passed
@benfdking benfdking deleted the tests_for_python_env branch June 19, 2025 14:47
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.

3 participants