Ask Your Question
1

Checkers not running in venv/pipenv

asked 2022-03-15 00:19:13 -0600

updated 2022-03-30 15:12:28 -0600

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-15 00:31:54 -0600

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.
edit flag offensive delete link more

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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2022-03-15 00:19:13 -0600

Seen: 108 times

Last updated: Mar 15