Skip to content

Commit c9b7dfa

Browse files
authored
Merge pull request #10 from Secrus/various-improvements
Various improvements
2 parents 8435ee7 + c3e4c89 commit c9b7dfa

File tree

7 files changed

+257
-93
lines changed

7 files changed

+257
-93
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
max-parallel: 4
1919
matrix:
2020
os: [Ubuntu, MacOS, Windows]
21-
python-version: [3.7, 3.8, 3.9, "3.10"]
21+
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
2222

2323
defaults:
2424
run:
@@ -28,7 +28,7 @@ jobs:
2828
- uses: actions/checkout@v3
2929

3030
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v3
31+
uses: actions/setup-python@v4
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434

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

6363
- name: Ensure cache is healthy
64-
if: steps.cache.outputs.cache-hit == 'true' && matrix.os != 'MacOS'
65-
run: timeout 10s poetry run pip --version || rm -rf .venv
64+
if: steps.cache.outputs.cache-hit == 'true'
65+
run: |
66+
# `timeout` is not available on macOS, so we define a custom function.
67+
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
68+
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
69+
timeout 10s poetry run pip --version || rm -rf .venv
6670
6771
- name: Install dependencies
6872
shell: bash
6973
run: poetry install
7074

75+
- name: Run mypy
76+
run: poetry run mypy
77+
7178
- name: Run pytest
7279
shell: bash
7380
run: poetry run pytest -v tests

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,30 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
13+
1314
- name: Get tag
1415
id: tag
1516
run: |
1617
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
18+
1719
- name: Set up Python 3.7
18-
uses: actions/setup-python@v1
20+
uses: actions/setup-python@v4
1921
with:
2022
python-version: 3.7
23+
2124
- name: Install dependencies
22-
run: python -m pip install --upgrade pip poetry --pre
25+
run: python -m pip install --upgrade pip poetry
26+
27+
- name: Build project
28+
run: poetry build
29+
2330
- name: Publish release to PyPI
2431
env:
2532
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
2633
run: |
27-
poetry build
2834
poetry publish
35+
2936
- name: Create Release
3037
id: create_release
3138
uses: actions/create-release@v1

.pre-commit-config.yaml

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,58 @@
1+
ci:
2+
autofix_prs: false
3+
14
repos:
5+
- repo: https://github.com/asottile/pyupgrade
6+
rev: v2.38.2
7+
hooks:
8+
- id: pyupgrade
9+
args:
10+
- --py37-plus
11+
12+
- repo: https://github.com/pycqa/isort
13+
rev: 5.10.1
14+
hooks:
15+
- id: isort
16+
17+
- repo: https://github.com/hadialqattan/pycln
18+
rev: v2.1.1
19+
hooks:
20+
- id: pycln
21+
args: [--all]
22+
223
- repo: https://github.com/psf/black
3-
rev: 22.6.0
24+
rev: 22.8.0
425
hooks:
526
- id: black
627

728
- repo: https://github.com/asottile/yesqa
8-
rev: v1.3.0
29+
rev: v1.4.0
930
hooks:
1031
- id: yesqa
1132
additional_dependencies: &flake8_deps
12-
- flake8-broken-line==0.4.0
13-
- flake8-bugbear==22.7.1
33+
- flake8-broken-line==0.5.0
34+
- flake8-bugbear==22.8.23
1435
- flake8-comprehensions==3.10.0
15-
- flake8-eradicate==1.2.1
36+
- flake8-eradicate==1.3.0
1637
- flake8-quotes==3.3.1
17-
- flake8-simplify==0.19.2
38+
- flake8-simplify==0.19.3
1839
- flake8-tidy-imports==4.8.0
19-
- flake8-type-checking==2.0.3
20-
- flake8-typing-imports==1.12.0
21-
- flake8-use-fstring==1.3
22-
- pep8-naming==0.13.0
40+
- flake8-type-checking==2.1.2
41+
- flake8-typing-imports==1.13.0
42+
- flake8-use-fstring==1.4
43+
- pep8-naming==0.13.2
2344

2445
- repo: https://github.com/pycqa/flake8
25-
rev: 4.0.1
46+
rev: 5.0.4
2647
hooks:
2748
- id: flake8
2849
additional_dependencies: *flake8_deps
2950

30-
- repo: https://github.com/pycqa/isort
31-
rev: 5.10.1
32-
hooks:
33-
- id: isort
34-
args: [--add-import, from __future__ import annotations]
35-
3651
- repo: https://github.com/pre-commit/pre-commit-hooks
37-
rev: v2.3.0
52+
rev: v4.3.0
3853
hooks:
3954
- id: trailing-whitespace
4055
exclude: ^tests/.*/fixtures/.*
4156
- id: end-of-file-fixer
4257
exclude: ^tests/.*/fixtures/.*
4358
- id: debug-statements
44-
45-
- repo: https://github.com/pre-commit/mirrors-mypy
46-
rev: v0.971
47-
hooks:
48-
- id: mypy
49-
pass_filenames: false
50-
additional_dependencies:
51-
- pytest>=7.1.2
52-
53-
- repo: https://github.com/asottile/pyupgrade
54-
rev: v2.37.2
55-
hooks:
56-
- id: pyupgrade
57-
args:
58-
- --py37-plus
59-
60-
- repo: https://github.com/hadialqattan/pycln
61-
rev: v2.0.4
62-
hooks:
63-
- id: pycln
64-
args: [--all]

crashtest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import annotations
22

33

4-
__version__ = "0.4.0"
4+
__version__ = "0.4.1"

crashtest/inspector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88

99
class Inspector:
10-
def __init__(self, exception: Exception):
10+
def __init__(self, exception: BaseException):
1111
self._exception = exception
1212
self._frames: FrameCollection | None = None
1313
self._outer_frames = None
1414
self._inner_frames = None
1515
self._previous_exception = exception.__context__
1616

1717
@property
18-
def exception(self) -> Exception:
18+
def exception(self) -> BaseException:
1919
return self._exception
2020

2121
@property

0 commit comments

Comments
 (0)