Skip to content

Commit 53ee733

Browse files
authored
Merge pull request #5 from pomponchik/develop
0.0.5
2 parents 91c74f8 + c51e7cb commit 53ee733

7 files changed

Lines changed: 77 additions & 75 deletions

File tree

.github/workflows/lint.yml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
name: Lint
22

3-
on:
4-
push
3+
on: push
54

65
jobs:
76
build:
8-
97
runs-on: ubuntu-latest
108
strategy:
119
matrix:
12-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
10+
python-version:
11+
["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
1312

1413
steps:
15-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1615

17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v3
19-
with:
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
2019
python-version: ${{ matrix.python-version }}
2120

22-
- name: Install dependencies
23-
shell: bash
24-
run: pip install -r requirements_dev.txt
21+
- name: Install dependencies
22+
shell: bash
23+
run: pip install -r requirements_dev.txt
2524

26-
- name: Install the library
27-
shell: bash
28-
run: pip install .
25+
- name: Install the library
26+
shell: bash
27+
run: pip install .
2928

30-
- name: Run mypy
31-
shell: bash
32-
run: mypy displayhooks --strict
29+
- name: Run mypy
30+
shell: bash
31+
run: mypy displayhooks --strict
3332

34-
- name: Run mypy for tests
35-
shell: bash
36-
run: mypy tests
33+
- name: Run mypy for tests
34+
shell: bash
35+
run: mypy tests
3736

38-
- name: Run ruff
39-
shell: bash
40-
run: ruff check displayhooks
37+
- name: Run ruff
38+
shell: bash
39+
run: ruff check displayhooks
4140

42-
- name: Run ruff for tests
43-
shell: bash
44-
run: ruff check tests
41+
- name: Run ruff for tests
42+
shell: bash
43+
run: ruff check tests

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
# IMPORTANT: this permission is mandatory for trusted publishing
1616
id-token: write
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919

2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v1
21+
uses: actions/setup-python@v5
2222
with:
23-
python-version: ${{ matrix.python-version }}
23+
python-version: ${{ matrix.python-version }}
2424

2525
- name: Install dependencies
2626
shell: bash
Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
name: Tests
22

3-
on:
4-
push
3+
on: push
54

65
jobs:
76
build:
8-
97
runs-on: ${{ matrix.os }}
108
strategy:
119
matrix:
1210
os: [macos-latest, ubuntu-latest, windows-latest]
13-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
11+
python-version:
12+
["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
1413

1514
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v3
19-
with:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
2019
python-version: ${{ matrix.python-version }}
2120

22-
- name: Install the library
23-
shell: bash
24-
run: pip install .
25-
26-
- name: Install dependencies
27-
shell: bash
28-
run: pip install -r requirements_dev.txt
29-
30-
- name: Print all libs
31-
shell: bash
32-
run: pip list
33-
34-
- name: Run tests and show coverage on the command line
35-
run: coverage run --source=displayhooks --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=100
36-
37-
- name: Upload reports to codecov
38-
env:
39-
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
40-
if: runner.os == 'Linux'
41-
run: |
42-
curl -Os https://uploader.codecov.io/latest/linux/codecov
43-
find . -iregex "codecov.*"
44-
chmod +x codecov
45-
./codecov -t ${CODECOV_TOKEN}
46-
47-
- name: Run tests and show the branch coverage on the command line
48-
run: coverage run --branch --source=displayhooks --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=100
21+
- name: Install the library
22+
shell: bash
23+
run: pip install .
24+
25+
- name: Install dependencies
26+
shell: bash
27+
run: pip install -r requirements_dev.txt
28+
29+
- name: Print all libs
30+
shell: bash
31+
run: pip list
32+
33+
- name: Run tests and show coverage on the command line
34+
run: |
35+
coverage run --source=displayhooks --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=100
36+
coverage xml
37+
38+
- name: Upload coverage to Coveralls
39+
if: runner.os == 'Linux'
40+
env:
41+
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
42+
uses: coverallsapp/github-action@v2
43+
with:
44+
format: cobertura
45+
file: coverage.xml
46+
47+
- name: Run tests and show the branch coverage on the command line
48+
run: coverage run --branch --source=displayhooks --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=100

README.md

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

33
[![Downloads](https://static.pepy.tech/badge/displayhooks/month)](https://pepy.tech/project/displayhooks)
44
[![Downloads](https://static.pepy.tech/badge/displayhooks)](https://pepy.tech/project/displayhooks)
5-
[![codecov](https://codecov.io/gh/pomponchik/displayhooks/graph/badge.svg?token=UXXTj1AIcT)](https://codecov.io/gh/pomponchik/displayhooks)
5+
[![Coverage Status](https://coveralls.io/repos/github/pomponchik/displayhooks/badge.svg?branch=main)](https://coveralls.io/github/pomponchik/displayhooks?branch=main)
66
[![Lines of code](https://sloc.xyz/github/pomponchik/displayhooks/?category=code)](https://github.com/boyter/scc/)
77
[![Hits-of-Code](https://hitsofcode.com/github/pomponchik/displayhooks?branch=main)](https://hitsofcode.com/github/pomponchik/displayhooks/view?branch=main)
88
[![Test-Package](https://github.com/pomponchik/displayhooks/actions/workflows/tests_and_coverage.yml/badge.svg)](https://github.com/pomponchik/metronomes/actions/workflows/tests_and_coverage.yml)
@@ -16,9 +16,9 @@ It's a micro library for manipulating [`sys.displayhook`](https://docs.python.or
1616

1717
When you need to change the standard behavior of `displayhook`, with this library you will do it:
1818

19-
- declaratively
20-
- compactly
21-
- beautifully
19+
- 💎 declaratively
20+
- 🫥 compactly
21+
- 🌞 beautifully
2222

2323

2424
## Table of contents

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
44

55
[project]
66
name = 'displayhooks'
7-
version = '0.0.4'
7+
version = '0.0.5'
88
authors = [
99
{ name='Evgeniy Blinov', email='zheni-b@yandex.ru' },
1010
]
@@ -25,6 +25,7 @@ classifiers = [
2525
'Programming Language :: Python :: 3.11',
2626
'Programming Language :: Python :: 3.12',
2727
'Programming Language :: Python :: 3.13',
28+
'Programming Language :: Python :: 3.14',
2829
'License :: OSI Approved :: MIT License',
2930
'Topic :: Software Development :: Libraries',
3031
'Intended Audience :: Developers',

requirements_dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
pytest==7.4.3
1+
pytest==8.3.5
22
pytest-timeout==2.2.0
33
coverage==7.6.1
44
twine==6.1.0
55
wheel==0.41.2
66
build==1.2.2.post1
7-
ruff==0.9.9
7+
ruff==0.14.5
88
mypy==1.14.1
99
mutmut==3.2.3
10-
full_match==0.0.2
10+
full_match==0.0.3

tests/test_autorestore.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import sys
22

33
import pytest
4-
import full_match
4+
from full_match import match
55

66
from displayhooks import autorestore_displayhook
77

88

99
def test_restore():
1010
hook_before_declaration = sys.displayhook
11+
1112
@autorestore_displayhook
1213
def do_something():
1314
sys.displayhook = 5
@@ -22,14 +23,15 @@ def do_something():
2223

2324
def test_restore_after_exception():
2425
hook_before_declaration = sys.displayhook
26+
2527
@autorestore_displayhook
2628
def do_something():
2729
sys.displayhook = 5
28-
raise ValueError('message')
30+
raise ValueError("message")
2931

3032
hook_before_calling = sys.displayhook
3133

32-
with pytest.raises(ValueError, match=full_match('message')):
34+
with pytest.raises(ValueError, match=match("message")):
3335
do_something()
3436

3537
assert hook_before_declaration is sys.displayhook

0 commit comments

Comments
 (0)