atom-community / atom-community/ide-python

Third-party module classes not detected when setting PYTHONPATH in a shell file

Đang mở
#380 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
good first issue
Ngôn ngữ chính
JavaScript
Star
238
Fork
40
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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:

![Screenshot from 2021-08-05 14-16-19](https://user-images.githubusercontent.com/14151550/128329783-65a92a33-58d1-48a3-b52f-95a082bbafb3.png)

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện việc không phát hiện được lớp GAMS bằng run.sh được cung cấp và so sánh các phiên bản package 1.9.3 và 1.9.4. Truy vết cách package gọi đường dẫn Python đã cấu hình và đọc PYTHONPATH. Công việc được xem là hoàn tất khi các lớp bên trong module gams được phát hiện lại khi sử dụng run.sh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
bash, javascript, python
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.