Update Launchpad build

This commit is contained in:
Veronica Berglyd Olsen
2025-01-16 00:23:14 +01:00
parent 4b30ce0f39
commit 9388ea12f9
4 changed files with 18 additions and 82 deletions
+16 -33
View File
@@ -633,7 +633,7 @@ def copySourceCode(dst: Path) -> None:
# Copy Package Files # Copy Package Files
## ##
def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) -> None: def copyPackageFiles(dst: Path, setupPy: bool = False) -> None:
"""Copy files needed for packaging.""" """Copy files needed for packaging."""
copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"] copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"]
@@ -655,24 +655,10 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) ->
)) ))
print("Wrote: setup.py") print("Wrote: setup.py")
if useCfg: text = readFile(CURR_DIR / "pyproject.toml")
# This is needed for Ubuntu up to 22.04 text = text.replace("setup/description_pypi.md", "data/description_short.txt")
text = readFile(SETUP_DIR / "launchpad_setup.cfg") writeFile(dst / "pyproject.toml", text)
text = text.replace("setup/description_pypi.md", "data/description_short.txt") print("Wrote: pyproject.toml")
writeFile(dst / "setup.cfg", text)
print("Wrote: setup.cfg")
writeFile(dst / "pyproject.toml", (
"[build-system]\n"
"requires = [\"setuptools\"]\n"
"build-backend = \"setuptools.build_meta\"\n"
))
print("Wrote: pyproject.toml")
else:
text = readFile(CURR_DIR / "pyproject.toml")
text = text.replace("setup/description_pypi.md", "data/description_short.txt")
writeFile(dst / "pyproject.toml", text)
print("Wrote: pyproject.toml")
return return
@@ -683,7 +669,7 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) ->
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 = "", oldSetuptools: bool = False, forLaunchpad: bool = False buildName: str = "", forLaunchpad: bool = False
) -> str: ) -> str:
"""Build a Debian package.""" """Build a Debian package."""
print("") print("")
@@ -743,7 +729,7 @@ def makeDebianPackage(
print("Copying or generating additional files ...") print("Copying or generating additional files ...")
print("") print("")
copyPackageFiles(outDir, setupPy=True, useCfg=oldSetuptools) copyPackageFiles(outDir, setupPy=True)
# Copy/Write Debian Files # Copy/Write Debian Files
# ======================= # =======================
@@ -830,22 +816,20 @@ def buildForLaunchpad(args: argparse.Namespace) -> None:
print("==================") print("==================")
print("") print("")
if args.first: if args.build:
bldNum = "0" bldNum = str(args.build)
else: else:
bldNum = input("Build number [0]: ") bldNum = "0"
if bldNum == "":
bldNum = "0"
distLoop = [ distLoop = [
("22.04", "jammy", True), ("24.04", "noble"),
("24.04", "noble", False), ("24.10", "oracular"),
("24.10", "oracular", False), ("25.04", "plucky"),
] ]
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("")
@@ -855,14 +839,13 @@ def buildForLaunchpad(args: argparse.Namespace) -> None:
print("") print("")
dputCmd = [] dputCmd = []
for distNum, codeName, oldSetup in distLoop: for distNum, codeName in distLoop:
buildName = f"ubuntu{distNum}.{bldNum}" buildName = f"ubuntu{distNum}.{bldNum}"
dCmd = makeDebianPackage( dCmd = makeDebianPackage(
signKey=signKey, signKey=signKey,
sourceBuild=True, sourceBuild=True,
distName=codeName, distName=codeName,
buildName=buildName, buildName=buildName,
oldSetuptools=oldSetup,
forLaunchpad=True, forLaunchpad=True,
) )
dputCmd.append(dCmd) dputCmd.append(dCmd)
@@ -1579,7 +1562,7 @@ if __name__ == "__main__":
) )
) )
cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.") cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.")
cmdBuildUbuntu.add_argument("--first", action="store_true", help="Set build number to 0.") cmdBuildUbuntu.add_argument("--build", type=int, help="Set build number.")
cmdBuildUbuntu.set_defaults(func=buildForLaunchpad) cmdBuildUbuntu.set_defaults(func=buildForLaunchpad)
# Build AppImage # Build AppImage
+1 -1
View File
@@ -1,2 +1,2 @@
pyqt6>=6.0 pyqt6>=6.4
pyenchant>=3.0.0 pyenchant>=3.0.0
-47
View File
@@ -1,47 +0,0 @@
[metadata]
name = novelWriter
version = attr: novelwriter.__version__
author = Veronica Berglyd Olsen
author_email = code@vkbo.net
description = A markdown-like text editor for planning and writing novels
url = https://novelwriter.io
long_description = file: setup/description_pypi.md
long_description_content_type = text/markdown
license_files = LICENSE.md
license = GNU General Public License v3
classifiers =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Development Status :: 5 - Production/Stable
Operating System :: OS Independent
Intended Audience :: End Users/Desktop
Natural Language :: English
Topic :: Text Editors
project_urls =
Bug Tracker = https://github.com/vkbo/novelWriter/issues
Documentation = https://docs.novelwriter.io
Source Code = https://github.com/vkbo/novelWriter
[options]
zip_safe = False
python_requires = >=3.10
include_package_data = True
packages = find_namespace:
install_requires =
pyqt5>=5.15
pyenchant>=3.0.0
[options.packages.find]
include = novelwriter*
[options.entry_points]
gui_scripts =
novelwriter = novelwriter:main
[bdist_wheel]
universal = 0
+1 -1
View File
@@ -25,4 +25,4 @@ echo " Building Linux Packages"
echo "================================================================================" echo "================================================================================"
echo "" echo ""
python3 pkgutils.py build-deb --sign python3 pkgutils.py build-deb --sign
python3 pkgutils.py build-ubuntu --sign --first python3 pkgutils.py build-ubuntu --sign