Skip to content

acarmel/pylint-venv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pylint-venv

Pylint does not respect the currently activated virtualenv if it is not installed in every virtual environment individually. This module provides a Pylint init-hook to use the same Pylint installation with different virtual environments.

Installation

pip install pylint-venv

Add the following to your ~/.pylintrc:

init-hook=
    try: import pylint_venv
    except ImportError: pass
    else: pylint_venv.inithook()

The hook will then be used automatically if

  • a virtualenv is activated
  • a Conda environment is activated
  • no env is activated but your CWD contains a virtualenv in .venv

and if pylint is not installed in that env, too.

You can also call the hook via a command line argument:

$ pylint --init-hook="import pylint_venv; pylint_venv.inithook()"

This way you can also explicitly set an environment to be used:

$ pylint --init-hook="import pylint_venv; pylint_venv.inithook('$(pwd)/env')"

About

Make pylint respect virtualenvs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%