Skip to content

scip-python index fatally errors when using 3.10 stdlib features #168

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

Open
kevinxu12 opened this issue Apr 21, 2025 · 1 comment
Open

scip-python index fatally errors when using 3.10 stdlib features #168

kevinxu12 opened this issue Apr 21, 2025 · 1 comment

Comments

@kevinxu12
Copy link

kevinxu12 commented Apr 21, 2025

The scip-python index command is fatally crashing on our python repository.

Minimal Error Repro

ParamSpec is available in the standard typing module post 3.10

from typing import ParamSpec
from collections.abc import Callable

P = ParamSpec("P")

def decorator(func: Callable[P, None]) -> Callable[P, None]:
    pass

class BaseFactory:
    @classmethod
    @decorator
    def create(cls, *args, **kwargs):
        return super().create(*args, **kwargs)

class ChildFactory(BaseFactory):
    @classmethod
    def create(cls, *args, **kwargs):
        return super().create(*args, **kwargs)

Command:

npx @sourcegraph/scip-python index --cwd ${pathToIndexRoot} --output ${scipFile}

Environment:

Python 3.10.17

Actual error:

Experienced Fatal Error While Indexing:\nPlease create an issue at github.com/sourcegraph/scip-python: {\n  currentFilepath: '/Users/kevinxu/Documents/work/detail/packages/codetools/src/test_data/sample_python_repo/factories/deployment.py',\n  error: TypeError: Cannot read properties of undefined (reading 'node')\n      at L.getFunctionRelationships (/Users/kevinxu/Documents/work/detail/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:83363)\n      at L.visitFunction (/Users/kevinxu/Documents/work/detail/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/

Thought

  • Do we need to re-sync the typeshed-fallback stubs (they haven't been updated in 2 years)?
Copy link

linear bot commented Apr 21, 2025

@kevinxu12 kevinxu12 changed the title scip-python index fatally errors when using newer python stdlib features scip-python index fatally errors when using 3.10 stdlib features Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant