docstringify 2.0.0__tar.gz → 2.0.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.
Files changed (36) hide show
  1. {docstringify-2.0.0 → docstringify-2.0.1}/.github/workflows/ci.yml +2 -2
  2. {docstringify-2.0.0 → docstringify-2.0.1}/.github/workflows/pypi-publish.yml +5 -5
  3. {docstringify-2.0.0 → docstringify-2.0.1}/.pre-commit-config.yaml +6 -6
  4. {docstringify-2.0.0 → docstringify-2.0.1}/.pre-commit-hooks.yaml +0 -10
  5. {docstringify-2.0.0 → docstringify-2.0.1}/PKG-INFO +4 -2
  6. {docstringify-2.0.0 → docstringify-2.0.1}/README.md +1 -0
  7. {docstringify-2.0.0 → docstringify-2.0.1}/pyproject.toml +12 -6
  8. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/nodes/base.py +1 -5
  9. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/nodes/function.py +1 -1
  10. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/traversal/__init__.py +1 -4
  11. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/traversal/transformer.py +2 -5
  12. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/traversal/visitor.py +4 -12
  13. docstringify-2.0.1/uv.lock +433 -0
  14. docstringify-2.0.0/uv.lock +0 -340
  15. {docstringify-2.0.0 → docstringify-2.0.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  16. {docstringify-2.0.0 → docstringify-2.0.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  17. {docstringify-2.0.0 → docstringify-2.0.1}/.github/dependabot.yml +0 -0
  18. {docstringify-2.0.0 → docstringify-2.0.1}/.github/pull_request_template.md +0 -0
  19. {docstringify-2.0.0 → docstringify-2.0.1}/.github/release.yml +0 -0
  20. {docstringify-2.0.0 → docstringify-2.0.1}/.github/workflows/greetings.yml +0 -0
  21. {docstringify-2.0.0 → docstringify-2.0.1}/.gitignore +0 -0
  22. {docstringify-2.0.0 → docstringify-2.0.1}/.python-version +0 -0
  23. {docstringify-2.0.0 → docstringify-2.0.1}/CODE_OF_CONDUCT.md +0 -0
  24. {docstringify-2.0.0 → docstringify-2.0.1}/CONTRIBUTING.md +0 -0
  25. {docstringify-2.0.0 → docstringify-2.0.1}/LICENSE +0 -0
  26. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/__init__.py +0 -0
  27. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/__main__.py +0 -0
  28. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/cli.py +0 -0
  29. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/components.py +0 -0
  30. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/converters/__init__.py +0 -0
  31. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/converters/base.py +0 -0
  32. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/converters/google.py +0 -0
  33. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/converters/numpydoc.py +0 -0
  34. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/converters/stub.py +0 -0
  35. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/exceptions.py +0 -0
  36. {docstringify-2.0.0 → docstringify-2.0.1}/src/docstringify/nodes/__init__.py +0 -0
@@ -46,10 +46,10 @@ jobs:
46
46
  python-version: ["3.11", "3.12", "3.13", "3.14"]
47
47
 
48
48
  steps:
49
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
50
50
 
51
51
  - name: Set up Python ${{ matrix.python-version }}
52
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
52
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
53
53
  with:
54
54
  python-version: ${{ matrix.python-version }}
55
55
 
@@ -10,9 +10,9 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
13
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
14
14
  - name: Set up Python
15
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
15
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
16
16
  with:
17
17
  python-version: "3.x"
18
18
  - name: Install pypa/build
@@ -49,7 +49,7 @@ jobs:
49
49
  name: python-package-distributions
50
50
  path: dist/
51
51
  - name: Publish distribution 📦 to PyPI
52
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
52
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
53
53
 
54
54
  github-release:
55
55
  name: >-
@@ -70,7 +70,7 @@ jobs:
70
70
  name: python-package-distributions
71
71
  path: dist/
72
72
  - name: Sign the dists with Sigstore
73
- uses: sigstore/gh-action-sigstore-python@04cffa1d795717b140764e8b640de88853c92acc # v3.3.0
73
+ uses: sigstore/gh-action-sigstore-python@5b79a39c381910c090341a2c9b0bf022c8b387e1 # v3.4.0
74
74
  with:
75
75
  inputs: >-
76
76
  ./dist/*.tar.gz
@@ -115,6 +115,6 @@ jobs:
115
115
  name: python-package-distributions
116
116
  path: dist/
117
117
  - name: Publish distribution 📦 to TestPyPI
118
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
118
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
119
119
  with:
120
120
  repository-url: https://test.pypi.org/legacy/
@@ -1,5 +1,5 @@
1
1
  ci:
2
- autofix_prs: false
2
+ autofix_prs: true
3
3
  autoupdate_schedule: quarterly
4
4
 
5
5
  repos:
@@ -12,7 +12,7 @@ repos:
12
12
  - id: trailing-whitespace
13
13
 
14
14
  - repo: https://github.com/codespell-project/codespell
15
- rev: v2.4.2
15
+ rev: v2.4.3
16
16
  hooks:
17
17
  - id: codespell
18
18
  additional_dependencies:
@@ -20,13 +20,13 @@ repos:
20
20
  exclude: (\.(svg|png|pdf)$)|(CODE_OF_CONDUCT.md)
21
21
 
22
22
  - repo: https://github.com/numpy/numpydoc
23
- rev: v1.10.0
23
+ rev: v1.11.0
24
24
  hooks:
25
25
  - id: numpydoc-validation
26
26
  exclude: (tests|docs)/.*
27
27
 
28
28
  - repo: https://github.com/stefmolin/docstringify
29
- rev: 1decb1a66b512ab792fdc0d190a7ba761b3d70fd
29
+ rev: 2.0.0
30
30
  hooks:
31
31
  - id: docstringify-edit
32
32
  name: docstringify source code with numpydoc style
@@ -38,14 +38,14 @@ repos:
38
38
  files: tests/.*
39
39
 
40
40
  - repo: https://github.com/astral-sh/ruff-pre-commit
41
- rev: v0.15.12
41
+ rev: v0.16.10
42
42
  hooks:
43
43
  - id: ruff-check
44
44
  args: [--fix, --exit-non-zero-on-fix, --show-fixes]
45
45
  - id: ruff-format
46
46
 
47
47
  - repo: https://github.com/tox-dev/pyproject-fmt
48
- rev: v2.21.1
48
+ rev: v2.30.1
49
49
  hooks:
50
50
  - id: pyproject-fmt
51
51
  args: [--keep-full-version, --no-print-diff]
@@ -24,13 +24,3 @@
24
24
  language: python
25
25
  require_serial: true
26
26
  types: [python]
27
-
28
- - id: docstringify
29
- name: docstringify (deprecated)
30
- description: >-
31
- Flag missing docstrings and, optionally, generate them from signatures
32
- and type annotations.
33
- entry: docstringify
34
- language: python
35
- require_serial: true
36
- types: [python]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: docstringify
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Flag missing docstrings and, optionally, generate them from signatures and type annotations.
5
5
  Project-URL: Documentation, https://github.com/stefmolin/docstringify
6
6
  Project-URL: Homepage, https://github.com/stefmolin/docstringify
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
19
20
  Requires-Python: >=3.11
20
21
  Description-Content-Type: text/markdown
21
22
 
@@ -104,6 +105,7 @@ You can use Docstringify in three modes:
104
105
  ```python
105
106
  """__description__"""
106
107
 
108
+
107
109
  def say_hello(name: str = 'World') -> None:
108
110
  """
109
111
  __description__
@@ -83,6 +83,7 @@ You can use Docstringify in three modes:
83
83
  ```python
84
84
  """__description__"""
85
85
 
86
+
86
87
  def say_hello(name: str = 'World') -> None:
87
88
  """
88
89
  __description__
@@ -1,10 +1,9 @@
1
1
  [build-system]
2
2
  build-backend = "hatchling.build"
3
- requires = [ "hatchling" ]
3
+ requires = [ "hatch-vcs", "hatchling" ]
4
4
 
5
5
  [project]
6
6
  name = "docstringify"
7
- version = "2.0.0"
8
7
  description = "Flag missing docstrings and, optionally, generate them from signatures and type annotations."
9
8
  readme = "README.md"
10
9
  keywords = [
@@ -28,7 +27,9 @@ classifiers = [
28
27
  "Programming Language :: Python :: 3.12",
29
28
  "Programming Language :: Python :: 3.13",
30
29
  "Programming Language :: Python :: 3.14",
30
+ "Programming Language :: Python :: 3.15",
31
31
  ]
32
+ dynamic = [ "version" ]
32
33
  dependencies = []
33
34
  urls.Documentation = "https://github.com/stefmolin/docstringify"
34
35
  urls.Homepage = "https://github.com/stefmolin/docstringify"
@@ -38,16 +39,19 @@ scripts.docstringify = "docstringify.cli:main"
38
39
  [dependency-groups]
39
40
  dev = [ "pre-commit", { include-group = "test" } ]
40
41
  test = [
41
- "pytest>=8.3.4",
42
+ "pytest>=9.0.3",
42
43
  "pytest-cov>=4.1.0",
43
44
  "pytest-randomly>=3.12.0",
44
45
  ]
45
46
 
47
+ [tool.hatch]
48
+ version.source = "vcs"
49
+
46
50
  [tool.ruff]
47
51
  line-length = 88
48
52
  format.indent-style = "space"
49
53
  format.quote-style = "single"
50
- format.skip-magic-trailing-comma = false
54
+ format.skip-magic-trailing-comma = true
51
55
  format.docstring-code-format = true
52
56
  lint.select = [
53
57
  "ANN", # flake8-annotations
@@ -94,11 +98,13 @@ checks = [
94
98
  "SA01", # or a see also section
95
99
  "SS06", # and don't require the summary to fit on one line
96
100
  ]
97
- exclude = [ # don't report on checks for these
101
+ exclude = [
102
+ # don't report on checks for these
98
103
  "\\.__init__$",
99
104
  "\\.__repr__$",
100
105
  "\\.__str__$",
101
106
  ]
102
- override_SS05 = [ # allow docstrings to start with these words
107
+ override_SS05 = [
108
+ # allow docstrings to start with these words
103
109
  "^Unambiguous ",
104
110
  ]
@@ -28,11 +28,7 @@ class DocstringNode:
28
28
 
29
29
  @overload
30
30
  def __init__(
31
- self,
32
- node: ast.Module,
33
- module_name: str,
34
- source_code: str,
35
- parent: None = None,
31
+ self, node: ast.Module, module_name: str, source_code: str, parent: None = None
36
32
  ) -> None: ...
37
33
 
38
34
  @overload
@@ -141,7 +141,7 @@ class FunctionDocstringNode(DocstringNode):
141
141
  return self.get_source_segment(arg.annotation) or PARAMETER_TYPE_PLACEHOLDER
142
142
 
143
143
  def _extract_default_values(
144
- self, default: ast.Constant | None | Literal[NO_DEFAULT], is_keyword_only: bool
144
+ self, default: ast.Constant | Literal[NO_DEFAULT] | None, is_keyword_only: bool
145
145
  ) -> str | Literal[NO_DEFAULT]:
146
146
  """
147
147
  Extract the argument's default value.
@@ -3,7 +3,4 @@
3
3
  from .transformer import DocstringTransformer
4
4
  from .visitor import DocstringVisitor
5
5
 
6
- __all__ = [
7
- 'DocstringTransformer',
8
- 'DocstringVisitor',
9
- ]
6
+ __all__ = ['DocstringTransformer', 'DocstringVisitor']
@@ -164,9 +164,7 @@ class DocstringTransformer(ast.NodeTransformer, DocstringVisitor):
164
164
  output_lines.append(
165
165
  indent(
166
166
  self.docstring_converter.format_docstring(
167
- docstring.splitlines(),
168
- indent=0,
169
- quote=True,
167
+ docstring.splitlines(), indent=0, quote=True
170
168
  )
171
169
  + (f'\n{suffix}' if suffix else ''),
172
170
  ' ' * prefix,
@@ -199,8 +197,7 @@ class DocstringTransformer(ast.NodeTransformer, DocstringVisitor):
199
197
  )
200
198
 
201
199
  suggested_docstring = self.docstring_converter.suggest_docstring(
202
- docstring_node,
203
- indent=indent,
200
+ docstring_node, indent=indent
204
201
  )
205
202
  docstring_ast_node = ast.Expr(ast.Constant(suggested_docstring))
206
203
 
@@ -135,30 +135,22 @@ class DocstringVisitor(ast.NodeVisitor):
135
135
 
136
136
  @overload
137
137
  def visit_docstring(
138
- self,
139
- node: ast.Module,
140
- docstring_class: type[DocstringNode],
138
+ self, node: ast.Module, docstring_class: type[DocstringNode]
141
139
  ) -> ast.Module: ...
142
140
 
143
141
  @overload
144
142
  def visit_docstring(
145
- self,
146
- node: ast.ClassDef,
147
- docstring_class: type[DocstringNode],
143
+ self, node: ast.ClassDef, docstring_class: type[DocstringNode]
148
144
  ) -> ast.ClassDef: ...
149
145
 
150
146
  @overload
151
147
  def visit_docstring(
152
- self,
153
- node: ast.FunctionDef,
154
- docstring_class: type[FunctionDocstringNode],
148
+ self, node: ast.FunctionDef, docstring_class: type[FunctionDocstringNode]
155
149
  ) -> ast.FunctionDef: ...
156
150
 
157
151
  @overload
158
152
  def visit_docstring(
159
- self,
160
- node: ast.AsyncFunctionDef,
161
- docstring_class: type[FunctionDocstringNode],
153
+ self, node: ast.AsyncFunctionDef, docstring_class: type[FunctionDocstringNode]
162
154
  ) -> ast.AsyncFunctionDef: ...
163
155
 
164
156
  def visit_docstring(