First time here? Check out the FAQ!
1

Checkers not running in venv/pipenv

When working on a project that was configured to use pipenv I found that the external checkers were all not running.

gadgetsteve's avatar
56
gadgetsteve
asked 2022-03-15 00:19:13 -0500
Wingware Support's avatar
4.1k
Wingware Support
updated 2022-03-30 15:12:28 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

On investigating I found that this was because the venv (created by pipenv) did not have the checkers pylint in my case installed as it was targeted as a minimal deliverable environment that was going to be built into windows executables.

Two possible solutions were found:

  1. pip install the checker into the venv *this was considered undesirable as it was "polluting" the build environment
  2. Modify the checker command to replace ${WING:PYTHON} with a command to run the system python at the same version as the venv used but with the checker installed.

The second option was selected but the user needs to be aware of a couple of potential "gotchas":

  1. You need to make sure that it is the same python as the venv
  2. You obviously need the checker installed in that python but also need to make sure that all of the other libraries provided in the venv are present and at the same version.
  3. When you add imports to the project files that are installed in your checker python but not in the venv then the checker is not going to complain and point this out to you.
gadgetsteve's avatar
56
gadgetsteve
answered 2022-03-15 00:31:54 -0500
edit flag offensive 0 remove flag delete link

Comments

Wing does by default assume that external checkers are going to be present in your env but you can set any command line in the checker configuration from the config area of the Code Warnings tool. In some cases I ended up using an env reference ${CHECKER_PYTHON} and setting the value for that in the Environment in Project Properties. But installing into the env is probably better. I think people typically solve the env "pollution" issue ]by having two difference requirements.txt or Pipfile setups for dev vs. production/shipping and adding things needed during development only to the dev version. It's not unusual that multiple additional packages are needed during development, building, or testing but not in production.

Wingware Support's avatar Wingware Support (2022-03-15 07:43:54 -0500) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer