Skip to content

Commit 7a064c4

Browse files
0.9 (#6)
1 parent 343cd14 commit 7a064c4

18 files changed

+123
-46
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ ignore =
1313
# E303 too many blank lines
1414
E303,
1515

16+
# PT007 wrong values type in @pytest.mark.parametrize, expected list
17+
PT007,
18+
1619
max-line-length = 120
1720

1821
exclude =

.github/workflows/pre-commit.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Pre-Commit
2+
3+
on:
4+
pull_request:
5+
branches: [main, master]
6+
7+
jobs:
8+
main:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: '3.10'
15+
- uses: pre-commit/action@v3.0.0

.github/workflows/publish-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
with:
1414
ref: main
1515
- name: Set up Python 3.8
16-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.9
18+
python-version: '3.10'
1919

2020
- name: Install setuptools
2121
run: |

.github/workflows/run_tox.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: ['3.8', '3.9', '3.10']
11+
python-version: ['3.8', '3.9', '3.10', '3.11']
1212

1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v3
1515
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v4
1717
with:
1818
python-version: ${{ matrix.python-version }}
1919
- name: Install dependencies

.pre-commit-config.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88

99
- repo: https://github.com/pycqa/isort
10-
rev: 5.10.1
10+
rev: 5.12.0
1111
hooks:
1212
- id: isort
1313
name: isort (python)
1414

15-
- repo: https://gitlab.com/PyCQA/flake8
16-
rev: '3.9.2'
15+
16+
- repo: https://github.com/PyCQA/flake8
17+
rev: '6.0.0'
1718
hooks:
1819
- id: flake8
20+
additional_dependencies:
21+
- flake8-bugbear==23.1.20
22+
- flake8-comprehensions==3.10.1
23+
- flake8-pytest-style==1.6
24+
- flake8-noqa==1.3
25+
- pep8-naming==0.13.3
26+
27+
- repo: https://github.com/pre-commit/pygrep-hooks
28+
rev: v1.10.0
29+
hooks:
30+
- id: rst-backticks
31+
32+
33+
- repo: meta
34+
hooks:
35+
- id: check-hooks-apply
36+
- id: check-useless-excludes

readme.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,30 @@ This code will be executed
3636
```
3737

3838
# Changelog
39-
#### 0.8 (18.07.2022)
39+
#### 0.9 (2023-02-08)
40+
- If the whole shown code block is indented the indention is removed
41+
42+
#### 0.8 (2022-07-18)
4043
- Renamed ``exec_code_folders`` to ``exec_code_source_folders``
4144
- Changed type of parameter to specify stdout to a flag
4245
- Changed default for config parameter that sets encoding
4346
- Dropped support for Python 3.7
4447

45-
#### 0.7 (15.07.2022)
48+
#### 0.7 (2022-07-15)
4649
- Added config parameter to specify stdout encoding
4750
- Only empty lines of the output get trimmed
4851

49-
#### 0.6 (04.04.2022)
52+
#### 0.6 (2022-04-04)
5053
- Fixed an issue where the line numbers for error messages were not correct
5154

52-
#### 0.5 (10.03.2022)
55+
#### 0.5 (2022-03-10)
5356
- Marked as safe for parallel reading
5457

55-
#### 0.4 (09.03.2022)
58+
#### 0.4 (2022-03-09)
5659
- Added option to run code from example files
5760

58-
#### 0.3 (24.09.2021)
61+
#### 0.3 (2021-09-24)
5962
- Added some more documentation and fixed some false path warnings
6063

61-
#### 0.2 (21.09.2021)
64+
#### 0.2 (2021-09-21)
6265
- Initial Release

requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
pytest==7.1.2
2-
pre-commit==2.20.0
3-
sphinx==5.0.2
4-
sphinx-rtd-theme==1.0.0
1+
pytest >= 7.2, < 7.3
2+
pre-commit >= 3.0, < 3.1
3+
4+
sphinx >= 6.1, < 6.2
5+
sphinx-rtd-theme >= 1.2, <1.3

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def load_version() -> str:
5555
"Programming Language :: Python :: 3.8",
5656
"Programming Language :: Python :: 3.9",
5757
"Programming Language :: Python :: 3.10",
58+
"Programming Language :: Python :: 3.11",
5859
"Programming Language :: Python :: 3 :: Only",
5960
],
6061
)

src/sphinx_exec_code/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.8'
1+
__version__ = '0.9'

src/sphinx_exec_code/code_exec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from itertools import dropwhile
55
from pathlib import Path
66

7-
from sphinx_exec_code.code_exec_error import CodeException
7+
from sphinx_exec_code.code_exec_error import CodeExceptionError
88
from sphinx_exec_code.configuration import PYTHONPATH_FOLDERS, SET_UTF8_ENCODING, WORKING_DIR
99

1010

@@ -25,7 +25,7 @@ def execute_code(code: str, file: Path, first_loc: int) -> str:
2525
encoding=encoding, cwd=cwd, env=env)
2626

2727
if run.returncode != 0:
28-
raise CodeException(code, file, first_loc, run.returncode, run.stderr) from None
28+
raise CodeExceptionError(code, file, first_loc, run.returncode, run.stderr) from None
2929

3030
# decode output and drop tailing spaces
3131
ret_str = (run.stdout if run.stdout is not None else '' + run.stderr if run.stderr is not None else '').rstrip()

0 commit comments

Comments
 (0)