1
0
Fork 0

Merging upstream version 1.5.7.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-12 21:28:59 +01:00
parent 1b53ace626
commit 081e9b7cd8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 38 additions and 78 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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.

19
azure-pipelines.yml Normal file
View file

@ -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

View file

@ -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'},

View file

@ -1,3 +1,3 @@
covdefaults
coverage
pre-commit>=0.12.0
pytest

View file

@ -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

View file

@ -105,7 +105,7 @@ def test_tags_from_path_plist_text(tmpdir):
x = tmpdir.join('t.plist')
x.write(
'<?xml version="1.0" encoding="UTF-8"?>\n'
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n'
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n' # noqa: E501
'<plist version="1.0">\n'
'<dict>\n'
'\t<key>Last Login Name</key>\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):

View file

@ -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