tobac
tobac copied to clipboard
Deprecate Python 3.6 and lower support
Resolves the first half of #185. Rather than dropping support for <3.7, I'm proposing that we only deprecate it in the code. We will still tell conda-forge that we require >=3.7, but this allows users who must remain on old versions to stick around for now. We will drop support with v1.5, as I'd really like to start adding typing annotations.
- [x] Have you followed our guidelines in CONTRIBUTING.md?
- [x] Have you self-reviewed your code and corrected any misspellings?
- [ ] Have you written documentation that is easy to understand?
- [x] Have you written descriptive commit messages?
- [ ] Have you added NumPy docstrings for newly added functions?
- [x] Have you formatted your code using black?
- [ ] If you have introduced a new functionality, have you added adequate unit tests?
- [x] Have all tests passed in your local clone?
- [ ] If you have introduced a new functionality, have you added an example notebook?
- [x] Have you kept your pull request small and limited so that it is easy to review?
- [x] Have the newest changes from this branch been merged?
Codecov Report
Base: 36.20% // Head: 36.22% // Increases project coverage by +0.02%
:tada:
Coverage data is based on head (
0744e06
) compared to base (29e5598
). Patch coverage: 50.00% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## RC_v1.4.0 #193 +/- ##
=============================================
+ Coverage 36.20% 36.22% +0.02%
=============================================
Files 10 10
Lines 2116 2120 +4
=============================================
+ Hits 766 768 +2
- Misses 1350 1352 +2
Flag | Coverage Δ | |
---|---|---|
unittests | 36.22% <50.00%> (+0.02%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
tobac/__init__.py | 92.00% <50.00%> (-8.00%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
OK, I tried some things and what worked is to use a print statement instead of a warning and put it at the end of setup.py
, and add some blank lines so that it sticks out from the other output. This does, however, also only work when installing tobac
from source with python -v install .
My suggestion would be to just add it here but also write the same to the README
because most users probably do not use the verbose flag
.
if sys.version_info[0] < 3.7:
warning = """ \n\n
Support for Python versions less than 3.7 is deprecated.
Version 1.5 of tobac will require Python 3.7 or later.
Python {py} detected. \n\n
""".format(py='.'.join(str(v) for v in sys.version_info[:3]))
print(warning)
Good catch @JuliaKukulies ! It looks like Docker captured the warning, but users more generally wouldn't see it. I spun up a new environment and tried to install it with python 3.6, and I didn't see your print statement either.
Instead, I propose that we go with a different approach- warn users on import. My new commit reflects this suggestion. I've tested this on 3.6, and it appears to get the message across.
In testing these new errors, I noticed that #175 actually inadvertently dropped support for Python versions lower than 3.4 (see also #176 ). The question is: are we okay with this, or should we work toward a new PR to provide a smooth transition out for 2.7 and 3.4 users? How many <3.4 users do we still have? Note that conda-forge no longer supports versions 3.7 or lower, so for example, when running conda install -c conda-forge tobac
on a 2.7 install, tobac v1.2 is the newest version installed.
Also, do I understand it correctly that you propose to already now require >3.7 for conda so that users who install tobac v1.4.0 via conda would need to do so with Python >3.7 while users who need to remain with older Python versions need to install tobac v1.4.0 from the github repo?
Yes, that's my proposal. I think that will happen anyway, even without our explicit doing, due to the fact that conda-forge doesn't support 3.7 or lower anymore. If a user needs to be on Python <3.6, they can still get tobac
for now, but it's now 6 years old, so I am not opposed to nudging users to upgrade sooner rather than later.
And good point with #175. I am almost inclined to say that we are OK with it due to the reasons that you mention (better sooner than later nudge users to upgrade and users installing tobac
from now with conda-forge
with python<3.4 will get tobac1.2
anyhow). I would think that a smooth transition from Python3.6 is more important because this probably concerns much more people, but if others have a different opinion, we can definitely work out a PR that still supports Python 2 for the new release. In #175 this only concerns the pathlib
module, right? Note that we also used it in the updated examples (#186).
Thanks!
Agreed with you @JuliaKukulies . If users are still on Python 2.7 or <3.4, they can use tobac v1.3.3. If they're on those python versions, they must be installing from GitHub anyway as conda-forge doesn't support those versions.