Use Ruff for linting and fix a ton of issues

This commit is contained in:
Veronica Berglyd Olsen
2025-04-03 01:15:52 +02:00
parent d2796d27c3
commit 53a2d0e691
43 changed files with 257 additions and 235 deletions
+6 -6
View File
@@ -44,17 +44,17 @@ def extractVersion(beQuiet: bool = False) -> tuple[str, str, str]:
try:
for aLine in initFile.read_text(encoding="utf-8").splitlines():
if aLine.startswith("__version__"):
numVers = getValue((aLine))
numVers = getValue(aLine)
if aLine.startswith("__hexversion__"):
hexVers = getValue((aLine))
hexVers = getValue(aLine)
if aLine.startswith("__date__"):
relDate = getValue((aLine))
relDate = getValue(aLine)
except Exception as exc:
print("Could not read file: %s" % initFile)
print(f"Could not read file: {initFile}")
print(str(exc))
if not beQuiet:
print("novelWriter version: %s (%s) at %s" % (numVers, hexVers, relDate))
print(f"novelWriter version: {numVers} ({hexVers}) at {relDate}")
return numVers, hexVers, relDate
@@ -95,7 +95,7 @@ def copyPackageFiles(dst: Path, setupPy: bool = False) -> None:
copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"]
for copyFile in copyFiles:
shutil.copyfile(copyFile, dst / copyFile)
print("Copied: %s" % copyFile)
print(f"Copied: {copyFile}")
writeFile(dst / "MANIFEST.in", (
"include LICENSE.md\n"