##// END OF EJS Templates
manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940)...
manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940) Since Python 2.7 and 3.5, `typing.ByteString` was defined as an alias for `bytes | bytearray | memoryview`, and `bytes` was also accepted as a shorthand for this, so we have `bytes` sprinkled all over the codebase. But then PEP-688 reversed all of that by deprecating `typing.ByteString` and its successor `collections.abc.ByteString` in Python 3.12 (as well as the `bytes` shorthand)[1], and removing it completely in Python 3.14. That leaves us with a couple of problems, namely defining something useful that spans py3.8-py3.13 and keeps pytype happy, and finding all of the instances where `bytes` doesn't really mean `bytes`. The current successor to all of this is `collections.abc.Buffer` in Python 3.12 (or `typing_extensions.Buffer` in previous versions). However, the current CI does type checking using Python 3.11 (so the former is not avaiable), and pytype has issues with importing `typing_extensions.Buffer`[2]. The good news is we don't need to deal with this mess immediately, since the type annotation evaluation is delayed to the type checking phase, and we're making no effort at supporting it in all supported versions of Python. So by delaying the import of this particular symbol, we can still use it for type checking purposes, but can start assessing Python 3.14 problems without doing a lot of extra work. Putting this on stable will allow people interested in 3.14 to work on it 4-5 extra months earlier (and apparently there's some interest). [1] https://peps.python.org/pep-0688/#no-special-meaning-for-bytes [2] https://github.com/google/pytype/issues/1772

File last commit:

r53167:6aa4ee2b stable
r53224:0851d94b stable
Show More
build-macos-wheels.sh
35 lines | 1.1 KiB | application/x-sh | BashLexer
#!/bin/sh
# This is a convenience script to build all of the wheels outside of the CI
# system. It requires the cibuildwheel package to be installed, and the
# executable on PATH, as well as `msgfmt` from gettext, which can be installed
# with `brew` as follows:
#
# $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# $ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
# <logout>
# $ brew install gettext
#
# A system-wide installation of the version of python corresponding to each
# wheel is required. They can be installed by this script by setting `CI=true`
# in the environment before running it, and providing the `sudo` password when
# prompted.
set -e
# Build translations; requires msgfmt on PATH.
export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
if ! which msgfmt 2>/dev/null 1>/dev/null; then
echo "msgfmt executable not found" >&2
exit 1
fi
# Prevent building pypy wheels, which is broken.
export CIBW_SKIP=pp*
export CIBW_ARCHS=universal2
# TODO: purge the repo?
cibuildwheel --output-dir dist/wheels