Post release fixes (#2523)
This commit is contained in:
@@ -8,7 +8,7 @@ jobs:
|
|||||||
|
|
||||||
buildWin64:
|
buildWin64:
|
||||||
needs: buildAssets
|
needs: buildAssets
|
||||||
runs-on: windows-latest
|
runs-on: windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Python Setup
|
- name: Python Setup
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
|||||||
+1
-2
@@ -267,8 +267,7 @@ if __name__ == "__main__":
|
|||||||
cmdBuildUbuntu = parsers.add_parser(
|
cmdBuildUbuntu = parsers.add_parser(
|
||||||
"build-ubuntu", help=(
|
"build-ubuntu", help=(
|
||||||
"Build a .deb package for Debian and Ubuntu. "
|
"Build a .deb package for Debian and Ubuntu. "
|
||||||
"Add --sign to sign package. "
|
"Add --sign to sign package."
|
||||||
"Add --first to set build number to 0."
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.")
|
cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.")
|
||||||
|
|||||||
+1
-4
@@ -10,10 +10,7 @@ authors = [
|
|||||||
description = "A plain text editor for planning and writing novels"
|
description = "A plain text editor for planning and writing novels"
|
||||||
readme = {file = "setup/description_pypi.md", content-type = "text/markdown"}
|
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"
|
license = "GPL-3.0-or-later AND Apache-2.0 AND CC-BY-4.0"
|
||||||
license-files = [
|
license-files = ["LICENSE.md", "setup/LICENSE-Apache-2.0.txt"]
|
||||||
"LICENSE.md",
|
|
||||||
"setup/LICENSE-Apache-2.0.txt",
|
|
||||||
]
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Programming Language :: Python :: 3 :: Only",
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ SIGN_KEY = "D6A9F6B8F227CF7C6F6D1EE84DBBE4B734B0BD08"
|
|||||||
|
|
||||||
def makeDebianPackage(
|
def makeDebianPackage(
|
||||||
signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable",
|
signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable",
|
||||||
buildName: str = "", forLaunchpad: bool = False
|
buildName: str = "", forLaunchpad: bool = False, oldLicense: bool = False,
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Build a Debian package."""
|
"""Build a Debian package."""
|
||||||
print("")
|
print("")
|
||||||
@@ -96,7 +96,7 @@ def makeDebianPackage(
|
|||||||
print("Copying or generating additional files ...")
|
print("Copying or generating additional files ...")
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
copyPackageFiles(outDir, setupPy=True)
|
copyPackageFiles(outDir, oldLicense=oldLicense)
|
||||||
|
|
||||||
# Copy/Write Debian Files
|
# Copy/Write Debian Files
|
||||||
# =======================
|
# =======================
|
||||||
@@ -181,14 +181,14 @@ def launchpad(args: argparse.Namespace) -> None:
|
|||||||
bldNum = "0"
|
bldNum = "0"
|
||||||
|
|
||||||
distLoop = [
|
distLoop = [
|
||||||
("24.04", "noble"),
|
("24.04", "noble", True),
|
||||||
("25.04", "plucky"),
|
("25.04", "plucky", True),
|
||||||
("25.10", "questing"),
|
("25.10", "questing", False),
|
||||||
]
|
]
|
||||||
|
|
||||||
print("Building Ubuntu packages for:")
|
print("Building Ubuntu packages for:")
|
||||||
print("")
|
print("")
|
||||||
for distNum, codeName in distLoop:
|
for distNum, codeName, _ in distLoop:
|
||||||
print(f" * Ubuntu {distNum} {codeName.title()}")
|
print(f" * Ubuntu {distNum} {codeName.title()}")
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ def launchpad(args: argparse.Namespace) -> None:
|
|||||||
print("")
|
print("")
|
||||||
|
|
||||||
dputCmd = []
|
dputCmd = []
|
||||||
for distNum, codeName in distLoop:
|
for distNum, codeName, oldLicense in distLoop:
|
||||||
buildName = f"ubuntu{distNum}.{bldNum}"
|
buildName = f"ubuntu{distNum}.{bldNum}"
|
||||||
dCmd = makeDebianPackage(
|
dCmd = makeDebianPackage(
|
||||||
signKey=signKey,
|
signKey=signKey,
|
||||||
@@ -206,6 +206,7 @@ def launchpad(args: argparse.Namespace) -> None:
|
|||||||
distName=codeName,
|
distName=codeName,
|
||||||
buildName=buildName,
|
buildName=buildName,
|
||||||
forLaunchpad=True,
|
forLaunchpad=True,
|
||||||
|
oldLicense=oldLicense,
|
||||||
)
|
)
|
||||||
dputCmd.append(dCmd)
|
dputCmd.append(dCmd)
|
||||||
|
|
||||||
|
|||||||
+12
-8
@@ -91,27 +91,31 @@ def copySourceCode(dst: Path) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def copyPackageFiles(dst: Path, setupPy: bool = False) -> None:
|
def copyPackageFiles(dst: Path, oldLicense: bool = False) -> None:
|
||||||
"""Copy files needed for packaging."""
|
"""Copy files needed for packaging."""
|
||||||
copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"]
|
copyFiles = ["LICENSE.md", "setup/LICENSE-Apache-2.0.txt", "CREDITS.md", "pyproject.toml"]
|
||||||
for copyFile in copyFiles:
|
for copyFile in copyFiles:
|
||||||
shutil.copyfile(copyFile, dst / copyFile)
|
shutil.copyfile(copyFile, dst / copyFile)
|
||||||
print("Copied:", copyFile, flush=True)
|
print("Copied:", copyFile, flush=True)
|
||||||
|
|
||||||
writeFile(dst / "MANIFEST.in", (
|
writeFile(dst / "MANIFEST.in", (
|
||||||
"include LICENSE.md\n"
|
"include LICENSE.md\n"
|
||||||
|
"include setup/LICENSE-Apache-2.0.txt\n"
|
||||||
"include CREDITS.md\n"
|
"include CREDITS.md\n"
|
||||||
"recursive-include novelwriter/assets *\n"
|
"recursive-include novelwriter/assets *\n"
|
||||||
))
|
))
|
||||||
|
|
||||||
if setupPy:
|
|
||||||
writeFile(dst / "setup.py", (
|
|
||||||
"import setuptools\n"
|
|
||||||
"setuptools.setup()\n"
|
|
||||||
))
|
|
||||||
|
|
||||||
text = readFile(ROOT_DIR / "pyproject.toml")
|
text = readFile(ROOT_DIR / "pyproject.toml")
|
||||||
text = text.replace("setup/description_pypi.md", "data/description_short.txt")
|
text = text.replace("setup/description_pypi.md", "data/description_short.txt")
|
||||||
|
if oldLicense:
|
||||||
|
new = []
|
||||||
|
for line in text.splitlines():
|
||||||
|
if line.startswith("license = "):
|
||||||
|
line = 'license = {text = "GPL-3.0-or-later AND Apache-2.0 AND CC-BY-4.0"}'
|
||||||
|
if line.startswith("license-files = "):
|
||||||
|
continue
|
||||||
|
new.append(line)
|
||||||
|
text = "\n".join(new)
|
||||||
writeFile(dst / "pyproject.toml", text)
|
writeFile(dst / "pyproject.toml", text)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user