Skip to content

Commit 47b0a5b

Browse files
Version 2.0.0b4 (#113)
* Fix #112 command line tool text (thanks to Sandro) --------- Co-authored-by: Sandro <shfu29r4bu@liamekaens.com>
1 parent 5f555c1 commit 47b0a5b

File tree

4 files changed

+45
-26
lines changed

4 files changed

+45
-26
lines changed

.flake8

Lines changed: 0 additions & 17 deletions
This file was deleted.

puremagic/main.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
from itertools import chain
2020
from pathlib import Path
2121

22+
import puremagic
23+
2224
if os.getenv("PUREMAGIC_DEEPSCAN") != "0":
2325
from puremagic.scanners import zip_scanner, pdf_scanner, text_scanner, json_scanner, python_scanner
2426

2527
__author__ = "Chris Griffith"
26-
__version__ = "2.0.0b3"
28+
__version__ = "2.0.0b4"
2729
__all__ = [
2830
"magic_file",
2931
"magic_string",
@@ -474,9 +476,9 @@ def command_line_entry(*args):
474476

475477
parser = ArgumentParser(
476478
description=(
477-
"puremagic is a pure python file identification module."
478-
"It looks for matching magic numbers in the file to locate the file type. "
479-
)
479+
"""puremagic is a pure python file identification module.
480+
It looks for matching magic numbers in the file to locate the file type."""
481+
),
480482
)
481483
parser.add_argument(
482484
"-m",
@@ -485,8 +487,9 @@ def command_line_entry(*args):
485487
dest="mime",
486488
help="Return the mime type instead of file type",
487489
)
488-
parser.add_argument("-v", "--v", action="store_true", dest="verbose", help="Print verbose output")
490+
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", help="Print verbose output")
489491
parser.add_argument("files", nargs="+")
492+
parser.add_argument("--version", action="version", version=puremagic.__version__)
490493
args = parser.parse_args(args if args else sys.argv[1:])
491494

492495
for fn in args.files:

pyproject.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ classifiers = [
2727

2828
dynamic = [ "version" ]
2929
urls.Homepage = "https://github.com/cdgriffith/puremagic"
30-
scripts.fastflix = "puremagic.__main__:command_line_entry"
30+
scripts.puremagic = "puremagic.main:command_line_entry"
3131

3232
[dependency-groups]
3333
dev = [
3434
"coverage>=7.9.2",
35+
"poethepoet>=0.36.0",
3536
"pre-commit>=4.2",
3637
"pytest>=8.4.1",
3738
"pytest-cov>=6.2.1",
@@ -99,3 +100,11 @@ format.docstring-code-line-length = "dynamic"
99100
format.docstring-code-format = true
100101
lint.fixable = [ "F541" ]
101102
lint.unfixable = [ "F401" ]
103+
104+
[tool.poe]
105+
executor.type = "uv"
106+
107+
[tool.poe.tasks]
108+
test = "pytest --cov=puremagic test/"
109+
lint = "ruff check --fix"
110+
format = "ruff format"

uv.lock

Lines changed: 27 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)