Skip to content

Commit

Permalink
Add example for embedding simple python scripts and debugging them us…
Browse files Browse the repository at this point in the history
…ing VSCode
  • Loading branch information
timfel committed Jan 8, 2025
1 parent 1958c9a commit 43f5daa
Show file tree
Hide file tree
Showing 25 changed files with 1,545 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/graalpy-script-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test GraalPy Scripts Guide
on:
push:
paths:
- 'graalpy/graalpy-scripts-debug/**'
- '.github/workflows/graalpy-scripts-debug.yml'
pull_request:
paths:
- 'graalpy/graalpy-scripts-debug/**'
- '.github/workflows/graalpy-scripts-debug.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
run:
name: 'graalpy-scripts-debug'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '23.0.1'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
- name: Build, test, and run 'graalpy-scripts-debug' using Maven
run: |
cd graalpy/graalpy-scripts-debug
./mvnw --no-transfer-progress test
- name: Build, test, and run 'graalpy-scripts-debug' using Gradle
run: |
cd graalpy/graalpy-scripts-debug
./gradlew test
12 changes: 12 additions & 0 deletions graalpy/graalpy-scripts-debug-guide/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

11 changes: 11 additions & 0 deletions graalpy/graalpy-scripts-debug-guide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

# Ignore maven build output directory
target

# Ignore JDTLS build directory
bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
6 changes: 6 additions & 0 deletions graalpy/graalpy-scripts-debug-guide/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.python",
"vscjava.vscode-java-pack"
]
}
8 changes: 8 additions & 0 deletions graalpy/graalpy-scripts-debug-guide/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"configurations": [{
"name": "GraalPy: Attach embedded",
"type": "debugpy",
"request": "attach",
"connect": { "host": "localhost", "port": 4711 },
}]
}
Loading

0 comments on commit 43f5daa

Please sign in to comment.