Skip to main content

pylint-venv provides a Pylint init-hook to use the same Pylint installation with different virtual environments.

Project description

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')"

If pylint itself is installed in a virtualenv, then you can ignore it by passing force_venv_activation=True to force the activation of a different virtualenv:

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

This will try to automatically detect virtualenv and activate it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylint-venv-2.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylint_venv-2.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pylint-venv-2.1.0.tar.gz.

File metadata

  • Download URL: pylint-venv-2.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.6

File hashes

Hashes for pylint-venv-2.1.0.tar.gz
Algorithm Hash digest
SHA256 0dfe4839029ece117c2fd3509990fd372dc1e6ae3f275f4edcc2fab1b4901aed
MD5 9c58d160a07ae1de769fafe025fd4598
BLAKE2b-256 c126ddd13886dc5dd424fa7780e48e744980e26f9efdb372aee55982651ed328

See more details on using hashes here.

File details

Details for the file pylint_venv-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pylint_venv-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.6

File hashes

Hashes for pylint_venv-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9232dc941a0457372758454b0cb9ad44b0e8a4374b1ed9b8b9ad3d2cd24c557
MD5 0f66772916a61d8607831e6e7301929f
BLAKE2b-256 6733bc81a932abaab09fefb774e1bcf269e1bae2887000b7ad60c714b4c54c4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page