atom-community / atom-community/ide-python
Third-party module classes not detected when setting PYTHONPATH in a shell file
- Vorherrschende Sprache
- JavaScript
- Sterne
- 238
- Forks
- 40
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I've defined a shell script inside the root of my project, called `run.sh`. What it does is, adds two paths relating to a third-party module (GAMS Python API), to `PYTHONPATH` environment variable, and then calls python with all arguments given to the script:
```bash
#!/bin/bash
export PYTHONPATH=/opt/gams/gams34.3_linux_x64_64_sfx/apifiles/Python/api_39/:"$PYTHONPATH"
export PYTHONPATH=/opt/gams/gams34.3_linux_x64_64_sfx/apifiles/Python/gams/:"$PYTHONPATH"
export PYTHONPATH="$(pwd)":"$PYTHONPATH"
python3 $@
```
In the package settings, I've configured the python path to `./run.sh`, for the script to be called and the module being detected by the package.
However, after updating the package version to 1.9.4, it no longer detects the classes inside the `gams` module:

Note that, _the script works perfectly with 1.9.3_. I downgraded the package and then upgraded it, and it seems it is reproducable for me.
(I don't think the system specs are needed, as I just mentioned, the issue is new in 1.9.4, with exact set of packages and Atom version)
Beitragsleitfaden
Rechercherichtung
Beginne damit, die fehlende Erkennung der GAMS-Klasse mit dem bereitgestellten run.sh zu reproduzieren und die Paketversionen 1.9.3 und 1.9.4 zu vergleichen. Verfolge, wie das Paket den konfigurierten Python-Pfad aufruft und PYTHONPATH liest. Die Aufgabe ist erfüllt, wenn Klassen innerhalb des gams-Moduls bei Verwendung von run.sh wieder erkannt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- bash, javascript, python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100