Skip to content

Commit

Permalink
Merge pull request pre-commit#1176 from pre-commit/importlib_metadata…
Browse files Browse the repository at this point in the history
…_py38

Use importlib.metadata directly in python3.8+
  • Loading branch information
asottile authored Oct 17, 2019
2 parents b3582df + f8f81db commit 4bd6529
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
displayName: install swift
- template: job--python-tox.yml@asottile
parameters:
toxenvs: [pypy, pypy3, py27, py36, py37]
toxenvs: [pypy, pypy3, py27, py36, py37, py38]
os: linux
pre_test:
- task: UseRubyVersion@0
Expand Down
7 changes: 6 additions & 1 deletion pre_commit/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from __future__ import absolute_import
from __future__ import unicode_literals

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

if sys.version_info < (3, 8): # pragma: no cover (<PY38)
import importlib_metadata
else: # pragma: no cover (PY38+)
import importlib.metadata as importlib_metadata

CONFIG_FILE = '.pre-commit-config.yaml'
MANIFEST_FILE = '.pre-commit-hooks.yaml'
Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ classifiers =
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy

Expand All @@ -27,15 +27,15 @@ install_requires =
aspy.yaml
cfgv>=2.0.0
identify>=1.0.0
importlib-metadata
nodeenv>=0.11.1
pyyaml
six
toml
virtualenv>=15.2
futures; python_version<"3.2"
importlib-resources; python_version<"3.7"
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
futures;python_version<"3.2"
importlib-metadata;python_version<"3.8"
importlib-resources;python_version<"3.7"
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*

[options.entry_points]
console_scripts =
Expand Down

0 comments on commit 4bd6529

Please sign in to comment.