remarshal/pyproject.toml

210 lines
5.7 KiB
TOML

[build-system]
requires = ["poetry-core>=1.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "remarshal"
version = "0.18.0"
description = "Convert between CBOR, JSON, MessagePack, TOML, and YAML"
authors = ["D. Bohdan <dbohdan@dbohdan.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/remarshal-project/remarshal"
keywords = ["converter", "cbor", "json", "messagepack", "msgpack", "toml", "yaml"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Topic :: File Formats",
"Topic :: File Formats :: JSON",
"Topic :: Utilities"
]
include = [
{ path = "example.cbor", format = "sdist" },
{ path = "example.json", format = "sdist" },
{ path = "example.msgpack", format = "sdist" },
{ path = "example.toml", format = "sdist" },
{ path = "example.yaml", format = "sdist" },
{ path = "tests/", format = "sdist" },
{ path = "tox.ini", format = "sdist" },
]
[tool.poetry.dependencies]
python = "^3.8"
cbor2 = "^5.6"
"ruamel.yaml" = "^0.18.0"
tomli = { version = "^2.0.1", python = "<3.11" }
tomlkit = "^0.12.1"
u-msgpack-python = "^2.8"
colorama = "^0.4.6"
rich-argparse = "^1.4.0"
[tool.poetry.group.dev.dependencies]
ruff = "0.3.5"
tomli = "^2.0.1"
types-python-dateutil = "^2.8.19.13"
codespell = {extras = ["toml"], version = "^2.2.5"}
pyright = "1.1.350"
pytest = "^8"
pytest-cov = "^4.1.0"
[tool.poetry.scripts]
remarshal = 'remarshal.main:main'
cbor2cbor = 'remarshal.main:main'
cbor2json = 'remarshal.main:main'
cbor2msgpack = 'remarshal.main:main'
cbor2toml = 'remarshal.main:main'
cbor2yaml = 'remarshal.main:main'
json2cbor = 'remarshal.main:main'
json2json = 'remarshal.main:main'
json2msgpack = 'remarshal.main:main'
json2toml = 'remarshal.main:main'
json2yaml = 'remarshal.main:main'
msgpack2cbor = 'remarshal.main:main'
msgpack2json = 'remarshal.main:main'
msgpack2msgpack = 'remarshal.main:main'
msgpack2toml = 'remarshal.main:main'
msgpack2yaml = 'remarshal.main:main'
toml2cbor = 'remarshal.main:main'
toml2json = 'remarshal.main:main'
toml2msgpack = 'remarshal.main:main'
toml2toml = 'remarshal.main:main'
toml2yaml = 'remarshal.main:main'
yaml2cbor = 'remarshal.main:main'
yaml2json = 'remarshal.main:main'
yaml2msgpack = 'remarshal.main:main'
yaml2toml = 'remarshal.main:main'
yaml2yaml = 'remarshal.main:main'
[tool.codespell]
quiet-level = 3
[tool.poe.env]
"PYTHON_SOURCES" = "src/ tests/"
[tool.poe.tasks.check]
sequence = ["format", "codespell", "lint", "type"]
help = "Run the formatter, then all static checks"
ignore_fail = "return_non_zero"
[tool.poe.tasks.codespell]
cmd = "codespell ${PYTHON_SOURCES}"
help = "Run codespell"
[tool.poe.tasks.files]
cmd = "echo ${PYTHON_SOURCES}"
help = "Print the list of files and directories used for static checks"
[tool.poe.tasks.format]
cmd = "ruff format ${PYTHON_SOURCES}"
help = "Run the Ruff formatter"
[tool.poe.tasks.lint]
cmd = "ruff check ${PYTHON_SOURCES}"
help = "Run Ruff"
[tool.poe.tasks.remarshal]
cmd = "python -m remarshal"
help = "Run Remarshal"
[tool.poe.tasks.test]
cmd = "pytest"
help = "Run Pytest (not through tox)"
[tool.poe.tasks.type]
cmd = "pyright ${PYTHON_SOURCES}"
help = "Run Pyright"
[tool.pyright]
pythonVersion = "3.8"
[tool.ruff]
src = ["src", "tests"]
target-version = "py38"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"AIR", # Airflow
"ARG", # flake8-unused-arguments
"ASYNC", # flake8-async
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
# "CPY", # Copyright-related rules
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"EXE", # flake8-executable
"F", # Pyflakes
"FA", # flake8-future-annotations
"FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"FLY", # flynt
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # Pylint
"PT", # flake8-pytest-style
"PYI", # flake8-pyi
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"W", # pycodestyle
"YTT", # flake8-2020
# "ANN", # flake8-annotations
# "COM", # flake8-commas
# "D", # pydocstyle
# "DJ", # flake8-django
# "ERA", # eradicate
# "NPY", # NumPy-specific rules
# "PD", # pandas-vet
"PTH", # flake8-use-pathlib
# "Q", # flake8-quotes
# "TRY", # tryceratops
# "UP", # pyupgrade
]
ignore = [
"A002", # builtin-argument-shadowing
"ISC001", # single-line-implicit-string-concatenation
"PGH003", # blanket-type-ignore
]
[tool.ruff.lint.mccabe]
max-complexity = 14
[tool.ruff.lint.pylint]
allow-magic-value-types = ["int", "str"]
max-args = 12
max-branches = 20
max-statements = 100
[tool.ruff.lint.per-file-ignores]
"src/remarshal/main.py" = ["ARG001", "B904", "EM103", "RET506", "S506", "SIM115"]
"tests/test_remarshal.py" = ["F841", "PT011", "SLF001"]
"tests/*" = ["S101"]