mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Merge pull request #1176 from pre-commit/importlib_metadata_py38
Use importlib.metadata directly in python3.8+
This commit is contained in:
commit
4bd6529c05
3 changed files with 12 additions and 7 deletions
|
|
@ -36,7 +36,7 @@ jobs:
|
||||||
displayName: install swift
|
displayName: install swift
|
||||||
- template: job--python-tox.yml@asottile
|
- template: job--python-tox.yml@asottile
|
||||||
parameters:
|
parameters:
|
||||||
toxenvs: [pypy, pypy3, py27, py36, py37]
|
toxenvs: [pypy, pypy3, py27, py36, py37, py38]
|
||||||
os: linux
|
os: linux
|
||||||
pre_test:
|
pre_test:
|
||||||
- task: UseRubyVersion@0
|
- task: UseRubyVersion@0
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from __future__ import unicode_literals
|
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'
|
CONFIG_FILE = '.pre-commit-config.yaml'
|
||||||
MANIFEST_FILE = '.pre-commit-hooks.yaml'
|
MANIFEST_FILE = '.pre-commit-hooks.yaml'
|
||||||
|
|
|
||||||
10
setup.cfg
10
setup.cfg
|
|
@ -14,10 +14,10 @@ classifiers =
|
||||||
Programming Language :: Python :: 2
|
Programming Language :: Python :: 2
|
||||||
Programming Language :: Python :: 2.7
|
Programming Language :: Python :: 2.7
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
Programming Language :: Python :: 3.4
|
|
||||||
Programming Language :: Python :: 3.5
|
Programming Language :: Python :: 3.5
|
||||||
Programming Language :: Python :: 3.6
|
Programming Language :: Python :: 3.6
|
||||||
Programming Language :: Python :: 3.7
|
Programming Language :: Python :: 3.7
|
||||||
|
Programming Language :: Python :: 3.8
|
||||||
Programming Language :: Python :: Implementation :: CPython
|
Programming Language :: Python :: Implementation :: CPython
|
||||||
Programming Language :: Python :: Implementation :: PyPy
|
Programming Language :: Python :: Implementation :: PyPy
|
||||||
|
|
||||||
|
|
@ -27,15 +27,15 @@ install_requires =
|
||||||
aspy.yaml
|
aspy.yaml
|
||||||
cfgv>=2.0.0
|
cfgv>=2.0.0
|
||||||
identify>=1.0.0
|
identify>=1.0.0
|
||||||
importlib-metadata
|
|
||||||
nodeenv>=0.11.1
|
nodeenv>=0.11.1
|
||||||
pyyaml
|
pyyaml
|
||||||
six
|
six
|
||||||
toml
|
toml
|
||||||
virtualenv>=15.2
|
virtualenv>=15.2
|
||||||
futures; python_version<"3.2"
|
futures;python_version<"3.2"
|
||||||
importlib-resources; python_version<"3.7"
|
importlib-metadata;python_version<"3.8"
|
||||||
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
|
importlib-resources;python_version<"3.7"
|
||||||
|
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue