summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.pre-commit-config.yaml10
-rw-r--r--debian/changelog22
-rw-r--r--identify/extensions.py2
-rw-r--r--identify/identify.py14
-rw-r--r--setup.cfg2
-rw-r--r--tests/identify_test.py2
6 files changed, 39 insertions, 13 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6f61d88..79ca02d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -14,7 +14,7 @@ repos:
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder-python-imports
- rev: v3.12.0
+ rev: v3.13.0
hooks:
- id: reorder-python-imports
args: [--py38-plus, --add-import, 'from __future__ import annotations']
@@ -23,20 +23,20 @@ repos:
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
- rev: v3.15.2
+ rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/hhatto/autopep8
- rev: v2.1.0
+ rev: v2.3.1
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/flake8
- rev: 7.0.0
+ rev: 7.1.1
hooks:
- id: flake8
exclude: ^identify/vendor/licenses\.py$
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v1.9.0
+ rev: v1.11.2
hooks:
- id: mypy
diff --git a/debian/changelog b/debian/changelog
index 8facc2b..eb5b597 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
+identify (2.6.1-1) sid; urgency=medium
+
+ * Uploading to sid.
+ * Merging upstream version 2.6.1.
+
+ -- Daniel Baumann <daniel.baumann@progress-linux.org> Mon, 16 Sep 2024 18:48:40 +0200
+
+identify (2.6.0-1) sid; urgency=medium
+
+ * Uploading to sid.
+ * Merging upstream version 2.6.0.
+
+ -- Daniel Baumann <daniel.baumann@progress-linux.org> Sat, 13 Jul 2024 12:55:25 +0200
+
+identify (2.5.36-1) sid; urgency=medium
+
+ * Uploading to sid.
+ * Updating to standards-version 4.7.0.
+ * Merging upstream version 2.5.36.
+
+ -- Daniel Baumann <daniel.baumann@progress-linux.org> Sat, 27 Apr 2024 04:36:36 +0200
+
identify (2.5.35-1) sid; urgency=medium
* Uploading to sid.
diff --git a/identify/extensions.py b/identify/extensions.py
index d427f67..cc3a182 100644
--- a/identify/extensions.py
+++ b/identify/extensions.py
@@ -6,6 +6,7 @@ EXTENSIONS = {
'asciidoc': {'text', 'asciidoc'},
'apinotes': {'text', 'apinotes'},
'asar': {'binary', 'asar'},
+ 'astro': {'text', 'astro'},
'avif': {'binary', 'image', 'avif'},
'avsc': {'text', 'avro-schema'},
'bash': {'text', 'shell', 'bash'},
@@ -56,6 +57,7 @@ EXTENSIONS = {
'ear': {'binary', 'zip', 'jar'},
'edn': {'text', 'clojure', 'edn'},
'ejs': {'text', 'ejs'},
+ 'ejson': {'text', 'json', 'ejson'},
'env': {'text', 'dotenv'},
'eot': {'binary', 'eot'},
'eps': {'binary', 'eps'},
diff --git a/identify/identify.py b/identify/identify.py
index 2bf2125..0279ba8 100644
--- a/identify/identify.py
+++ b/identify/identify.py
@@ -191,14 +191,14 @@ def parse_shebang(bytesio: IO[bytes]) -> tuple[str, ...]:
return ()
cmd = tuple(_shebang_split(first_line.strip()))
- if cmd and cmd[0] == '/usr/bin/env':
- if cmd[1] == '-S':
- cmd = cmd[2:]
- else:
- cmd = cmd[1:]
+ if cmd[:2] == ('/usr/bin/env', '-S'):
+ cmd = cmd[2:]
+ elif cmd[:1] == ('/usr/bin/env',):
+ cmd = cmd[1:]
+
+ if cmd == ('nix-shell',):
+ return _parse_nix_shebang(bytesio, cmd)
- if cmd == ('nix-shell',):
- return _parse_nix_shebang(bytesio, cmd)
return cmd
diff --git a/setup.cfg b/setup.cfg
index 9455e58..df9b810 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = identify
-version = 2.5.36
+version = 2.6.1
description = File identification library for Python
long_description = file: README.md
long_description_content_type = text/markdown
diff --git a/tests/identify_test.py b/tests/identify_test.py
index bb8aba5..c0e5410 100644
--- a/tests/identify_test.py
+++ b/tests/identify_test.py
@@ -325,6 +325,8 @@ def test_file_is_text_does_not_exist(tmpdir):
(b'#!\x00\x00\x00\x00', ()),
# shebang lines with multiple arguments
(b'#!/usr/bin/env -S python -u', ('python', '-u')),
+ (b'#!/usr/bin/env', ()),
+ (b'#!/usr/bin/env -S', ()),
),
)
def test_parse_shebang(s, expected):