Skip to content

Commit

Permalink
Merge pull request #148 from Neradoc/ignore-type-annotations-for-dunders
Browse files Browse the repository at this point in the history
fix reading __version__ and __repo__ with type annotations
  • Loading branch information
FoamyGuy authored Jul 5, 2022
2 parents b931a20 + 5270662 commit b7a28e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion circup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def extract_metadata(path):
with open(path, encoding="utf-8") as source_file:
content = source_file.read()
#: The regex used to extract ``__version__`` and ``__repo__`` assignments.
dunder_key_val = r"""(__\w+__)\s*=\s*(?:['"]|\(\s)(.+)['"]"""
dunder_key_val = r"""(__\w+__)(?:\s*:\s*\w+)?\s*=\s*(?:['"]|\(\s)(.+)['"]"""
for match in re.findall(dunder_key_val, content):
result[match[0]] = str(match[1])
if result:
Expand Down

0 comments on commit b7a28e6

Please sign in to comment.