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

Implement default problem matcher and task for running Python files. #23953

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
974dd83
Show dummy task
anthonykim1 Aug 16, 2024
f8344df
why isnt the problem matcher getting picked up
anthonykim1 Aug 16, 2024
c1a66cc
comments
anthonykim1 Aug 16, 2024
fd594d9
still cant access problem matcher
anthonykim1 Aug 16, 2024
496e351
cannot access problem matcher when it works by itself when in task.json
anthonykim1 Aug 16, 2024
1bcb272
remove runTask activation event
anthonykim1 Aug 26, 2024
c38c0f0
make file for task problem matcher
anthonykim1 Sep 10, 2024
81be0a9
need to change from hard-coded file to current open Python
anthonykim1 Sep 10, 2024
26b7d80
Trigger Task => Real Task to set up to get current active .py file
anthonykim1 Sep 10, 2024
294e4e4
add TODO. Need to get executable and python file info
anthonykim1 Sep 12, 2024
c803307
many TODOs
anthonykim1 Sep 12, 2024
73302c8
no way to get terminalService
anthonykim1 Sep 12, 2024
d5a6809
TODO: figure out how to get terminalShellType without terminalService
anthonykim1 Sep 13, 2024
bb0b9b4
progress on getting terminalShellType
anthonykim1 Sep 13, 2024
4121701
matching binding found for serviceIdentifier ICodeExecutionService
anthonykim1 Sep 13, 2024
d1d3ad7
might have to implement terminalCodeExecution from scratch
anthonykim1 Sep 13, 2024
5150e7f
have to implement codeExecutionService without injection
anthonykim1 Sep 13, 2024
eddd5c6
need to test if it works after figuring out python vs.pylance error
anthonykim1 Sep 13, 2024
1641506
Fix telemetry not getting picked up for Terminal REPL (#23958)
anthonykim1 Aug 16, 2024
092f5f0
Fix execInREPL Enter to respect complete expression (#23973)
anthonykim1 Aug 19, 2024
7916213
Add GDPR comment for `repltype` (#23974)
cwebster-99 Aug 19, 2024
71794f5
Additional graceful handling for pixi (#23942)
anthonykim1 Aug 20, 2024
9e44466
Do not truncate whitespace for multi-line string (#23977)
anthonykim1 Aug 20, 2024
06ef77e
Handle poetry env manager from native locator (#23983)
DonJayamanne Aug 21, 2024
5b86f99
Update to latest lsp for pull diagnostics (#23979)
rchiodo Aug 23, 2024
1c89714
Bump importlib-metadata from 8.1.0 to 8.4.0 (#23980)
dependabot[bot] Aug 26, 2024
1a68554
Bump elliptic from 6.5.4 to 6.5.7 (#23986)
dependabot[bot] Aug 26, 2024
fedbf81
Fix stop sending double telemetry for Terminal REPL (#23995)
anthonykim1 Aug 26, 2024
e2b2c21
Correctly track native REPL state (#23997)
anthonykim1 Aug 26, 2024
b0a11c9
Version updates for Python Extension Release 2024.14.0 (#24040)
karthiknadig Sep 3, 2024
0539b1e
Update `main` to next pre-release version (#24043)
karthiknadig Sep 3, 2024
dce3d09
fix django manage.py path validation (#24019)
eleanorjboyd Sep 3, 2024
0c0d371
Fix failing multiroot test (#24049)
rchiodo Sep 4, 2024
b2b53d3
Remove use of mocked output channel in virtual workspace (#24051)
karthiknadig Sep 4, 2024
34d9253
switch to using temp file for test_ids (#24054)
eleanorjboyd Sep 5, 2024
72ecad7
Download `pet` from azure pipeline build (#24052)
karthiknadig Sep 5, 2024
b12cf87
Better messaging for tests output in virtual or untrusted scenario (#…
karthiknadig Sep 6, 2024
ece255a
Stable extension builds using `pet` from Azure Feed (#24063)
karthiknadig Sep 6, 2024
c570547
Update engine version to match LSP client (#24065)
rchiodo Sep 9, 2024
127da14
Revert "Do not truncate whitespace for multi-line string" (#24096)
anthonykim1 Sep 11, 2024
14bb14b
Switch over to executeCommand from sendText (#24078)
anthonykim1 Sep 12, 2024
878d60a
Add `uv.lock` to file associations (#23991)
edgarrmondragon Sep 13, 2024
9bc0813
Enable proposed APIs for `codeActionAI` (#24108)
StellaHuang95 Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"no-control-regex": "off",
"no-extend-native": "off",
"no-multi-str": "off",
"no-shadow": "off",
"no-param-reassign": "off",
"no-prototype-builtins": "off",
"no-restricted-syntax": [
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/smoke-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:

# Bits from the VSIX are reused by smokeTest.ts to speed things up.
- name: Download VSIX
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact_name }}

Expand Down
3 changes: 3 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"env": {
"VSC_PYTHON_CI_TEST_GREP": "" // Modify this to run a subset of the single workspace tests
},
"sourceMaps": true,
"smartStep": true,
"outFiles": ["${workspaceFolder}/out/**/*", "!${workspaceFolder}/**/node_modules**/*"],
Expand Down
46 changes: 24 additions & 22 deletions build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extends:
ghCreateTag: false
standardizedVersioning: true
l10nSourcePaths: ./src/client
needsTools: true

buildPlatforms:
- name: Linux
Expand Down Expand Up @@ -98,27 +97,30 @@ extends:
- script: npx gulp prePublishBundle
displayName: Build

- script: nox --session azure_pet_checkout
displayName: Checkout python-environment-tools
env:
PYTHON_ENV_TOOLS_DEST: $(Build.SourcesDirectory)
PYTHON_ENV_TOOLS_REF: main
PYTHON_ENV_TOOLS_TEMP: $(Agent.TempDirectory)

- script: nox --session azure_pet_build_before
displayName: Enable cargo config for azure

- template: azure-pipelines/extension/templates/steps/build-extension-rust-package.yml@templates
parameters:
vsceTarget: $(vsceTarget)
binaryName: pet
signing: true
workingDirectory: $(Build.SourcesDirectory)/python-env-tools
buildWasm: false
runTest: false

- script: nox --session azure_pet_build_after
displayName: Move bin to final location
- bash: |
mkdir -p $(Build.SourcesDirectory)/python-env-tools/bin
chmod +x $(Build.SourcesDirectory)/python-env-tools/bin
displayName: Make Directory for python-env-tool binary

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: 'Monaco'
definition: 591
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/main'
targetPath: '$(Build.SourcesDirectory)/python-env-tools/bin'
artifactName: 'bin-$(vsceTarget)'
itemPattern: |
pet.exe
pet
ThirdPartyNotices.txt

- bash: |
ls -lf ./python-env-tools/bin
chmod +x ./python-env-tools/bin/pet*
ls -lf ./python-env-tools/bin
displayName: Set chmod for pet binary

- script: python -c "import shutil; shutil.rmtree('.nox', ignore_errors=True)"
displayName: Clean up Nox
Expand Down
45 changes: 24 additions & 21 deletions build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,30 @@ extends:
- script: npx gulp prePublishBundle
displayName: Build

- script: nox --session azure_pet_checkout
displayName: Checkout python-environment-tools
env:
PYTHON_ENV_TOOLS_DEST: $(Build.SourcesDirectory)
PYTHON_ENV_TOOLS_REF: release/2024.12
PYTHON_ENV_TOOLS_TEMP: $(Agent.TempDirectory)

- script: nox --session azure_pet_build_before
displayName: Enable cargo config for azure

- template: azure-pipelines/extension/templates/steps/build-extension-rust-package.yml@templates
parameters:
vsceTarget: $(vsceTarget)
binaryName: pet
signing: true
workingDirectory: $(Build.SourcesDirectory)/python-env-tools
buildWasm: false
runTest: false

- script: nox --session azure_pet_build_after
displayName: Move bin to final location
- bash: |
mkdir -p $(Build.SourcesDirectory)/python-env-tools/bin
chmod +x $(Build.SourcesDirectory)/python-env-tools/bin
displayName: Make Directory for python-env-tool binary

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: 'Monaco'
definition: 593
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/release/2024.14'
targetPath: '$(Build.SourcesDirectory)/python-env-tools/bin'
artifactName: 'bin-$(vsceTarget)'
itemPattern: |
pet.exe
pet
ThirdPartyNotices.txt

- bash: |
ls -lf ./python-env-tools/bin
chmod +x ./python-env-tools/bin/pet*
ls -lf ./python-env-tools/bin
displayName: Set chmod for pet binary

- script: python -c "import shutil; shutil.rmtree('.nox', ignore_errors=True)"
displayName: Clean up Nox
Expand Down
74 changes: 1 addition & 73 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def delete_dir(path: pathlib.Path, ignore_errors=None):

shutil.rmtree(os.fspath(path))


@nox.session()
def install_python_libs(session: nox.Session):
requirements = [
Expand Down Expand Up @@ -63,79 +64,6 @@ def install_python_libs(session: nox.Session):
if pathlib.Path("./python_files/lib/temp").exists():
shutil.rmtree("./python_files/lib/temp")

@nox.session()
def azure_pet_checkout(session: nox.Session):
branch = os.getenv("PYTHON_ENV_TOOLS_REF", "main")

# dest dir should be <vscode-python repo root>/python-env-tools
dest_dir = (pathlib.Path(os.getenv("PYTHON_ENV_TOOLS_DEST")) / "python-env-tools").resolve()

# temp dir should be <agent temp dir>
temp_dir = (pathlib.Path(os.getenv("PYTHON_ENV_TOOLS_TEMP")) / "python-env-tools").resolve()
session.log(f"Cloning python-environment-tools to {temp_dir}")
temp_dir.mkdir(0o766, parents=True, exist_ok=True)

try:
with session.cd(temp_dir):
session.run("git", "init", external=True)
session.run(
"git",
"remote",
"add",
"origin",
"https://github.com/microsoft/python-environment-tools",
external=True,
)
session.run("git", "fetch", "origin", branch, external=True)
session.run(
"git", "checkout", "--force", "-B", branch, f"origin/{branch}", external=True
)
delete_dir(temp_dir / ".git")
delete_dir(temp_dir / ".github")
delete_dir(temp_dir / ".vscode")
(temp_dir / "CODE_OF_CONDUCT.md").unlink()
shutil.move(os.fspath(temp_dir), os.fspath(dest_dir))
except PermissionError as e:
print(f"Permission error: {e}")
if not dest_dir.exists():
raise
finally:
delete_dir(temp_dir, ignore_errors=True)


@nox.session()
def azure_pet_build_before(session: nox.Session):
source_dir = pathlib.Path(pathlib.Path.cwd() / "python-env-tools").resolve()
config_toml_disabled = source_dir / ".cargo" / "config.toml.disabled"
config_toml = source_dir / ".cargo" / "config.toml"
if config_toml_disabled.exists() and not config_toml.exists():
config_toml.write_bytes(config_toml_disabled.read_bytes())


@nox.session()
def azure_pet_build_after(session: nox.Session):
source_dir = pathlib.Path(pathlib.Path.cwd() / "python-env-tools").resolve()
ext = sysconfig.get_config_var("EXE") or ""
bin_name = f"pet{ext}"

abs_bin_path = None
for root, _, files in os.walk(os.fspath(source_dir / "target")):
bin_path = pathlib.Path(root) / "release" / bin_name
if bin_path.exists():
abs_bin_path = bin_path.absolute()
break

assert abs_bin_path

dest_dir = pathlib.Path(pathlib.Path.cwd() / "python-env-tools").resolve()
if not pathlib.Path(dest_dir / "bin").exists():
pathlib.Path(dest_dir / "bin").mkdir()
bin_dest = dest_dir / "bin" / bin_name
shutil.copyfile(abs_bin_path, bin_dest)

if sys.platform != "win32":
os.chmod(os.fspath(bin_dest), 0o755)


@nox.session()
def native_build(session: nox.Session):
Expand Down
Loading
Loading