From fb30f8c3416b99ff543094ffa977802ec5eb4f0e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 3 Nov 2020 07:14:07 +0100 Subject: Merging upstream version 1.5.7. Signed-off-by: Daniel Baumann --- .coveragerc | 29 ----------------------------- .travis.yml | 19 ------------------- Makefile | 16 ---------------- README.md | 5 +++-- azure-pipelines.yml | 19 +++++++++++++++++++ identify/extensions.py | 3 +++ requirements-dev.txt | 2 +- setup.cfg | 9 ++++++--- tests/identify_test.py | 10 ++++++---- tox.ini | 4 ---- 10 files changed, 38 insertions(+), 78 deletions(-) delete mode 100644 .coveragerc delete mode 100644 .travis.yml delete mode 100644 Makefile create mode 100644 azure-pipelines.yml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index f995964..0000000 --- a/.coveragerc +++ /dev/null @@ -1,29 +0,0 @@ -[run] -branch = True -source = - . -omit = - .tox/* - /usr/* - setup.py - -[report] -show_missing = True - -exclude_lines = - # Have to re-enable the standard pragma - \#\s*pragma: no cover - - # Don't complain if tests don't hit defensive assertion code: - ^\s*raise AssertionError\b - ^\s*raise NotImplementedError\b - ^\s*return NotImplemented\b - ^\s*raise$ - - # Don't complain if non-runnable code isn't run: - ^if __name__ == ['"]__main__['"]:$ - -[html] -directory = coverage-html - -# vim:ft=dosini diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2f27068..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: python -matrix: - include: - - env: TOXENV=py27 - - env: TOXENV=py35 - python: 3.5 - - env: TOXENV=py36 - python: 3.6 - - env: TOXENV=pypy - python: pypy - - env: TOXENV=pre-commit - python: 3.6 -install: pip install coveralls tox -script: tox -after_success: coveralls -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit diff --git a/Makefile b/Makefile deleted file mode 100644 index 0ce294d..0000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -.PHONY: minimal -minimal: venv - -venv: setup.py requirements-dev.txt tox.ini - tox -e venv - -.PHONY: test -test: - tox - -.PHONY: clean -clean: - find -name '*.pyc' -delete - find -name '__pycache__' -delete - rm -rf .tox - rm -rf venv diff --git a/README.md b/README.md index 17aabd2..accf29b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ identify ======== -[![Build Status](https://travis-ci.org/chriskuehl/identify.svg?branch=master)](https://travis-ci.org/chriskuehl/identify) -[![Coverage Status](https://coveralls.io/repos/github/chriskuehl/identify/badge.svg?branch=master)](https://coveralls.io/github/chriskuehl/identify?branch=master) +[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/pre-commit.identify?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=67&branchName=master) +[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/67/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=67&branchName=master) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/identify/master.svg)](https://results.pre-commit.ci/latest/github/pre-commit/identify/master) [![PyPI version](https://badge.fury.io/py/identify.svg)](https://pypi.python.org/pypi/identify) File identification library for Python. diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..7bb7600 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,19 @@ +trigger: + branches: + include: [master, test-me-*] + tags: + include: ['*'] + +resources: + repositories: + - repository: asottile + type: github + endpoint: github + name: asottile/azure-pipeline-templates + ref: refs/tags/v2.0.0 + +jobs: +- template: job--python-tox.yml@asottile + parameters: + toxenvs: [pypy3, py36, py37, py38] + os: linux diff --git a/identify/extensions.py b/identify/extensions.py index 1110ccb..5d5a685 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -27,6 +27,7 @@ EXTENSIONS = { 'cpp': {'text', 'c++'}, 'crt': {'text', 'pem'}, 'cs': {'text', 'c#'}, + 'csproj': {'text', 'xml', 'csproj'}, 'csh': {'text', 'shell', 'csh'}, 'cson': {'text', 'cson'}, 'css': {'text', 'css'}, @@ -151,6 +152,7 @@ EXTENSIONS = { 'scm': {'text', 'scheme'}, 'scss': {'text', 'scss'}, 'sh': {'text', 'shell'}, + 'sln': {'text', 'sln'}, 'sls': {'text', 'salt'}, 'so': {'binary'}, 'sol': {'text', 'solidity'}, @@ -186,6 +188,7 @@ EXTENSIONS = { 'vue': {'text', 'vue'}, 'war': {'binary', 'zip', 'jar'}, 'wav': {'binary', 'audio', 'wav'}, + 'webp': {'binary', 'image', 'webp'}, 'whl': {'binary', 'wheel', 'zip'}, 'wkt': {'text', 'wkt'}, 'woff': {'binary', 'woff'}, diff --git a/requirements-dev.txt b/requirements-dev.txt index 6732f9c..0c5a37e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,3 @@ +covdefaults coverage -pre-commit>=0.12.0 pytest diff --git a/setup.cfg b/setup.cfg index c742f5a..2b90b9f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,10 @@ [metadata] name = identify -version = 1.5.5 +version = 1.5.7 description = File identification library for Python long_description = file: README.md long_description_content_type = text/markdown -url = https://github.com/chriskuehl/identify +url = https://github.com/pre-commit/identify author = Chris Kuehl author_email = ckuehl@ocf.berkeley.edu license = MIT @@ -37,5 +37,8 @@ exclude = tests* testing* -[wheel] +[bdist_wheel] universal = True + +[coverage:run] +plugins = covdefaults diff --git a/tests/identify_test.py b/tests/identify_test.py index a80c401..8e00f60 100644 --- a/tests/identify_test.py +++ b/tests/identify_test.py @@ -105,7 +105,7 @@ def test_tags_from_path_plist_text(tmpdir): x = tmpdir.join('t.plist') x.write( '\n' - '\n' + '\n' # noqa: E501 '\n' '\n' '\tLast Login Name\n' @@ -179,12 +179,14 @@ def test_tags_from_interpreter(interpreter, expected): (b'', True), ('éóñəå ⊂(◉‿◉)つ(ノ≥∇≤)ノ'.encode('utf8'), True), (r'¯\_(ツ)_/¯'.encode('utf8'), True), - ('♪┏(・o・)┛♪┗ ( ・o・) ┓♪┏ ( ) ┛♪┗ (・o・ ) ┓♪┏(・o・)┛♪'.encode('utf8'), True), + ('♪┏(・o・)┛♪┗ ( ・o・) ┓♪┏ ( ) ┛♪┗ (・o・ ) ┓♪'.encode('utf8'), True), ('éóñå'.encode('latin1'), True), (b'hello world\x00', False), - (b'\x7f\x45\x4c\x46\x02\x01\x01', False), # first few bytes of /bin/bash - (b'\x43\x92\xd9\x0f\xaf\x32\x2c', False), # some /dev/urandom output + # first few bytes of /bin/bash + (b'\x7f\x45\x4c\x46\x02\x01\x01', False), + # some /dev/urandom output + (b'\x43\x92\xd9\x0f\xaf\x32\x2c', False), ), ) def test_is_text(data, expected): diff --git a/tox.ini b/tox.ini index 33cae3c..2876390 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,5 @@ [tox] envlist = py27,py35,py36,pypy,pre-commit -tox_pip_extensions_ext_venv_update = true [testenv] deps = -rrequirements-dev.txt @@ -15,8 +14,5 @@ skip_install = true deps = pre-commit commands = pre-commit run --all-files --show-diff-on-failure -[flake8] -max-line-length = 119 - [pep8] ignore = E265,E501,W504 -- cgit v1.2.3