* 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>
OCIContainer.container_engine -> OCIContainer.engine
OCIContainer.docker_image -> OCIContainer.image
Variables that refer to 'docker_images' have been renamed to
'container_images'
* Add test for defaults, fix platform detection
* Improve correctness of reader.identifier with block
* Fix options test to be multiplatform
* 'Refactored by Sourcery'
docs: write a section on overrides
tests: test docker launches
feat: add identifiers to launches
test: add test for correct build step generation
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
* feat: configuration support
* refactor: include manylinux, minor redesign
* "project global" overrides "default platform"
This allows overriding `repair-wheel-command` in the `[tool.cibuildwheel.global]` section.
* fix: add PyPy images
* refactor: remove global
* fix: support tables and arrays
* docs: add pyproject.toml config to docs
* docs: updates based on feedback
* fix: only join if sensible
* refactor: remove manylinux dict
* docs: examples headers and sections on each
* feat: support changing the config from the command line
* fix: use {package}
* tests: add a few tests and mention config one more place
* Restyle examples tabs to remove indent
* Unrelated docs improvements
* Absorb extra content into the tab
* Make the tabs smaller and to the right
* Copy edits to options
* Fix header ids
* Use fewer [tool.cibuildwheel] headers
* docs: minor additions/fixes
* feat: disallow options on some platforms
* docs: make the examples a tiny bit more tabby
* fix: enforce tables/lists are optionally separate
* Some unrelated fixes to the other tab styling
* Minor fix to tab styling
* Refactor to make code a bit more linear and immutable
* Minor docs changes
Co-authored-by: mayeut <mayeut@users.noreply.github.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>
* Add CPython 3.10 support
* Fix logger displaying CPython 3.1 instead of 3.10
* Fix tests failing with CPython 3.10
* Use pytest instead of nose
* feat: --pre flag
Apply suggestions from code review
Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
* fix: update Python update script to process beta versions
* refactor: prerelease-pythons
* Use `strtobool` to parse `CIBW_PRERELEASE_PYTHONS` env var
* Update python version filtering for universal2 & arm64
* Filter out CPython 3.10 and above for `test_manylinuxXXXX_only[manylinux1]` test
* Use CIBW_BUILD filtering rather than CIBW_SKIP for test_docker_images
* Use skip_patterns to filter out pre-releases
* Use `prerelease_pythons` instead of `pre`
* Reword `CIBW_PRERELEASE_PYTHONS` doc per review.
* Use `CIBW_PRERELEASE_PYTHONS: True` for usage example.
* Update `cibuildwheel --help` doc
* docs: add note on spec.filter
* Clean up the BuildSelector __repr__ by refactoring
* fix: remove platform variants for CIBW_PRERELEASE_PYTHONS
* docs: mention the flag
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Joe Rickerby <joerick@mac.com>
* feat: requires-python
refactor: updating to current proposal
fix: add tests and fix a few issues
docs: Update mostly from @joerick
docs: update README from readthedocs
* refactor: pull out config file reading
* fix: always assume highest Python patch version
* refactor: try new design
* refactor: function and bump MyPy to 0.800
* fix: tighten AST to call only, add docs
* fix: address review points from @joerick