gristlabs / asttokens

Annotate Python AST trees with source text and token information
Apache License 2.0
172 stars 33 forks source link

Drop Python 2.7? #111

Open alexmojaki opened 1 year ago

alexmojaki commented 1 year ago

Continuing the discussion in https://github.com/gristlabs/asttokens/pull/110#issuecomment-1615147120

I've just noticed that GHA still has PyPy 2.7, which is actually probably enough to say that the library is still being tested on 2.7 and is thus expected to work. Dropping support (i.e. the PyPI classifier) is only valuable if it saves us from doing work to have that confidence.

On the other hand, I don't want people doing (or thinking that they have to do) extra work in the future for the sake of Python 2, e.g. I feel bad about the effort @palfrey went through with mypy and Python 2.

If we do go forward with this, https://github.com/gristlabs/asttokens/pull/67 would help.

PeterJCLaw commented 1 year ago

Cross linking: https://github.com/gristlabs/asttokens/issues/107

aqeelat commented 1 year ago

@PeterJCLaw @dsagal

I just looked at Grist and their repo is setup with separate requirements.txt files for python 2 and python 3. As long as we don't change the public api, I think we will be fine with removing python 2 support.

Since the projects are supposedly tied, the way I suggest we go about it is:

  1. bump asttokens to version 3 and remove support for python 2
  2. release critical bug fixes to version 2.2.x if needed
  3. update requirements.txt to include asttokens <=2.0.5,<3
  4. update requirements3.txt to include the newer version 3
aqeelat commented 1 year ago

Also, new grist installations use python 3.9 by default, so we can also drop 3.5 and 3.6 since they're dead.

dsagal commented 1 year ago

@aqeelat's suggested plan sounds good to me.