Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: codellm-devkit/python-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1.0-dev
Choose a base ref
...
head repository: codellm-devkit/python-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.2
Choose a head ref
  • 6 commits
  • 5 files changed
  • 1 contributor

Commits on Oct 17, 2024

  1. fix ipdb problem

    Rangeet Pan authored and Rangeet Pan committed Oct 17, 2024
    Copy the full SHA
    3aacf63 View commit details
  2. add the workflow

    Rangeet Pan authored and Rangeet Pan committed Oct 17, 2024
    Copy the full SHA
    9d392da View commit details
  3. pyproject.toml updated

    Rangeet Pan authored and Rangeet Pan committed Oct 17, 2024
    Copy the full SHA
    3428371 View commit details
  4. update

    Rangeet Pan authored and Rangeet Pan committed Oct 17, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    983ac5d View commit details
  5. fixing tree-sitter bug

    Rangeet Pan authored and Rangeet Pan committed Oct 17, 2024
    Copy the full SHA
    00b4866 View commit details
  6. fixing tree-sitter bug

    Rangeet Pan authored and Rangeet Pan committed Oct 17, 2024
    Copy the full SHA
    ac4dda8 View commit details
Showing with 1,000 additions and 899 deletions.
  1. +51 −0 .github/workflows/python-publish.yml
  2. +4 −3 cldk/models/java/models.py
  3. +3 −1 cldk/models/treesitter/models.py
  4. +938 −891 poetry.lock
  5. +4 −4 pyproject.toml
51 changes: 51 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow will upload a Python Package to PyPi when a Release is created
name: Publish Python Package

on:
release:
types: [published]

permissions:
contents: read

env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

jobs:
publish:
name: Publish to PyPi
runs-on: ubuntu-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Python package dependencies
run: |
poetry config virtualenvs.create false
poetry install --sync --no-interaction
- name: Inject the latest Code Analyzer JAR
run: |
CODE_ANALYZER_URL=$(curl -s https://api.github.com/repos/IBM/codenet-minerva-code-analyzer/releases/latest | jq -r '.assets[] | .browser_download_url')
echo "Downloading: " $CODE_ANALYZER_URL
wget -q $CODE_ANALYZER_URL
echo "Moving codeanalyzer.jar to:" ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/codeanalyzer.jar
mv codeanalyzer.jar ${{ github.workspace }}/cldk/analysis/java/codeanalyzer/jar/codeanalyzer.jar
- name: Build package
run: poetry build

- name: Publish package distributions to PyPI
run: poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD
7 changes: 4 additions & 3 deletions cldk/models/java/models.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import re
import json
from ipdb import set_trace
import re
from contextvars import ContextVar
from typing import Dict, List, Optional
from .constants_namespace import ConstantsNamespace

from pydantic import BaseModel, field_validator, model_validator

from .constants_namespace import ConstantsNamespace

constants = ConstantsNamespace()
context_concrete_class = ContextVar("context_concrete_class") # context var to store class concreteness

4 changes: 3 additions & 1 deletion cldk/models/treesitter/models.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,9 @@ class Capture:
name: str

def __init__(self, captures: List[Tuple[Node, str]]):
self.captures = [self.Capture(node=node, name=text) for node, text in captures]
self.captures = []
for capture_name, captures in captures.items():
self.captures = [self.Capture(node=node, name=capture_name) for node in captures]

def __getitem__(self, index: int) -> Capture:
"""Get the capture at the specified index.
Loading