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

Fix CI builds for Python 3.12 #1754

Merged
merged 6 commits into from
Oct 7, 2023
Merged

Conversation

mcflugen
Copy link
Member

@mcflugen mcflugen commented Oct 6, 2023

Description

This pull request fixes our builds that began failing when conda added Python 3.12 as the default version. Note that I've done this by disabling Python 3.12 builds. I'm not sure one can build Landlab within a Python 3.12 environment yet. That, I hope, will come shortly with a subsequent pull request.

It appears, at least for the time being, some of Landlab's dependencies might not be available for Python 3.12, which is now the default Python for conda. Because of this, some of our CI builds were failing while trying to create a testing environment. To fix this, I've specified Python versions (3.11, for now) in all of our nox sessions that use the mamba backend. Then, for the ci builds, I use the --force-pythons option to force nox to create a new environment with the Python version we want to test against.

I'm not certain but it appears that previously to this pull request, all of our tests were using the default version of Python and not the version our tests were supposed to be targeting. Anyway, with this pull request, we are now testing against the versions of Python we think we are.

Checklist - did you ...

  • Add a news fragment file entry if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?
  • All tests have passed?
  • Formatted code with black?
  • Removed lint reported by flake8?
  • Sucessful documentation built? (if documentation added or modified)

@mdpiper
Copy link
Member

mdpiper commented Oct 6, 2023

@mcflugen Thank you for doing this. I think this explains what @gantian127 and I were seeing in the CI builds earlier this week.

@mcflugen
Copy link
Member Author

mcflugen commented Oct 6, 2023

I think this explains what @gantian127 and I were seeing in the CI builds earlier this week.

Yup, the timing sounds about right. I hope this works for you as well. I think when we define nox sessions that use the conda/mamba backend, we should always specify a Python version to install. If we don't, I think the default gets installed, regardless of the version that's installed in the calling environment.

When you have a moment, could you give this a quick review?

@mcflugen mcflugen requested a review from mdpiper October 6, 2023 22:48
@coveralls
Copy link

coveralls commented Oct 6, 2023

Coverage Status

coverage: 86.352%. first build when pulling b6fb6ce on mcflugen/ci-fix-for-python312 into 8bb4240 on master.

mdpiper
mdpiper previously approved these changes Oct 7, 2023
noxfile.py Outdated
@@ -9,7 +9,7 @@
ROOT = pathlib.Path(__file__).parent


@nox.session(venv_backend="mamba")
@nox.session(python="3.11", venv_backend="mamba")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is at your discretion, but would it be good to define a global DEFAULT_PYTHON="3.11" above, then reference it here and on line 41? I'm thinking this may make it easier to change in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. In fact, I've done exactly that locally but hadn't pushed the change to GitHub yet.

@mcflugen mcflugen merged commit 94e2f51 into master Oct 7, 2023
41 checks passed
@mcflugen mcflugen deleted the mcflugen/ci-fix-for-python312 branch October 7, 2023 14:29
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.

None yet

3 participants