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

Indexing trivial Python project fails since version v0.5.0 #158

Open
gloin01 opened this issue Sep 12, 2024 · 0 comments
Open

Indexing trivial Python project fails since version v0.5.0 #158

gloin01 opened this issue Sep 12, 2024 · 0 comments

Comments

@gloin01
Copy link

gloin01 commented Sep 12, 2024

I'm currently trying to generate SCIP files for different languages and found that trying to index a simple Hello World project in python fails with the current version of this tool (v0.6.0) and v0.5.0, but works in version v0.4.2. And I'm also able to index a more complex project in the current version, which contains a pyproject.toml and much other stuff.

currentFilepath: '/app/main.py',
error: TypeError: Cannot read properties of undefined (reading 'indexOf')
[...]
at /usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:27427
at Array.forEach ()

To replicate:

  • Create an new directory and inside it create a main.py file with the following content:
# main.py

def main() -> None:
    print('Hello World')

if __name__ == "__main__":
    main()
  • Run docker run -it -v *insert path to directory*:/app sourcegraph/scip-python:v0.6.0
  • cd /app/
  • scip-python index

When doing this I get the following log:

C:\Users\***>docker run -it -v C:\Users\****\PythonSimple:/app sourcegraph/scip-python:v0.6.0
/ # cd app/
/app # scip-python index
No configuration file found.
No pyproject.toml file found.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Total Project Files 1
(07:44:11) Indexing /app with version undefined
(07:44:11) Evaluating python environment dependencies

[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: pip install --upgrade pip
(07:44:11)   Gathering environment information from `pip`
(07:44:12)   Analyzing dependencies
(07:44:12) Parse and search for dependencies
(07:44:12) Index workspace and track project files
(07:44:12) Analyze project and dependencies
(07:44:12) Parse and emit SCIP


Experienced Fatal Error While Indexing:
Please create an issue at github.com/sourcegraph/scip-python: {
  currentFilepath: '/app/main.py',
  error: TypeError: Cannot read properties of undefined (reading 'indexOf')
      at r (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:8675)
      at Function.package (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:8581)
      at o (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:77650)
      at Object.t.makeModuleInit (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:77976)
      at L.visitModule (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:81422)
      at L.visit (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:321967)
      at L.visitNode (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:326774)
      at L.walk (/usr/local/lib/node_modules/@sourcegraph/scip-python/dist/pyright-internal.js:1:326653)
      at /usr/local/lib/node_modules/@sourcegraph/scip-python/dist/scip-python.js:1:27427
      at Array.forEach (<anonymous>)
}
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