Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
max-parallel: 4
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

defaults:
run:
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -61,13 +61,20 @@ jobs:
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true' && matrix.os != 'MacOS'
run: timeout 10s poetry run pip --version || rm -rf .venv
if: steps.cache.outputs.cache-hit == 'true'
run: |
# `timeout` is not available on macOS, so we define a custom function.
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
timeout 10s poetry run pip --version || rm -rf .venv

- name: Install dependencies
shell: bash
run: poetry install

- name: Run mypy
run: poetry run mypy

- name: Run pytest
shell: bash
run: poetry run pytest -v tests
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,30 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get tag
id: tag
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}

- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7

- name: Install dependencies
run: python -m pip install --upgrade pip poetry --pre
run: python -m pip install --upgrade pip poetry

- name: Build project
run: poetry build

- name: Publish release to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build
poetry publish

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
72 changes: 33 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,58 @@
ci:
autofix_prs: false

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
hooks:
- id: pyupgrade
args:
- --py37-plus

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/hadialqattan/pycln
rev: v2.1.1
hooks:
- id: pycln
args: [--all]

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.4.0
hooks:
- id: yesqa
additional_dependencies: &flake8_deps
- flake8-broken-line==0.4.0
- flake8-bugbear==22.7.1
- flake8-broken-line==0.5.0
- flake8-bugbear==22.8.23
- flake8-comprehensions==3.10.0
- flake8-eradicate==1.2.1
- flake8-eradicate==1.3.0
- flake8-quotes==3.3.1
- flake8-simplify==0.19.2
- flake8-simplify==0.19.3
- flake8-tidy-imports==4.8.0
- flake8-type-checking==2.0.3
- flake8-typing-imports==1.12.0
- flake8-use-fstring==1.3
- pep8-naming==0.13.0
- flake8-type-checking==2.1.2
- flake8-typing-imports==1.13.0
- flake8-use-fstring==1.4
- pep8-naming==0.13.2

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: *flake8_deps

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: [--add-import, from __future__ import annotations]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
exclude: ^tests/.*/fixtures/.*
- id: end-of-file-fixer
exclude: ^tests/.*/fixtures/.*
- id: debug-statements

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
pass_filenames: false
additional_dependencies:
- pytest>=7.1.2

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.2
hooks:
- id: pyupgrade
args:
- --py37-plus

- repo: https://github.com/hadialqattan/pycln
rev: v2.0.4
hooks:
- id: pycln
args: [--all]
2 changes: 1 addition & 1 deletion crashtest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations


__version__ = "0.4.0"
__version__ = "0.4.1"
4 changes: 2 additions & 2 deletions crashtest/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@


class Inspector:
def __init__(self, exception: Exception):
def __init__(self, exception: BaseException):
self._exception = exception
self._frames: FrameCollection | None = None
self._outer_frames = None
self._inner_frames = None
self._previous_exception = exception.__context__

@property
def exception(self) -> Exception:
def exception(self) -> BaseException:
return self._exception

@property
Expand Down
Loading