Skip to content

Commit

Permalink
Build with hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Mar 26, 2023
1 parent f581367 commit 628bea9
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ optional arguments:

Suggested code hygiene:
```
$ ruff .
$ ruff --show-fixes --show-source .
$ black .
```
94 changes: 78 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,111 @@
[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"

[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"]
1 change: 1 addition & 0 deletions tap2junit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.6"
2 changes: 1 addition & 1 deletion tap2junit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion test/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from _common import normalize_output


class Test_Outputs:
class TestOutputs:
filelist = glob.glob("test/fixtures/*.tap")
print(filelist)

Expand Down

0 comments on commit 628bea9

Please sign in to comment.