Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: use public ast module in setup.py #33

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import time
from pathlib import Path

import _ast
from setuptools import setup
from setuptools.extension import Extension

Expand All @@ -36,9 +35,9 @@
__version__ = [
expr.value.s
for expr in parsed_file.body
if isinstance(expr, _ast.Assign)
and isinstance(expr.targets[0], _ast.Name)
and isinstance(expr.value, _ast.Str)
if isinstance(expr, ast.Assign)
and isinstance(expr.targets[0], ast.Name)
and isinstance(expr.value, ast.Str)
and expr.targets[0].id == "__version__"
][0]

Expand Down