fix: do not use uv on PyPy 3.8
uv 0.2.25+ does not work with PyPy 3.8
Given PyPy 3.8 is EOL, just disable uv for this config rather than ask for it to be supported again in uv.
* set VSCMD_ARG_TGT_ARCH based on targetted architecture
* only set VSCMD_ARG_TGT_ARCH if not already set
* add unit tests to check setuptools correctly identifies windows arch
* only run tests on windows
* arm64 fails on azure pipelines (only)
* Update windows.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
Co-authored-by: Joe Rickerby <joerick@mac.com>
* update test_env_set to validate FatalError is raised on env collision
* remove noqa ARG001 (no longer needed)
---------
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>
* Refactor error handling to use exceptions
cibuildwheel has up until now handled most errors by printing an error message to sys.stderr and calling sys.exit. Others were handled using Logger.error, depending on the context. We also had return codes, but these weren't explicitly defined anywhere.
This makes that convention more explicit and codified. Now to halt the program, the correct thing to do is to throw a cibuildwheel.errors.FatalError exception - that is caught in main() and printed before exiting. The existing behaviour was kept - if an error occurs within a build step (probably something to do with the build itself), the Logger.error() method is used. Outside of a build step (e.g. a misconfiguration), the behaviour is still to print 'cibuildwheel: <message>'
I also took the opportunity to add a debugging option `--debug-traceback` (and `CIBW_DEBUG_TRACEBACK`), which you can enable to see a full traceback on errors.
(I've deactivated the flake8-errmsg lint rule, as it was throwing loads of errors and these error messages aren't generally seen in a traceback context)
* add noqa rule
* Apply suggestions from code review
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
* Return to flake8-errmsg conformance
* Code review suggestions
* Subclass Exception rather than SystemExit
* apply error handling to new code and fix merge issues
* Apply review suggestion
* fix: merge issue
* Update cibuildwheel/errors.py
---------
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: mayeut <mayeut@users.noreply.github.com>
Using `log.notice` result in many unwanted annotations, at least in GitHub Actions.
If we want to print some information about a specific file being moved, it shall be done by the caller - or adding an option to the function - and use `print`.
* replace `with suppress(FileNotFoundError)` by `.unlink(missing_ok=True)` for macos
* also use `.unlink(missing_ok=True)` in pyodide and windows for consistency
* remove contextlib imports which are no longer required
* Apply suggestions from code review
* explicity resolve and create output location
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* use explicit str for move
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* update comments based on review feedback
* Apply suggestions from code review
* Break out functionality to move files to util.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* raise instance of IsADirectoryError with meaningful message
* Don't need a comment and a exception message
---------
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>