pre-commit/pre_commit/constants.py
Steven Loria d3c2d7cbe2
Use pkg_resources instead of importlib_metadata to get installed version
Removes importlib-metadata as a dependency.
pkg_resources ships with setuptools, so it should be available
in every reasonably-modern Python environment.
2019-02-03 12:54:54 -05:00

26 lines
681 B
Python

from __future__ import absolute_import
from __future__ import unicode_literals
import pkg_resources
CONFIG_FILE = '.pre-commit-config.yaml'
MANIFEST_FILE = '.pre-commit-hooks.yaml'
YAML_DUMP_KWARGS = {
'default_flow_style': False,
# Use unicode
'encoding': None,
'indent': 4,
}
# Bump when installation changes in a backwards / forwards incompatible way
INSTALLED_STATE_VERSION = '1'
# Bump when modifying `empty_template`
LOCAL_REPO_VERSION = '1'
VERSION = str(pkg_resources.get_distribution('pre-commit').parsed_version)
# `manual` is not invoked by any installed git hook. See #719
STAGES = ('commit', 'commit-msg', 'manual', 'push')
DEFAULT = 'default'