We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is_version_str_assignment()
1 parent 84dcfc5 commit 28fc685Copy full SHA for 28fc685
flit_core/flit_core/common.py
@@ -148,7 +148,7 @@ def get_docstring_and_version_via_ast(target):
148
with target_path.open('rb') as f:
149
node = ast.parse(f.read())
150
for child in node.body:
151
- if is_version_str_node(child):
+ if is_version_str_assignment(child):
152
if sys.version_info >= (3, 8):
153
version = child.value.value
154
else:
@@ -157,7 +157,7 @@ def get_docstring_and_version_via_ast(target):
157
return ast.get_docstring(node), version
158
159
160
-def is_version_str_node(node, /):
+def is_version_str_assignment(node):
161
"""Check if *node* is a simple string assignment to __version__"""
162
if not isinstance(node, (ast.Assign, ast.AnnAssign)):
163
return False
0 commit comments