pytest-codeblock 0.1__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-codeblock
3
- Version: 0.1
3
+ Version: 0.1.1
4
4
  Summary: Pytest plugin to collect and test code blocks in reStructuredText and Markdown files.
5
5
  Author-email: Artur Barseghyan <artur.barseghyan@gmail.com>
6
6
  Maintainer-email: Artur Barseghyan <artur.barseghyan@gmail.com>
@@ -15,6 +15,7 @@ Classifier: Framework :: Pytest
15
15
  Classifier: Development Status :: 4 - Beta
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3.9
18
19
  Classifier: Programming Language :: Python :: 3.10
19
20
  Classifier: Programming Language :: Python :: 3.11
20
21
  Classifier: Programming Language :: Python :: 3.12
@@ -22,7 +23,7 @@ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Programming Language :: Python
23
24
  Classifier: Topic :: Software Development :: Testing
24
25
  Classifier: Topic :: Software Development
25
- Requires-Python: >=3.10
26
+ Requires-Python: >=3.9
26
27
  Description-Content-Type: text/x-rst
27
28
  License-File: LICENSE
28
29
  Requires-Dist: pytest
@@ -114,7 +115,7 @@ Features
114
115
 
115
116
  Prerequisites
116
117
  =============
117
- Python 3.10+
118
+ Python 3.9+
118
119
 
119
120
  Documentation
120
121
  =============
@@ -59,7 +59,7 @@ Features
59
59
 
60
60
  Prerequisites
61
61
  =============
62
- Python 3.10+
62
+ Python 3.9+
63
63
 
64
64
  Documentation
65
65
  =============
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "pytest-codeblock"
3
- version = "0.1"
3
+ version = "0.1.1"
4
4
  description = "Pytest plugin to collect and test code blocks in reStructuredText and Markdown files."
5
5
  readme = "README.rst"
6
- requires-python = ">=3.10"
6
+ requires-python = ">=3.9"
7
7
  dependencies = [
8
8
  "pytest",
9
9
  ]
@@ -19,6 +19,7 @@ classifiers = [
19
19
  "Development Status :: 4 - Beta",
20
20
  "Intended Audience :: Developers",
21
21
  "Operating System :: OS Independent",
22
+ "Programming Language :: Python :: 3.9",
22
23
  "Programming Language :: Python :: 3.10",
23
24
  "Programming Language :: Python :: 3.11",
24
25
  "Programming Language :: Python :: 3.12",
@@ -122,7 +123,7 @@ exclude = [
122
123
  "_build", "buck-out", "build", "dist", "node_modules", "venv", "docs",
123
124
  ]
124
125
  lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
125
- target-version = "py310"
126
+ target-version = "py39"
126
127
 
127
128
  [tool.ruff.lint.per-file-ignores]
128
129
  "conftest.py" = ["PERF203"]
@@ -2,7 +2,7 @@ from .md import MarkdownFile
2
2
  from .rst import RSTFile
3
3
 
4
4
  __title__ = "pytest-codeblock"
5
- __version__ = "0.1"
5
+ __version__ = "0.1.1"
6
6
  __author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
7
7
  __copyright__ = "2025 Artur Barseghyan"
8
8
  __license__ = "MIT"
@@ -1,4 +1,5 @@
1
1
  from dataclasses import dataclass, field
2
+ from typing import Optional
2
3
 
3
4
  import pytest
4
5
 
@@ -17,7 +18,7 @@ class CodeSnippet:
17
18
  """Data container for an extracted code snippet."""
18
19
  code: str # The code content
19
20
  line: int # Starting line number in the source
20
- name: str | None = None # Identifier for grouping (None if anonymous)
21
+ name: Optional[str] = None # Identifier for grouping (None if anonymous)
21
22
  marks: list[str] = field(default_factory=list)
22
23
  # Collected pytest marks (e.g. ['django_db']), parsed from doc comments
23
24
 
@@ -1,4 +1,5 @@
1
1
  import re
2
+ from typing import Optional
2
3
 
3
4
  import pytest
4
5
 
@@ -29,13 +30,13 @@ def parse_markdown(text: str) -> list[CodeSnippet]:
29
30
  """
30
31
  snippets: list[CodeSnippet] = []
31
32
  lines = text.splitlines()
32
- pending_name: str | None = None
33
+ pending_name: Optional[str] = None
33
34
  pending_marks: list[str] = []
34
35
  in_block = False
35
36
  fence = ""
36
37
  block_indent = 0
37
38
  code_buffer: list[str] = []
38
- snippet_name: str | None = None
39
+ snippet_name: Optional[str] = None
39
40
  start_line = 0
40
41
 
41
42
  for idx, line in enumerate(lines, start=1):
@@ -1,4 +1,5 @@
1
1
  import re
2
+ from typing import Optional
2
3
 
3
4
  import pytest
4
5
 
@@ -26,9 +27,9 @@ def parse_rst(text: str) -> list[CodeSnippet]:
26
27
  lines = text.splitlines()
27
28
  n = len(lines)
28
29
 
29
- pending_name: str | None = None
30
+ pending_name: Optional[str] = None
30
31
  pending_marks: list[str] = []
31
- pending_continue: str | None = None
32
+ pending_continue: Optional[str] = None
32
33
  i = 0
33
34
 
34
35
  while i < n:
@@ -62,7 +63,7 @@ def parse_rst(text: str) -> list[CodeSnippet]:
62
63
  lang = m.group(2).lower()
63
64
  if lang in ("python", "py", "python3"):
64
65
  # Parse :name: option
65
- name_val: str | None = None
66
+ name_val: Optional[str] = None
66
67
  j = i + 1
67
68
  while j < n:
68
69
  ln = lines[j]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-codeblock
3
- Version: 0.1
3
+ Version: 0.1.1
4
4
  Summary: Pytest plugin to collect and test code blocks in reStructuredText and Markdown files.
5
5
  Author-email: Artur Barseghyan <artur.barseghyan@gmail.com>
6
6
  Maintainer-email: Artur Barseghyan <artur.barseghyan@gmail.com>
@@ -15,6 +15,7 @@ Classifier: Framework :: Pytest
15
15
  Classifier: Development Status :: 4 - Beta
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3.9
18
19
  Classifier: Programming Language :: Python :: 3.10
19
20
  Classifier: Programming Language :: Python :: 3.11
20
21
  Classifier: Programming Language :: Python :: 3.12
@@ -22,7 +23,7 @@ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Programming Language :: Python
23
24
  Classifier: Topic :: Software Development :: Testing
24
25
  Classifier: Topic :: Software Development
25
- Requires-Python: >=3.10
26
+ Requires-Python: >=3.9
26
27
  Description-Content-Type: text/x-rst
27
28
  License-File: LICENSE
28
29
  Requires-Dist: pytest
@@ -114,7 +115,7 @@ Features
114
115
 
115
116
  Prerequisites
116
117
  =============
117
- Python 3.10+
118
+ Python 3.9+
118
119
 
119
120
  Documentation
120
121
  =============
File without changes