Skip to content

Commit e72bfe1

Browse files
authored
Post release fixes (#2523)
2 parents b61aec9 + f019a3c commit e72bfe1

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

.github/workflows/build_win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
buildWin64:
1010
needs: buildAssets
11-
runs-on: windows-latest
11+
runs-on: windows-2022
1212
steps:
1313
- name: Python Setup
1414
uses: actions/setup-python@v5

pkgutils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ def genMacOSPlist(args: argparse.Namespace) -> None:
267267
cmdBuildUbuntu = parsers.add_parser(
268268
"build-ubuntu", help=(
269269
"Build a .deb package for Debian and Ubuntu. "
270-
"Add --sign to sign package. "
271-
"Add --first to set build number to 0."
270+
"Add --sign to sign package."
272271
)
273272
)
274273
cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.")

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ authors = [
1010
description = "A plain text editor for planning and writing novels"
1111
readme = {file = "setup/description_pypi.md", content-type = "text/markdown"}
1212
license = "GPL-3.0-or-later AND Apache-2.0 AND CC-BY-4.0"
13-
license-files = [
14-
"LICENSE.md",
15-
"setup/LICENSE-Apache-2.0.txt",
16-
]
13+
license-files = ["LICENSE.md", "setup/LICENSE-Apache-2.0.txt"]
1714
classifiers = [
1815
"Programming Language :: Python :: 3 :: Only",
1916
"Programming Language :: Python :: 3.10",

utils/build_debian.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
def makeDebianPackage(
3838
signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable",
39-
buildName: str = "", forLaunchpad: bool = False
39+
buildName: str = "", forLaunchpad: bool = False, oldLicense: bool = False,
4040
) -> str:
4141
"""Build a Debian package."""
4242
print("")
@@ -96,7 +96,7 @@ def makeDebianPackage(
9696
print("Copying or generating additional files ...")
9797
print("")
9898

99-
copyPackageFiles(outDir, setupPy=True)
99+
copyPackageFiles(outDir, oldLicense=oldLicense)
100100

101101
# Copy/Write Debian Files
102102
# =======================
@@ -181,14 +181,14 @@ def launchpad(args: argparse.Namespace) -> None:
181181
bldNum = "0"
182182

183183
distLoop = [
184-
("24.04", "noble"),
185-
("25.04", "plucky"),
186-
("25.10", "questing"),
184+
("24.04", "noble", True),
185+
("25.04", "plucky", True),
186+
("25.10", "questing", False),
187187
]
188188

189189
print("Building Ubuntu packages for:")
190190
print("")
191-
for distNum, codeName in distLoop:
191+
for distNum, codeName, _ in distLoop:
192192
print(f" * Ubuntu {distNum} {codeName.title()}")
193193
print("")
194194

@@ -198,14 +198,15 @@ def launchpad(args: argparse.Namespace) -> None:
198198
print("")
199199

200200
dputCmd = []
201-
for distNum, codeName in distLoop:
201+
for distNum, codeName, oldLicense in distLoop:
202202
buildName = f"ubuntu{distNum}.{bldNum}"
203203
dCmd = makeDebianPackage(
204204
signKey=signKey,
205205
sourceBuild=True,
206206
distName=codeName,
207207
buildName=buildName,
208208
forLaunchpad=True,
209+
oldLicense=oldLicense,
209210
)
210211
dputCmd.append(dCmd)
211212

utils/common.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,31 @@ def copySourceCode(dst: Path) -> None:
9191
return
9292

9393

94-
def copyPackageFiles(dst: Path, setupPy: bool = False) -> None:
94+
def copyPackageFiles(dst: Path, oldLicense: bool = False) -> None:
9595
"""Copy files needed for packaging."""
96-
copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"]
96+
copyFiles = ["LICENSE.md", "setup/LICENSE-Apache-2.0.txt", "CREDITS.md", "pyproject.toml"]
9797
for copyFile in copyFiles:
9898
shutil.copyfile(copyFile, dst / copyFile)
9999
print("Copied:", copyFile, flush=True)
100100

101101
writeFile(dst / "MANIFEST.in", (
102102
"include LICENSE.md\n"
103+
"include setup/LICENSE-Apache-2.0.txt\n"
103104
"include CREDITS.md\n"
104105
"recursive-include novelwriter/assets *\n"
105106
))
106107

107-
if setupPy:
108-
writeFile(dst / "setup.py", (
109-
"import setuptools\n"
110-
"setuptools.setup()\n"
111-
))
112-
113108
text = readFile(ROOT_DIR / "pyproject.toml")
114109
text = text.replace("setup/description_pypi.md", "data/description_short.txt")
110+
if oldLicense:
111+
new = []
112+
for line in text.splitlines():
113+
if line.startswith("license = "):
114+
line = 'license = {text = "GPL-3.0-or-later AND Apache-2.0 AND CC-BY-4.0"}'
115+
if line.startswith("license-files = "):
116+
continue
117+
new.append(line)
118+
text = "\n".join(new)
115119
writeFile(dst / "pyproject.toml", text)
116120

117121
return

0 commit comments

Comments
 (0)