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

[Idea] Parse the AST, to guess minimal Python version. #63

Closed
wants to merge 1 commit into from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Dec 27, 2015

Small draft prototype with yield from, which obviously is not that useful as it is 3.3+ only, but already eliminate Python2.

What do you think of a feature like that ? I think that would push the usage of the requires-python field in metadata.

(Merry Christmas also ! )

@takluyver
Copy link
Member

Merry Christmas! Or indeed joyeux Noël.

I think I'm going to apply a principle we use sometimes in IPython here: if you can't make a feature work well and reliably, it may be better not to provide it at all.

Why can't this be made to work reliably? First, there are many changes beyond new syntax. Code using subprocess.run(), for example, requires Python 3.5. Detecting this is possible, but gets much more complex, especially with backport modules involved. Secondly, it's possible to have one module in a package require a newer version than the package as a whole - e.g. in Pexpect, pexpect.async uses yield from, but Pexpect overall can be installed and used on Python 2.7 (just not that module).

As you know, I also don't want to add many features to flit init, but I'm happy for separate tools to try doing more complicated things like this. ;-)

Thanks, though, it is an interesting idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants