Skip to content

Commit a491775

Browse files
0.15 (#16)
1 parent 03eb760 commit a491775

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: trailing-whitespace
1414

1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.6.9
16+
rev: v0.7.4
1717
hooks:
1818
- id: ruff
1919
name: ruff unused imports

.ruff.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ ignore = [
5959

6060
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
6161
"RUF005", # Consider {expression} instead of concatenation
62+
63+
# https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
64+
"PT007", # Wrong values type in @pytest.mark.parametrize expected {values} of {row}
6265
]
6366

6467

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ This code will be executed
3636
```
3737

3838
# Changelog
39+
#### 0.15 (2024-12-10)
40+
- Removed confusing log output
41+
3942
#### 0.14 (2024-11-15)
4043
- Add support for all options from code block
4144
- Reworked how blocks and options are processed

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ sphinx == 7.1.2; python_version == '3.8'
66

77
# Current dependencies
88
pre-commit == 4.0.1; python_version >= '3.9'
9-
pytest == 8.3.3; python_version >= '3.10'
9+
pytest == 8.3.4; python_version >= '3.10'
1010
sphinx == 8.1.3; python_version >= '3.10'
1111

12-
ruff == 0.6.9
12+
ruff == 0.8.2
1313

14-
sphinx-rtd-theme == 3.0.1
14+
sphinx-rtd-theme == 3.0.2

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.14'
1+
__version__ = '0.15'

src/sphinx_exec_code/sphinx_spec.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SphinxSpecBase:
1212
defaults: ClassVar[Dict[str, str]]
1313

1414
@staticmethod
15-
def alias_to_name(alias: str) -> str:
15+
def alias_to_name(alias: str, *, do_log: bool = True) -> str:
1616
raise NotImplementedError()
1717

1818
@staticmethod
@@ -37,7 +37,7 @@ def set_block_spec(self, block: literal_block) -> None:
3737
def from_options(cls, options: Dict[str, Any]) -> 'SphinxSpecBase':
3838
spec_names = tuple(cls.create_spec().keys())
3939

40-
spec = {cls.alias_to_name(n): v for n, v in cls.defaults.items()}
40+
spec = {cls.alias_to_name(n, do_log=False): v for n, v in cls.defaults.items()}
4141
for name in spec_names:
4242
if name not in options:
4343
continue
@@ -98,9 +98,10 @@ class SpecCode(SphinxSpecBase):
9898
}
9999

100100
@staticmethod
101-
def alias_to_name(alias: str) -> str:
101+
def alias_to_name(alias: str, *, do_log: bool = True) -> str:
102102
if alias == 'hide_code':
103-
log.info('The "hide_code" directive is deprecated! Use "hide" instead!')
103+
if do_log:
104+
log.warning('The "hide_code" directive is deprecated! Use "hide" instead!')
104105
return 'hide'
105106
return alias
106107

@@ -118,8 +119,13 @@ def __init__(self, **kwargs: Dict[str, Any]) -> None:
118119

119120

120121
class SpecOutput(SphinxSpecBase):
122+
defaults: ClassVar = {
123+
'hide': False,
124+
'language': 'none',
125+
}
126+
121127
@staticmethod
122-
def alias_to_name(alias: str) -> str:
128+
def alias_to_name(alias: str, *, do_log: bool = True) -> str: # noqa: ARG004
123129
if alias.endswith('_output'):
124130
return alias[:-7]
125131
return alias
@@ -143,8 +149,3 @@ def post_process_spec(spec: Dict[str, Any], options: Dict[str, Any]) -> None:
143149

144150
# if we have a name for input we create a name for output
145151
spec['name'] = f'{options[name_code]:s}_output'
146-
147-
defaults: ClassVar = {
148-
'hide': False,
149-
'language': 'none',
150-
}

0 commit comments

Comments
 (0)