Skip to content

Commit

Permalink
Update Launchpad build
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Jan 15, 2025
1 parent 4b30ce0 commit 9388ea1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 82 deletions.
49 changes: 16 additions & 33 deletions pkgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def copySourceCode(dst: Path) -> None:
# 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."""

copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"]
Expand All @@ -655,24 +655,10 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) ->
))
print("Wrote: setup.py")

if useCfg:
# This is needed for Ubuntu up to 22.04
text = readFile(SETUP_DIR / "launchpad_setup.cfg")
text = text.replace("setup/description_pypi.md", "data/description_short.txt")
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")
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

Expand All @@ -683,7 +669,7 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) ->

def makeDebianPackage(
signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable",
buildName: str = "", oldSetuptools: bool = False, forLaunchpad: bool = False
buildName: str = "", forLaunchpad: bool = False
) -> str:
"""Build a Debian package."""
print("")
Expand Down Expand Up @@ -743,7 +729,7 @@ def makeDebianPackage(
print("Copying or generating additional files ...")
print("")

copyPackageFiles(outDir, setupPy=True, useCfg=oldSetuptools)
copyPackageFiles(outDir, setupPy=True)

# Copy/Write Debian Files
# =======================
Expand Down Expand Up @@ -830,22 +816,20 @@ def buildForLaunchpad(args: argparse.Namespace) -> None:
print("==================")
print("")

if args.first:
bldNum = "0"
if args.build:
bldNum = str(args.build)
else:
bldNum = input("Build number [0]: ")
if bldNum == "":
bldNum = "0"
bldNum = "0"

distLoop = [
("22.04", "jammy", True),
("24.04", "noble", False),
("24.10", "oracular", False),
("24.04", "noble"),
("24.10", "oracular"),
("25.04", "plucky"),
]

print("Building Ubuntu packages for:")
print("")
for distNum, codeName, _ in distLoop:
for distNum, codeName in distLoop:
print(f" * Ubuntu {distNum} {codeName.title()}")
print("")

Expand All @@ -855,14 +839,13 @@ def buildForLaunchpad(args: argparse.Namespace) -> None:
print("")

dputCmd = []
for distNum, codeName, oldSetup in distLoop:
for distNum, codeName in distLoop:
buildName = f"ubuntu{distNum}.{bldNum}"
dCmd = makeDebianPackage(
signKey=signKey,
sourceBuild=True,
distName=codeName,
buildName=buildName,
oldSetuptools=oldSetup,
forLaunchpad=True,
)
dputCmd.append(dCmd)
Expand Down Expand Up @@ -1579,7 +1562,7 @@ def xdgUninstall(args: argparse.Namespace) -> None:
)
)
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)

# Build AppImage
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pyqt6>=6.0
pyqt6>=6.4
pyenchant>=3.0.0
47 changes: 0 additions & 47 deletions setup/launchpad_setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion setup/make_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ echo " Building Linux Packages"
echo "================================================================================"
echo ""
python3 pkgutils.py build-deb --sign
python3 pkgutils.py build-ubuntu --sign --first
python3 pkgutils.py build-ubuntu --sign

0 comments on commit 9388ea1

Please sign in to comment.