1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
[build-system]
build-backend = "setuptools.build_meta"
requires = [ "setuptools", "setuptools-scm[toml]>=6.2" ]
[project]
name = "puremagic"
description = "Pure python implementation of magic file detection"
readme = "README.rst"
license = "MIT"
authors = [
{ name = "Chris Griffith", email = "chris@cdgriffith.com" },
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Utilities",
]
dynamic = [ "version" ]
urls.Homepage = "https://github.com/cdgriffith/puremagic"
scripts.puremagic = "puremagic.main:command_line_entry"
[dependency-groups]
dev = [
"codespell>=2.4.2",
"coverage>=7.13.4",
"poethepoet>=0.42.1",
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"pytest-cov>=7",
"ruff>=0.15.5",
"setuptools>=82",
"twine>=6.2",
"ty>=0.0.21",
"wheel>=0.46.3",
]
[tool.setuptools]
dynamic.version = { attr = "puremagic.main.__version__" }
package-data."*" = [ "*.json" ]
packages.find.where = [ "." ]
packages.find.include = [ "puremagic*" ]
[tool.black]
# Prevent black from linting as we use Ruff now
force-exclude = ".*\\.py$"
[tool.ruff]
target-version = "py312"
line-length = 120
indent-width = 4
# Exclude a variety of commonly ignored directories.
exclude = [
".direnv",
".eggs",
".git",
".git-rewrite",
".ipynb_checkpoints",
".pytest_cache",
".pytype",
".ruff_cache",
".ty",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"venv",
]
# Like Black, indent with spaces, rather than tabs.
format.indent-style = "space"
# Like Black, use double quotes for strings.
format.quote-style = "double"
format.line-ending = "lf"
# Like Black, respect magic trailing commas.
format.skip-magic-trailing-comma = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
format.docstring-code-line-length = "dynamic"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
format.docstring-code-format = true
lint.fixable = [ "F541" ]
lint.unfixable = [ "F401" ]
[tool.flake8]
# Prevent flake8 from linting as we use Ruff now
exclude = [ "*" ]
[tool.poe]
executor.type = "uv"
tasks.test = "pytest --cov=puremagic test/"
tasks.lint = "ruff check --fix"
tasks.format = "ruff format"
tasks.typecheck = "ty check"
tasks.spellcheck = "codespell --ignore-words-list=addin,caf,tye,wors --skip='*.json' puremagic/"
|