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

Drop Python3.8 #1268

Closed
Zeitsperre opened this issue Jan 12, 2023 · 5 comments · Fixed by #1565
Closed

Drop Python3.8 #1268

Zeitsperre opened this issue Jan 12, 2023 · 5 comments · Fixed by #1565
Assignees
Labels
enhancement New feature or request standards / conventions Suggestions on ways forward
Milestone

Comments

@Zeitsperre
Copy link
Collaborator

Zeitsperre commented Jan 12, 2023

Python3.8 has entered the security fixes stage and is gradually losing support from major scientific libraries: https://peps.python.org/pep-0569/

Dropping this version will open us up to some new features that were introduced in Puthon3.9 (https://peps.python.org/pep-0596/#features-for-3-9), notably __future__.annotations (https://peps.python.org/pep-0585/)

@Zeitsperre Zeitsperre added enhancement New feature or request standards / conventions Suggestions on ways forward labels Jan 12, 2023
@Zeitsperre Zeitsperre added this to the v0.42 milestone Jan 13, 2023
@Zeitsperre Zeitsperre self-assigned this Jan 24, 2023
@Zeitsperre
Copy link
Collaborator Author

Looks like xarray just dropped support for Python3.8 in main dev branch! pydata/xarray#7461

@Zeitsperre Zeitsperre changed the title Drop Python3.7 Drop Python3.8 Jan 27, 2023
@huard
Copy link
Collaborator

huard commented Feb 28, 2023

Security fixes are going to be "provided irregularly on an “as-needed” basis until October 2024." Unless supporting 3.8 proves problematic, I would defer dropping support to as late as reasonable. Updating environments is not pleasant when you have a working setup.

@Zeitsperre
Copy link
Collaborator Author

Zeitsperre commented Feb 28, 2023

Fair enough. I'll remove the milestone for this, but like the last Python version we dropped, the timing will likely follow from our ecosystem of dependencies when they all decide to drop Python3.8 (xarray, numpy, pandas etc.).

@Zeitsperre Zeitsperre removed this from the v0.42 milestone Feb 28, 2023
Zeitsperre added a commit that referenced this issue Apr 3, 2023
### What kind of change does this PR introduce?

* In `xclim.core.missing.MissingBase.prepare`, we transform nanoseconds
into days. Pandas' timedelta doesn't support it anymore, but we only
need the array, so I passed through numpy directly instead.
* In `xclim.sdba.base.Grouper.get_index`, we relied on the deprecated
`DatetimeIndex.dt.week`, here I used the suggested
`DatetimeIndex.dt.isocalendar().week` instead.
* Also removed the `equals` test in the `make_criteria` unittest, it
wasn't necessary and failed because of the changed dim order.
* Noted in changelogs that `xclim v0.42.0` will be the last version to
explicitly support Python3.8.

### Does this PR introduce a breaking change?
It shouldn't. This should be completely compatible with pandas 1.5 and a
few earlier releases.
 
### Other information:

#1268
@aulemahal aulemahal added this to the v0.43 milestone May 5, 2023
@Zeitsperre Zeitsperre modified the milestones: v0.43, v0.44 May 8, 2023
Zeitsperre added a commit that referenced this issue Jun 8, 2023
### What kind of change does this PR introduce?

* Removes `clisops` from the `environment.yml`, which removes the
indirect dev dependency to `xESMF`.
* While missing around I realized we make an explicit import of
`filelock`, without listing it in the env (it's a dep of `tox`).
* `statsmodels` was in the "dev" deps section, but is a hard dep.
* On my machine at least, the pin of `pylint` was blocking the creation
of an env with python 3.11. I removed it and it seems to work. I
modified the rc file slightly to suppress one warning in the output.
And, comble de l'ironie, running `pylint` in my older env (python 3.10,
pylint 2.14) failed... So I leave the study of why it was pinned and if
it is safe to unpin it to @Zeitsperre .

### Does this PR introduce a breaking change?
No

### Other information:
This might be a step towards #1268 !
@Zeitsperre Zeitsperre removed this from the v0.44 milestone Jun 13, 2023
@Zeitsperre
Copy link
Collaborator Author

Follow-up from meeting today:

There is not currently anything preventing us from continuing to offer implicit support of Python3.8 until such a time that we add something truly breaking to the code base (or decide to adopt newer Python conventions).

In summary, we can either drop Python3.8 next month or any time until it reaches its scheduled end-of-life (around October 2024).

@Zeitsperre
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request standards / conventions Suggestions on ways forward
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants