Skip to content

Commit

Permalink
Upgrade to pyproject-fmt version 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpfleming committed May 18, 2024
1 parent 47d69fd commit 15627e7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.7.0"
rev: "2.1.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
rev: v0.4.4
hooks:
- id: ruff-format
- id: ruff
Expand Down
132 changes: 68 additions & 64 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ requires = [
[project]
name = "jinjanator-plugin-format-xml"
description = "Plugin which provides XML format (data input) support for jinjanator"
license = { text="Apache-2.0" }
license = { text = "Apache-2.0" }
authors = [
{ name="Kevin P. Fleming", email="jinjanator@kevin.km6g.us" },
{ name = "Kevin P. Fleming", email = "jinjanator@kevin.km6g.us" },
]
requires-python = ">=3.8"
classifiers = [
Expand All @@ -37,11 +37,9 @@ dependencies = [
"jinjanator-plugins==24.1.*",
"xmltodict",
]
[project.urls]
"Bug Tracker" = "https://github.com/kpfleming/jinjanator-plugin-format-xml/issues"
"Homepage" = "https://github.com/kpfleming/jinjanator-plugin-format-xml"
[project.entry-points.jinjanator]
format_xml = "jinjanator_plugin_format_xml.plugin"
urls."Bug Tracker" = "https://github.com/kpfleming/jinjanator-plugin-format-xml/issues"
urls."Homepage" = "https://github.com/kpfleming/jinjanator-plugin-format-xml"
entry-points.jinjanator.format_xml = "jinjanator_plugin_format_xml.plugin"

[tool.hatch.envs.changelog]
skip-install = true
Expand Down Expand Up @@ -70,68 +68,68 @@ exclude = [

[tool.hatch.build.targets.sdist]
include = [
"src",
"tests",
"*.md",
"src",
"tests",
"*.md",
]

[tool.hatch.build.targets.wheel]
packages = [
"src/jinjanator_plugin_format_xml",
"src/jinjanator_plugin_format_xml",
]

[tool.hatch.envs.default]
python = "3.12"

[tool.hatch.envs.lint]
dependencies = [
"ruff>=0.2.0",
"mypy",
"pyproject-fmt",
"types-xmltodict",
"ruff>=0.2.0",
"mypy",
"pyproject-fmt",
"types-xmltodict",
]

[tool.hatch.envs.lint.scripts]
lint = [
"ruff format",
"ruff check --output-format=full --fix --show-fixes",
"mypy --package jinjanator_plugin_format_xml",
"mypy tests",
"shellcheck workflow-support/*.sh",
"pyproject-fmt pyproject.toml",
"ruff format",
"ruff check --output-format=full --fix --show-fixes",
"mypy --package jinjanator_plugin_format_xml",
"mypy tests",
"shellcheck workflow-support/*.sh",
"pyproject-fmt pyproject.toml",
]
lint-action = [
"ruff format --check --diff",
"ruff check --output-format=github",
"mypy --package jinjanator_plugin_format_xml",
"mypy tests",
"shellcheck workflow-support/*.sh",
"pyproject-fmt --check pyproject.toml",
"ruff format --check --diff",
"ruff check --output-format=github",
"mypy --package jinjanator_plugin_format_xml",
"mypy tests",
"shellcheck workflow-support/*.sh",
"pyproject-fmt --check pyproject.toml",
]

[tool.hatch.envs.ci]
dependencies = [
"coverage[toml]",
"pytest",
"pytest-cov",
"pytest-icdiff",
"coverage[toml]",
"pytest",
"pytest-cov",
"pytest-icdiff",
]

[[tool.hatch.envs.ci.matrix]]
python = [
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]

[tool.hatch.envs.ci.scripts]
ci = [
"rm -f .coverage",
"pytest --verbose --cov-append --cov-branch --cov=jinjanator_plugin_format_xml",
"coverage report --show-missing --fail-under=100",
"rm -f .coverage",
"pytest --verbose --cov-append --cov-branch --cov=jinjanator_plugin_format_xml",
"coverage report --show-missing --fail-under=100",
]

[tool.hatch.metadata]
Expand Down Expand Up @@ -176,44 +174,46 @@ pattern = "#(\\d+)"
replacement = "[#\\1](https://github.com/kpfleming/jinjanator-plugin-format-xml/issues/\\1)"

[tool.ruff]
src = ["src", "tests"]
line-length = 100

[tool.ruff.lint]
ignore-init-module-imports = true
select = ["ALL"]
ignore = [
"ANN", # Mypy is better at this.
"COM812", # conflicts with formatter
"C901", # Leave complexity to me.
"D", # We have different ideas about docstrings.
"ISC001", # conflicts with formatter
"PLR0912", # Leave complexity to me.
"TRY301", # Raise in try blocks can totally make sense.
src = [
"src",
"tests",
]
unfixable = ["F401"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = [
lint.select = [
"ALL",
]
lint.per-file-ignores."tests/*" = [
"PLC1901", # empty strings are falsey, but are less specific in tests
"PT005", # we use always underscores and explicit names
"S101", # assert
"SIM300", # Yoda rocks in tests
]

[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
lint.unfixable = [
"F401",
]
lint.isort.lines-after-imports = 2
lint.isort.lines-between-types = 1
lint.ignore = [
"ANN", # Mypy is better at this.
"C901", # Leave complexity to me.
"COM812", # conflicts with formatter
"D", # We have different ideas about docstrings.
"ISC001", # conflicts with formatter
"PLR0912", # Leave complexity to me.
"TRY301", # Raise in try blocks can totally make sense.
]
lint.ignore-init-module-imports = true

[tool.pytest.ini_options]
minversion = "6.0"
xfail_strict = true
testpaths = [
"tests",
"tests",
]
addopts = [
"-ra",
"--strict-markers",
"-ra",
"--strict-markers",
]

[tool.towncrier]
Expand All @@ -225,7 +225,11 @@ start_string = "<!-- towncrier release notes start -->\n"
template = "changelog.d/towncrier_template.md.jinja"
title_format = ""
issue_format = "[#{issue}](https://github.com/kpfleming/jinjanator-plugin-format-xml/issues/{issue})"
underlines = ["", "", ""]
underlines = [
"",
"",
"",
]

[[tool.towncrier.section]]
path = ""
Expand Down

0 comments on commit 15627e7

Please sign in to comment.