elifesciences / elife-tools

Python library for parsing eLife article XML data.
MIT License
15 stars 7 forks source link

Drop py27 support #316

Closed gnott closed 4 years ago

gnott commented 4 years ago

Issue https://github.com/elifesciences/elife-tools/issues/315, I expanded the DoD checkboxes to include five tasks which should pretty much remove all Python 2.7 support from this library.

I hope the strictness I followed is ok. I thought why not try to refactor every shred of py27 away that I could locate. The tests are passing so I think it might be unbroken.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.2%) to 99.762% when pulling 221a76aeb641ab247355eec4bfd66ac8fd11feac on py27 into 5b57b1798788cc1c56077601df9a66e8de6a0239 on develop.

gnott commented 4 years ago

I should also note, I think if this library only supports Python 3 after this is merged, then libraries that depend on it may fail to run their Python 2 tests when using the latest elife-tools commit. Those libraries that depend on this will also need to have Python 2 testing dropped from them sooner rather than later in case it causes problems in the testing pipelines.

lsh-0 commented 4 years ago

I should also note, I think if this library only supports Python 3 after this is merged, then libraries that depend on it may fail to run their Python 2 tests when using the latest elife-tools commit.

Those libraries and programs should have been upgraded ages ago. It will be a good thing if CI reveals any broken programs. It's no longer safe to backwards support Python2.7.

. Those libraries that depend on this will also need to have Python 2 testing dropped from them sooner rather than later in case

funnily enough that's my job today - going through the github search results for mentions of 'python2' and unqualified invocations of 'virtualenv' (which default to python2.7). I've been focusing on project formulas up till now but there are a lot of forgotten references still hanging around.

I think there are three options for testing (travis-ci, Alfred, tox), and all of them are only testing py35 right now. We could expand these to include py36, py37, py38.

If you use a container for your work, then you're responsible for making sure the right version of python is installed for your app, otherwise we support Ubuntu 16.04 and 18.04 right now that use Python3.5 and Python3.6 respectively. It looks like Ubuntu 20.04 will support Python3.7 (as well as Python2.7! madness).

gnott commented 4 years ago

We can expand into testing py36 in future in a separate PR perhaps? I created about five or six issues to remove py27 testing in other libraries that depend on elife-tools and I can do those now if it helps dovetail with your plans.

lsh-0 commented 4 years ago

We can expand into testing py36 in future in a separate PR perhaps?

go for it. I'm sure there are breaking changes between newer Python3 major versions but I haven't encountered any yet so I'm not too worried about 3.5 tested code not working in 3.6

I created about five or six issues to remove py27 testing in other libraries that depend on elife-tools and I can do those now if it helps dovetail with your plans.

this ticket or something else? if it's something else, could you link them to the Python2.7 removal meta ticket here: https://github.com/elifesciences/issues/issues/4726

it just helps me keep all these things in one place