Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pkg_resources instead of importlib_metadata to get installed version #935

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pre_commit/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import importlib_metadata # TODO: importlib.metadata py38?
import pkg_resources

CONFIG_FILE = '.pre-commit-config.yaml'
MANIFEST_FILE = '.pre-commit-hooks.yaml'
Expand All @@ -18,7 +18,7 @@
# Bump when modifying `empty_template`
LOCAL_REPO_VERSION = '1'

VERSION = importlib_metadata.version('pre_commit')
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')
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
'aspy.yaml',
'cfgv>=1.4.0',
'identify>=1.0.0',
# if this makes it into python3.8 move to extras_require
'importlib-metadata',
'nodeenv>=0.11.1',
'pyyaml',
'six',
Expand Down