Add dependency groups to pyproject and drop pytest-cov dependency
This commit is contained in:
+22
-10
@@ -4,9 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "novelWriter"
|
||||
authors = [
|
||||
{name = "Veronica Berglyd Olsen", email = "code@vkbo.net"},
|
||||
]
|
||||
authors = [{ name = "Veronica Berglyd Olsen", email = "code@vkbo.net" }]
|
||||
description = "A plain text editor for planning and writing novels"
|
||||
readme = { file = "setup/description_pypi.md", content-type = "text/markdown" }
|
||||
license = "GPL-3.0-or-later AND Apache-2.0 AND CC-BY-4.0"
|
||||
@@ -26,12 +24,28 @@ classifiers = [
|
||||
"Topic :: Text Editors",
|
||||
]
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"pyqt6>=6.4",
|
||||
"pyenchant>=3.0.0",
|
||||
]
|
||||
dependencies = ["pyqt6>=6.4", "pyenchant>=3.0.0"]
|
||||
dynamic = ["version"]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
{ include-group = "docs" },
|
||||
{ include-group = "test" },
|
||||
{ include-group = "lint" },
|
||||
]
|
||||
docs = [
|
||||
"docutils>=0.17.1",
|
||||
"pygments>=2.7",
|
||||
"sphinx-book-theme",
|
||||
"sphinx-copybutton",
|
||||
"sphinx-design",
|
||||
"sphinx-favicon",
|
||||
"sphinx-intl",
|
||||
"sphinx>=5.0",
|
||||
]
|
||||
test = ["coverage>=7.2.0", "pytest-qt", "pytest-timeout", "pytest>=6.0.0"]
|
||||
lint = ["isort", "pyright", "ruff"]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://novelwriter.io"
|
||||
Documentation = "https://docs.novelwriter.io"
|
||||
@@ -149,6 +163,4 @@ branch = false
|
||||
|
||||
[tool.coverage.report]
|
||||
precision = 2
|
||||
exclude_also = [
|
||||
"if TYPE_CHECKING:"
|
||||
]
|
||||
exclude_also = ["if TYPE_CHECKING:"]
|
||||
|
||||
+19
-10
@@ -3,6 +3,7 @@
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@@ -12,27 +13,35 @@ if __name__ == "__main__":
|
||||
parser.add_argument("-o", action="store_true", help="Run off screen")
|
||||
parser.add_argument("-r", action="store_true", help="Generate reports")
|
||||
parser.add_argument("-t", action="store_true", help="Generate terminal report")
|
||||
parser.add_argument("-m", help="Test modules")
|
||||
parser.add_argument("-k", help="Test filters")
|
||||
parser.add_argument("-u", action="store_true", help="Generate uncovered terminal report")
|
||||
parser.add_argument("-m", help="Test modules", metavar="MARKEXPR")
|
||||
parser.add_argument("-k", help="Test filters", metavar="EXPRESSION")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
env = os.environ.copy()
|
||||
env["QT_SCALE_FACTOR"] = "1.0"
|
||||
cmd = [sys.executable, "-m", "pytest", "-vv"]
|
||||
|
||||
if args.r or args.t or args.u:
|
||||
cmd = [sys.executable, "-m"]
|
||||
else:
|
||||
cmd = ["coverage", "-m"]
|
||||
|
||||
cmd += ["pytest", "-vv"]
|
||||
if args.o:
|
||||
env["QT_QPA_PLATFORM"] = "offscreen"
|
||||
if args.r or args.t:
|
||||
cmd += ["--cov=novelwriter"]
|
||||
if args.r:
|
||||
cmd += ["--cov-report=xml", "--cov-report=html"]
|
||||
if args.t:
|
||||
cmd += ["--cov-report=term"]
|
||||
if args.m:
|
||||
cmd += ["-m", args.m]
|
||||
if args.k:
|
||||
cmd += ["-k", args.k]
|
||||
|
||||
print("Calling:", " ".join(cmd))
|
||||
print("Calling:", shlex.join(cmd))
|
||||
subprocess.call(cmd, env=env)
|
||||
|
||||
if args.r:
|
||||
subprocess.call(["coverage", "xml"])
|
||||
subprocess.call(["coverage", "html"])
|
||||
if args.t and not args.u:
|
||||
subprocess.call(["coverage", "report"])
|
||||
if args.u:
|
||||
subprocess.call(["coverage", "report", "--skip-covered "])
|
||||
|
||||
Reference in New Issue
Block a user