From 0cfd0301af2f5fa10d41bda0e101e915bd24a5cf Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 30 Mar 2023 11:08:30 +0200 Subject: [PATCH] Build with hatch and release tap2junit v0.1.6 (#49) * Build with hatch * hatch version micro * Add changelog URL --- .github/workflows/lint_python.yml | 4 +- README.md | 4 +- pyproject.toml | 95 +++++++++++++++++++++++++------ tap2junit/__init__.py | 1 + tap2junit/__main__.py | 2 +- test/test_outputs.py | 2 +- 6 files changed, 86 insertions(+), 22 deletions(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 9e4dc1e..19397a7 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -9,10 +9,10 @@ jobs: with: python-version: 3.x - run: pip install --upgrade pip setuptools wheel - - run: pip install black codespell junit_xml mypy pytest pytest-clarity ruff safety yamlish + - run: pip install --editable ".[dev]" + - run: codespell . - run: ruff --format=github . - run: black --check . - - run: codespell --skip="*.tap" --skip "*.xml" # --ignore-words-list="" - run: mypy . - run: pytest -vv . - run: pytest --doctest-modules . diff --git a/README.md b/README.md index e784673..f00aa69 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Improvements are welcome. To install from https://pypi.org/project/tap2junit (recommended): -`pip install tap2junit` or `pipx install tap2junit` +`pipx install tap2junit` To install directly from this repo (not recommended): @@ -36,6 +36,6 @@ optional arguments: Suggested code hygiene: ``` -$ ruff . +$ ruff --show-fixes --show-source . $ black . ``` diff --git a/pyproject.toml b/pyproject.toml index e9af726..28f35ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,49 +1,112 @@ [project] name = "tap2junit" -version = "0.1.5" -description = "Tap13 to jUnit" +description = "A utility that converts TAP version 12 and 13 to JUnit. That's it." +dynamic = ["version"] +keywords = ["tap13", "junit"] +license = {text = "Apache-2.0"} readme = "README.md" +requires-python = ">=3.7" authors = [ - {name = "Node.js contributor", email = "cclauss@me.com"} + { name = "Node.js contributor", email = "cclauss@me.com" } ] -keywords = ["tap13", "junit"] classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", - "License :: OSI Approved :: Apache License, Version 2.0", + "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Software Development :: Build Tools", ] dependencies = [ - "junit_xml", - "yamlish" + "junit_xml", + "yamlish" +] + +[project.optional-dependencies] +dev = [ + "black", + "codespell[toml]", + "mypy", + "pytest", + "pytest-clarity", + "ruff", + "safety", ] [project.scripts] tap2junit = "tap2junit.__main__:main" [project.urls] -repository = "https://github.com/nodejs/tap2junit" +Homepage = "https://github.com/nodejs/tap2junit" +Changelog = "https://github.com/nodejs/tap2junit/blob/main/CHANGELOG.md" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.sdist] +exclude = [ + "/.github", + "/backend", +] + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.version] +path = "tap2junit/__init__.py" + +[tool.codespell] +quiet-level = 3 +skip = '*.tap,*.xml' [tool.mypy] exclude = ["build/"] ignore_missing_imports = true [tool.ruff] -select = ["A", "B", "C4", "C9", "E", "F", "I", "PL", "S", "UP", "W", "YTT"] +select = [ + "A", + "B", + "BLE", + "C4", + "C9", + "DTZ", + "E", + "EXE", + "F", + "G", + "I", + "ICN", + "ISC", + "N", + "PGH", + "PIE", + "PL", + "PT", + "PYI", + "RUF", + "S", + "SIM", + "UP", + "W", + "YTT", +] +line-length = 88 # Recommended: 88 target-version = "py37" [tool.ruff.mccabe] -max-complexity = 24 - -[tool.ruff.per-file-ignores] -"test/*" = ["S101"] # Use of assert detected which is OK in pytests. +max-complexity = 24 # Recommended: 10 [tool.ruff.pylint] -max-args = 6 -max-branches = 25 -max-statements = 89 +max-args = 6 # Recommended: 5 +max-branches = 25 # Recommended: 12 +max-returns = 6 # Recommended: 6 +max-statements = 89 # Recommended: 50 + +[tool.ruff.per-file-ignores] +"test/*" = ["C406", "S101", "SIM115"] diff --git a/tap2junit/__init__.py b/tap2junit/__init__.py index e69de29..0a8da88 100644 --- a/tap2junit/__init__.py +++ b/tap2junit/__init__.py @@ -0,0 +1 @@ +__version__ = "0.1.6" diff --git a/tap2junit/__main__.py b/tap2junit/__main__.py index 23b1fa2..2f30a4d 100644 --- a/tap2junit/__main__.py +++ b/tap2junit/__main__.py @@ -5,7 +5,7 @@ import yamlish from junit_xml import TestCase, TestSuite -from tap2junit.tap13 import TAP13 as tap13 +from tap2junit.tap13 import TAP13 as tap13 # noqa: N811 def extract_test_info_from_description(description): diff --git a/test/test_outputs.py b/test/test_outputs.py index 2dd31f8..2edf60f 100644 --- a/test/test_outputs.py +++ b/test/test_outputs.py @@ -7,7 +7,7 @@ from _common import normalize_output -class Test_Outputs: +class TestOutputs: filelist = glob.glob("test/fixtures/*.tap") print(filelist)