Some out-of-the-box hooks for pre-commit
Find a file
Mike Miller 6448788ddc Force setuptools < 36.0.0 to avoid simplejson/six error
With the latest setuptools, pre-commit run fails with the following

[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/root/.pre-commit/repoDFpupm/py_env-default/bin/python2.7', u'/root/.pre-commit/repoDFpupm/py_env-default/bin/pip', 'install', '.')
Return code: 1
Expected return code: 0
Output:
    Processing /root/.pre-commit/repoDFpupm
    Collecting flake8!=2.5.3 (from pre-commit-hooks==0.7.1)
      Downloading flake8-3.3.0-py2.py3-none-any.whl (66kB)
    Collecting autopep8>=1.1 (from pre-commit-hooks==0.7.1)
      Downloading autopep8-1.3.2-py2.py3-none-any.whl (42kB)
    Collecting pyyaml (from pre-commit-hooks==0.7.1)
    Collecting simplejson (from pre-commit-hooks==0.7.1)
      Downloading simplejson-3.10.0.tar.gz (77kB)
    Collecting six (from pre-commit-hooks==0.7.1)
      Downloading six-1.10.0-py2.py3-none-any.whl
    Collecting enum34; python_version < "3.4" (from flake8!=2.5.3->pre-commit-hooks==0.7.1)
      Downloading enum34-1.1.6-py2-none-any.whl
    Collecting configparser; python_version < "3.2" (from flake8!=2.5.3->pre-commit-hooks==0.7.1)
      Downloading configparser-3.5.0.tar.gz
    Collecting pyflakes<1.6.0,>=1.5.0 (from flake8!=2.5.3->pre-commit-hooks==0.7.1)
      Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB)
    Collecting mccabe<0.7.0,>=0.6.0 (from flake8!=2.5.3->pre-commit-hooks==0.7.1)
      Downloading mccabe-0.6.1-py2.py3-none-any.whl
    Collecting pycodestyle<2.4.0,>=2.0.0 (from flake8!=2.5.3->pre-commit-hooks==0.7.1)
      Downloading pycodestyle-2.3.1-py2.py3-none-any.whl (45kB)
    Building wheels for collected packages: simplejson, configparser
      Running setup.py bdist_wheel for simplejson: started
      Running setup.py bdist_wheel for simplejson: finished with status 'error'
      Complete output from command /root/.pre-commit/repoDFpupm/py_env-default/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Kn9zYg/simplejson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpjj9RY8pip-wheel- --python-tag cp27:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/encoder.py -> build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/ordered_dict.py -> build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/scanner.py -> build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/decoder.py -> build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/compat.py -> build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/tool.py -> build/lib.linux-x86_64-2.7/simplejson
      copying simplejson/__init__.py -> build/lib.linux-x86_64-2.7/simplejson
      creating build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_decode.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_bitsize_int_as_string.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_speedups.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_default.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_errors.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_pass2.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_namedtuple.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_item_sort_key.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_check_circular.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_raw_json.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_for_json.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_float.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_tuple.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_subclass.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_unicode.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_dump.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_bigint_as_string.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_encode_basestring_ascii.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_decimal.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_encode_for_html.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_str_subclass.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_pass1.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_iterable.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_separators.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/__init__.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_tool.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_recursion.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_scanstring.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_fail.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_pass3.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      copying simplejson/tests/test_indent.py -> build/lib.linux-x86_64-2.7/simplejson/tests
      running build_ext
      building 'simplejson._speedups' extension
      creating build/temp.linux-x86_64-2.7
      creating build/temp.linux-x86_64-2.7/simplejson
      gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c simplejson/_speedups.c -o build/temp.linux-x86_64-2.7/simplejson/_speedups.o
      unable to execute 'gcc': No such file or directory
      ***************************************************************************
      WARNING: The C extension could not be compiled, speedups are not enabled.
      Failure information, if any, is above.
      I'm retrying the build without the C extension now.
      ***************************************************************************
      running bdist_wheel
      running build
      running build_py
      creating build/lib
      creating build/lib/simplejson
      copying simplejson/encoder.py -> build/lib/simplejson
      copying simplejson/ordered_dict.py -> build/lib/simplejson
      copying simplejson/scanner.py -> build/lib/simplejson
      copying simplejson/decoder.py -> build/lib/simplejson
      copying simplejson/compat.py -> build/lib/simplejson
      copying simplejson/tool.py -> build/lib/simplejson
      copying simplejson/__init__.py -> build/lib/simplejson
      creating build/lib/simplejson/tests
      copying simplejson/tests/test_decode.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_bitsize_int_as_string.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_speedups.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_default.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_errors.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_pass2.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_namedtuple.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_item_sort_key.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_check_circular.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_raw_json.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_for_json.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_float.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_tuple.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_subclass.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_unicode.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_dump.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_bigint_as_string.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_encode_basestring_ascii.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_decimal.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_encode_for_html.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_str_subclass.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_pass1.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_iterable.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_separators.py -> build/lib/simplejson/tests
      copying simplejson/tests/__init__.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_tool.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_recursion.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_scanstring.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_fail.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_pass3.py -> build/lib/simplejson/tests
      copying simplejson/tests/test_indent.py -> build/lib/simplejson/tests
      installing to build/bdist.linux-x86_64/wheel
      running install
      running install_lib
      creating build/bdist.linux-x86_64
      creating build/bdist.linux-x86_64/wheel
      creating build/bdist.linux-x86_64/wheel/simplejson
      copying build/lib/simplejson/encoder.py -> build/bdist.linux-x86_64/wheel/simplejson
      copying build/lib/simplejson/ordered_dict.py -> build/bdist.linux-x86_64/wheel/simplejson
      copying build/lib/simplejson/scanner.py -> build/bdist.linux-x86_64/wheel/simplejson
      copying build/lib/simplejson/decoder.py -> build/bdist.linux-x86_64/wheel/simplejson
      copying build/lib/simplejson/compat.py -> build/bdist.linux-x86_64/wheel/simplejson
      copying build/lib/simplejson/tool.py -> build/bdist.linux-x86_64/wheel/simplejson
      creating build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_decode.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_bitsize_int_as_string.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_speedups.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_default.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_errors.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_pass2.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_namedtuple.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_item_sort_key.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_check_circular.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_raw_json.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_for_json.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_float.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_tuple.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_subclass.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_unicode.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_dump.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_bigint_as_string.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_encode_basestring_ascii.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_decimal.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_encode_for_html.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_str_subclass.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_pass1.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_iterable.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_separators.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/__init__.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_tool.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_recursion.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_scanstring.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_fail.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_pass3.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/tests/test_indent.py -> build/bdist.linux-x86_64/wheel/simplejson/tests
      copying build/lib/simplejson/__init__.py -> build/bdist.linux-x86_64/wheel/simplejson
      running install_egg_info
      running egg_info
      writing simplejson.egg-info/PKG-INFO
      writing top-level names to simplejson.egg-info/top_level.txt
      writing dependency_links to simplejson.egg-info/dependency_links.txt
      reading manifest file 'simplejson.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file 'simplejson.egg-info/SOURCES.txt'
      Copying simplejson.egg-info to build/bdist.linux-x86_64/wheel/simplejson-3.10.0-py2.7.egg-info
      running install_scripts
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-build-Kn9zYg/simplejson/setup.py", line 121, in <module>
          run_setup(False)
        File "/tmp/pip-build-Kn9zYg/simplejson/setup.py", line 108, in run_setup
          **kw)
        File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
          dist.run_commands()
        File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 215, in run
          self.run_command('install')
        File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/usr/local/lib/python2.7/distutils/command/install.py", line 575, in run
          self.run_command(cmd_name)
        File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
          import setuptools.command.easy_install as ei
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
          from setuptools.py27compat import rmtree_safe
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
          import six
      ImportError: No module named six

      ----------------------------------------
      Running setup.py clean for simplejson
      Running setup.py bdist_wheel for configparser: started
      Running setup.py bdist_wheel for configparser: finished with status 'error'
      Complete output from command /root/.pre-commit/repoDFpupm/py_env-default/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Kn9zYg/configparser/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpx2UVJJpip-wheel- --python-tag cp27:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      copying src/configparser.py -> build/lib
      creating build/lib/backports
      copying src/backports/__init__.py -> build/lib/backports
      creating build/lib/backports/configparser
      copying src/backports/configparser/helpers.py -> build/lib/backports/configparser
      copying src/backports/configparser/__init__.py -> build/lib/backports/configparser
      running egg_info
      writing src/configparser.egg-info/PKG-INFO
      writing namespace_packages to src/configparser.egg-info/namespace_packages.txt
      writing top-level names to src/configparser.egg-info/top_level.txt
      writing dependency_links to src/configparser.egg-info/dependency_links.txt
      reading manifest file 'src/configparser.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file 'src/configparser.egg-info/SOURCES.txt'
      installing to build/bdist.linux-x86_64/wheel
      running install
      running install_lib
      copying configparser.py -> build/bdist.linux-x86_64/wheel
      Skipping installation of build/bdist.linux-x86_64/wheel/backports/__init__.py (namespace package)
      copying backports/configparser/helpers.py -> build/bdist.linux-x86_64/wheel/backports/configparser
      copying backports/configparser/__init__.py -> build/bdist.linux-x86_64/wheel/backports/configparser
      running install_egg_info
      Copying src/configparser.egg-info to build/bdist.linux-x86_64/wheel/configparser-3.5.0-py2.7.egg-info
      Installing build/bdist.linux-x86_64/wheel/configparser-3.5.0-py2.7-nspkg.pth
      running install_scripts
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-build-Kn9zYg/configparser/setup.py", line 63, in <module>
          'Topic :: Software Development :: Libraries :: Python Modules',
        File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
          dist.run_commands()
        File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 215, in run
          self.run_command('install')
        File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/usr/local/lib/python2.7/distutils/command/install.py", line 575, in run
          self.run_command(cmd_name)
        File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
          cmd_obj.run()
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
          import setuptools.command.easy_install as ei
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
          from setuptools.py27compat import rmtree_safe
        File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
          import six
      ImportError: No module named six

      ----------------------------------------
      Running setup.py clean for configparser
    Failed to build simplejson configparser
    Installing collected packages: enum34, configparser, pyflakes, mccabe, pycodestyle, flake8, autopep8, pyyaml, simplejson, six, pre-commit-hooks
      Running setup.py install for configparser: started
        Running setup.py install for configparser: finished with status 'error'
        Complete output from command /root/.pre-commit/repoDFpupm/py_env-default/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Kn9zYg/configparser/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LnaZWh-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.pre-commit/repoDFpupm/py_env-default/include/site/python2.7/configparser:
        running install
        running build
        running build_py
        creating build
        creating build/lib
        copying src/configparser.py -> build/lib
        creating build/lib/backports
        copying src/backports/__init__.py -> build/lib/backports
        creating build/lib/backports/configparser
        copying src/backports/configparser/helpers.py -> build/lib/backports/configparser
        copying src/backports/configparser/__init__.py -> build/lib/backports/configparser
        running egg_info
        writing src/configparser.egg-info/PKG-INFO
        writing namespace_packages to src/configparser.egg-info/namespace_packages.txt
        writing top-level names to src/configparser.egg-info/top_level.txt
        writing dependency_links to src/configparser.egg-info/dependency_links.txt
        reading manifest file 'src/configparser.egg-info/SOURCES.txt'
        reading manifest template 'MANIFEST.in'
        writing manifest file 'src/configparser.egg-info/SOURCES.txt'
        running install_lib
        copying configparser.py -> /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages
        Skipping installation of /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/backports/__init__.py (namespace package)
        copying backports/configparser/helpers.py -> /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/backports/configparser
        copying backports/configparser/__init__.py -> /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/backports/configparser
        byte-compiling /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/configparser.py to configparser.pyc
        byte-compiling /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/backports/configparser/helpers.py to helpers.pyc
        byte-compiling /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/backports/configparser/__init__.py to __init__.pyc
        running install_egg_info
        Copying src/configparser.egg-info to /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/configparser-3.5.0-py2.7.egg-info
        Installing /root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/configparser-3.5.0-py2.7-nspkg.pth
        running install_scripts
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-build-Kn9zYg/configparser/setup.py", line 63, in <module>
            'Topic :: Software Development :: Libraries :: Python Modules',
          File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
            dist.run_commands()
          File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
            self.run_command(cmd)
          File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
            cmd_obj.run()
          File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
            return orig.install.run(self)
          File "/usr/local/lib/python2.7/distutils/command/install.py", line 575, in run
            self.run_command(cmd_name)
          File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
            cmd_obj.run()
          File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
            import setuptools.command.easy_install as ei
          File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
            from setuptools.py27compat import rmtree_safe
          File "/root/.pre-commit/repoDFpupm/py_env-default/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
            import six
        ImportError: No module named six

        ----------------------------------------

Errors:
      Failed building wheel for simplejson
      Failed building wheel for configparser
    Command "/root/.pre-commit/repoDFpupm/py_env-default/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Kn9zYg/configparser/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LnaZWh-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.pre-commit/repoDFpupm/py_env-default/include/site/python2.7/configparser" failed with error code 1 in /tmp/pip-build-Kn9zYg/configparser/
2017-06-01 10:57:57 +03:00
pre_commit_hooks Update debug_statement_hook.py 2016-06-20 09:41:22 +02:00
testing Merge pull request #120 from sanmai-NL/JSON_arbitrary_indentation_separator 2016-06-12 10:25:59 -07:00
tests Merge pull request #120 from sanmai-NL/JSON_arbitrary_indentation_separator 2016-06-12 10:25:59 -07:00
.coveragerc Teach check-large-files-added about git-lfs. Reslves #82. 2015-12-28 05:38:06 -08:00
.gitignore Update pre-commit config. 2014-06-05 09:23:49 -07:00
.pre-commit-config.yaml Run pre-commit during test 2015-12-25 09:42:17 -08:00
.travis.yml Style fixups 2016-04-14 08:25:52 -07:00
appveyor.yml Run pre-commit during test 2015-12-25 09:42:17 -08:00
CHANGELOG v0.5.1 2016-05-16 09:12:32 -07:00
get-git-lfs.py Teach check-large-files-added about git-lfs. Reslves #82. 2015-12-28 05:38:06 -08:00
hooks.yaml Add file patterns for trailing whitespace fixer 2016-06-27 20:20:20 +02:00
LICENSE MIT 2014-06-05 08:58:48 -07:00
Makefile Run pre-commit during test 2015-12-25 09:42:17 -08:00
pylintrc Implement Markdown trailing space line break preservation 2015-05-11 08:52:32 +02:00
README.md Add a --remove option to fix-encoding-pragma 2016-04-27 11:18:14 -07:00
requirements-dev.txt Allow six to bump 2015-06-17 11:49:19 -07:00
setup.py Force setuptools < 36.0.0 to avoid simplejson/six error 2017-06-01 10:57:57 +03:00
tox.ini Style fixups 2016-04-14 08:25:52 -07:00

Build Status Coverage Status Build status

pre-commit-hooks

Some out-of-the-box hooks for pre-commit.

See also: https://github.com/pre-commit/pre-commit

Using pre-commit-hooks with pre-commit

Add this to your .pre-commit-config.yaml

-   repo: git://github.com/pre-commit/pre-commit-hooks
    sha: ''  # Use the sha you want to point at
    hooks:
    -   id: trailing-whitespace
    # -   id: ...

Hooks available

  • autopep8-wrapper - Runs autopep8 over python source.
    • Ignore PEP 8 violation types with args: ['-i', '--ignore=E000,...'] or through configuration of the [pep8] section in setup.cfg / tox.ini.
  • check-added-large-files - Prevent giant files from being committed.
    • Specify what is "too large" with args: ['--maxkb=123'] (default=500kB).
  • check-ast - Simply check whether files parse as valid python.
  • check-byte-order-marker - Forbid files which have a UTF-8 byte-order marker
  • check-case-conflict - Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
  • check-docstring-first - Checks for a common error of placing code before the docstring.
  • check-json - Attempts to load all json files to verify syntax.
  • check-merge-conflict - Check for files that contain merge conflict strings.
  • check-symlinks - Checks for symlinks which do not point to anything.
  • check-xml - Attempts to load all xml files to verify syntax.
  • check-yaml - Attempts to load all yaml files to verify syntax.
  • debug-statements - Check for pdb / ipdb / pudb statements in code.
  • detect-aws-credentials - Checks for the existence of AWS secrets that you have set up with the AWS CLI.
  • detect-private-key - Checks for the existence of private keys.
  • double-quote-string-fixer - This hook replaces double quoted strings with single quoted strings.
  • end-of-file-fixer - Makes sure files end in a newline and only a newline.
  • fix-encoding-pragma - Add # -*- coding: utf-8 -*- to the top of python files.
    • To remove the coding pragma pass --remove (useful in a python3-only codebase)
  • flake8 - Run flake8 on your python files.
  • name-tests-test - Assert that files in tests/ end in _test.py.
    • Use args: ['--django'] to match test*.py instead.
  • pyflakes - Run pyflakes on your python files.
  • pretty-format-json - Checks that all your JSON files are pretty
    • Use args: ['--autofix'] to automatically fixing the encountered not-pretty-formatted files and args: ['--no-sort-keys'] to disable the sort on the keys.
  • requirements-txt-fixer - Sorts entries in requirements.txt
  • trailing-whitespace - Trims trailing whitespace.
    • Markdown linebreak trailing spaces preserved for .md and.markdown; use args: ['--markdown-linebreak-ext=txt,text'] to add other extensions, args: ['--markdown-linebreak-ext=*'] to preserve them for all files, or args: ['--no-markdown-linebreak-ext'] to disable and always trim.

As a standalone package

If you'd like to use these hooks, they're also available as a standalone package.

Simply pip install pre-commit-hooks