Mercurial > public > mercurial-scm > hg-stable
view contrib/editmerge @ 53012:0e2be2abd963
contrib: add modern `setuptools` and `setuptools_scm` to the packaging venv
With `py -3.9 contrib/packaging/packaging.py wix --pyoxidizer-target x86_64-pc-windows-msvc`,
there is an immediate failure after building the venv (3.9.13 has `setuptools`
58.1.0):
ModuleNotFoundError: No module named 'setuptools.command.build'
With that fixed, the same command then fails immediately with this error:
Couldn't import setuptools_scm (direct call of setup.py?)
Unfortunately, referencing `setuptools` in the requirements file needs
`--allow-unsafe` to avoid a warning about not pinning `setuptools`. However,
the same warning happens if `setuptools` is pinned to a specific revision, so I
have no idea what it is complaining about. It's a separate venv that is only
used for packaging, so we can fix it if it becomes a problem in the future.
Interestingly, the Inno installer build doesn't fail immediately, and I can see
it installing `setuptools` and `setuptools_scm` in the wall of text it emits.
Eventually it does fail with the same errors without this change.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 24 Feb 2025 11:29:46 -0500 |
parents | 612502900a2d |
children |
line wrap: on
line source
#!/usr/bin/env bash # A simple script for opening merge conflicts in the editor. # Use the following Mercurial settings to enable it. # # [ui] # merge = editmerge # # [merge-tools] # editmerge.args=$output # editmerge.check=changed # editmerge.premerge=keep FILE="$1" getlines() { grep -n "^<<<<<<" "$FILE" | cut -f1 -d: } # editor preference loosely based on https://mercurial-scm.org/wiki/editor # hg showconfig is at the bottom though, since it's slow to run (0.15 seconds) ED="$HGEDITOR" if [ "$ED" = "" ] ; then ED="$VISUAL" fi if [ "$ED" = "" ] ; then ED="$EDITOR" fi if [ "$ED" = "" ] ; then ED="$(hg showconfig ui.editor)" fi if [ "$ED" = "" ] ; then echo "merge failed - unable to find editor" exit 1 fi if [ "$ED" = "emacs" ] || [ "$ED" = "nano" ] || [ "$ED" = "vim" ] ; then FIRSTLINE="$(getlines | head -n 1)" PREVIOUSLINE="" # open the editor to the first conflict until there are no more # or the user stops editing the file while [ ! "$FIRSTLINE" = "" ] && [ ! "$FIRSTLINE" = "$PREVIOUSLINE" ] ; do $ED "+$FIRSTLINE" "$FILE" PREVIOUSLINE="$FIRSTLINE" FIRSTLINE="$(getlines | head -n 1)" done else $ED "$FILE" fi # get the line numbers of the remaining conflicts CONFLICTS="$(getlines | sed ':a;N;$!ba;s/\n/, /g')" if [ ! "$CONFLICTS" = "" ] ; then echo "merge failed - resolve the conflicts (line $CONFLICTS) then use 'hg resolve --mark'" exit 1 fi exit 0