[PATCH] packaging: adapt the macOS installer build to the core changes for PEP 517

2 views
Skip to first unread message

Matt Harbison

unread,
Mar 4, 2025, 11:07:11 PMMar 4
to thg...@googlegroups.com
# HG changeset patch
# User Matt Harbison <matt_h...@yahoo.com>
# Date 1741146320 18000
# Tue Mar 04 22:45:20 2025 -0500
# Branch stable
# Node ID ccbd943840fac6d3944740f6bf42e78a5205ad22
# Parent dabfd80081207823bf7097d71042e756a3b34da3
# EXP-Topic macos-packaging
packaging: adapt the macOS installer build to the core changes for PEP 517

Mercurial no longer supports direct invocation of `setup.py`, and `make local`
isn't equivalent to what was previously done. The easiest workaround is to
pip-install from source into the venv.

I considered installing the wheel, but I'd rather not manually manage the
version used via commits. Additionally, rc wheels aren't installed from PyPI by
default. I also tried an editable install, but py2app wasn't able to find
`hgext` or `mercurial`.

diff --git a/contrib/packaging/macos/build_py3.sh b/contrib/packaging/macos/build_py3.sh
--- a/contrib/packaging/macos/build_py3.sh
+++ b/contrib/packaging/macos/build_py3.sh
@@ -33,6 +33,7 @@
if [[ ! -e $VENV ]]; then
echo "Creating venv $VENV"
${PYTHON} -m venv --copies "${VENV}"
+ ${VENV}/bin/pip --disable-pip-version-check install -U 'pip>=24'
${VENV}/bin/pip --disable-pip-version-check install -U wheel==0.37.0
${VENV}/bin/pip --disable-pip-version-check install -r "${HERE}/requirements-pyqt${QT_MAJOR}.txt"
else
@@ -44,7 +45,7 @@
cd "${HERE}"

# build mercurial + tortoisehg
-toolchain/receipts/mercurial.sh
+${VENV}/bin/pip install --force-reinstall src/hg
toolchain/receipts/tortoisehg.sh

# CFVersion is always x.y.z format. The plain version will have changeset info
diff --git a/contrib/packaging/macos/toolchain/receipts/mercurial.sh b/contrib/packaging/macos/toolchain/receipts/mercurial.sh
deleted file mode 100755
--- a/contrib/packaging/macos/toolchain/receipts/mercurial.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/zsh
-
-set -euo pipefail
-
-. toolchain/build_settings.conf
-
-cd src/hg
-
-${PYTHON} setup.py clean
-${PYTHON} setup.py build
-${PYTHON} setup.py install

Yuya Nishihara

unread,
Mar 5, 2025, 5:16:29 AMMar 5
to Matt Harbison, thg...@googlegroups.com
On Tue, 04 Mar 2025 23:07:06 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_h...@yahoo.com>
> # Date 1741146320 18000
> # Tue Mar 04 22:45:20 2025 -0500
> # Branch stable
> # Node ID ccbd943840fac6d3944740f6bf42e78a5205ad22
> # Parent dabfd80081207823bf7097d71042e756a3b34da3
> # EXP-Topic macos-packaging
> packaging: adapt the macOS installer build to the core changes for PEP 517

Queued, thanks. (I don't understand the packaging stuff, but I trust you.)
Reply all
Reply to author
Forward
0 new messages