Created
March 11, 2018 23:23
-
-
Save absurd/04a57c863b4df18e6b557b51d8ad6bc7 to your computer and use it in GitHub Desktop.
bin/pylint virtualenv load plugins kludge v1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/you/.virtualenvs/yourproject/bin/python3.6 | |
# -*- coding: utf-8 -*- | |
import re | |
import sys | |
from pip.operations.freeze import freeze | |
from pylint import run_pylint | |
if __name__ == '__main__': | |
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | |
if any(['pylint-django' in x for x in freeze()]): | |
sys.argv += ['--load-plugins', 'pylint_django'] | |
sys.exit(run_pylint()) | |
# cute but quickly supplanted by virtualenvwraper postmkvirtualenv hook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment