leinardi / pylint-pycharm

A plugin providing both real-time and on-demand scanning of Python files with PyLint from within PyCharm/IDEA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin Doesn't Use Interpreter's PYTHONPATH

JonnoFTW opened this issue · comments

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.14.0
  • PyCharm/IDEA version: 2021.3.2 Professional Edition
  • Pylint version: 2.12.2

Step 3: Describe the problem:

Pylint plugin does not set PYTHONATH when running pylint. import-error will be returned for lines that would normally work because they are set in the project interpreter's custom PYTHONPATH. A typical use case is when I am using a git submodule and want to import code from it.

The plugin also does not give a way to manually pass environment variables to the pylint call

Steps to reproduce:

  1. Include code in subdirectory of project, eg. lib
  2. Add lib to pythonpath of interpreter: File -> Settings -> Project -> Python Interpreter -> Cog Icon -> Show All -> Show Paths (last icon in the top bar) -> + Icon -> Select Path of lib. Save settings
  3. Run pylint plugin
  4. You will get import errors for modules in lib

Observed Results:

  • Import Errors are returned (the swagger_client folder is under api_test/lib in the below screenshots)

image

image

Expected Results:

  • No import errors