##// 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:

r53162:ea9cbb0f stable
r53224:0851d94b stable
Show More
build-windows-wheels.bat
37 lines | 1.2 KiB | application/x-msdownload | BatchLexer
/ contrib / packaging / build-windows-wheels.bat
@echo off
REM - This is a convenience script to build all of the wheels outside of the CI
REM - system. It requires the cibuildwheel package to be installed, and the
REM - executable on PATH, as well as `msgfmt.exe` from gettext and the x86,
REM - amd64, and arm64 compilers from VS BuildTools. These can be obtained by
REM - running `contrib/install-windows-dependencies.ps1`.
REM - None of the variable set here live past this script exiting.
setlocal
REM - Build translations; requires msgfmt.exe on PATH.
set MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
REM - Prevent building pypy wheels, which is broken.
set CIBW_SKIP=pp*
REM - Disable warning about not being able to test without an arm64 runner.
set CIBW_TEST_SKIP=*-win_arm64
REM - arm64 support starts with py39, but the first arm64 installer wasn't
REM - available until py311, so skip arm64 on the older, EOL versions.
set CIBW_ARCHS=x86 AMD64
set CIBW_BUILD=cp38-* cp39-* cp310-*
cibuildwheel --output-dir dist/wheels
if %errorlevel% neq 0 exit /b %errorlevel%
set CIBW_ARCHS=x86 AMD64 ARM64
set CIBW_BUILD=cp311-* cp312-* cp313-*
cibuildwheel --output-dir dist/wheels
if %errorlevel% neq 0 exit /b %errorlevel%