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

Add support for Python 3.13 #3490

Merged
merged 16 commits into from
Dec 19, 2024
Merged

Add support for Python 3.13 #3490

merged 16 commits into from
Dec 19, 2024

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Oct 7, 2024

Description of proposed changes

Python 3.13 has been released on 7 Oct 2024, changelog is at https://docs.python.org/3.13/whatsnew/3.13.html

Previous PR for Python 3.12 at #2711

Fixes #

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

Python 3.13 has been released on 7 Oct 2024, changelog is at https://docs.python.org/3.13/whatsnew/3.13.html
@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Oct 7, 2024
@weiji14 weiji14 self-assigned this Oct 7, 2024
@seisman seisman added this to the 0.14.0 milestone Oct 7, 2024
@weiji14
Copy link
Member Author

weiji14 commented Oct 21, 2024

Still waiting on a few packages upstream to add Python 3.13 support:

@seisman
Copy link
Member

seisman commented Oct 21, 2024

Also need to revert the changes in 92d5945.

PyArrow's dependencies (specifically sparse and numba) aren't supported on Python 3.13 yet, so removing for now since PyArrow is included in the Python 3.11 CI build (#3605). Downgraded Python version in environment.yml from =3.13 to >=3.10
optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery'
optional-packages: ' contextily geopandas ipython rioxarray sphinx-gallery'
Copy link
Member Author

@weiji14 weiji14 Nov 11, 2024

Choose a reason for hiding this comment

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

Since we're including PyArrow in the Python 3.11 CI build as of #3605, let's just remove PyArrow here until it supports Python 3.13 to not hold up #3606?

Copy link
Member

Choose a reason for hiding this comment

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

We can't remove PyArrow in the Python 3.13 job, because we need both pandas<2.2+pyarrow (in Python 3.11) and pandas>=2.2+pyarrow (in Python 3.12 or 3.13) to test the behavior changes in pands 2.2.

Copy link
Member Author

@weiji14 weiji14 Nov 11, 2024

Choose a reason for hiding this comment

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

I was thinking we could do (after #3606) Python 3.11+pandas=2.1+pyarrow; Python 3.12+pandas=2.2+pyarrow, but anyways, this won't work yet because mamba install is still complaining about some incompatible depedencies (looks like something on dvc):

The following packages are incompatible
├─ dvc >=3.56.0  is installable and it requires
|    ...
│  └─ scmrepo >=3.3.8,<4 , which requires
│     └─ asyncssh >=2.13.1,<3 , which requires
│        └─ python-gssapi >=1.2.0  with the potential options
│           ├─ python-gssapi [1.6.10|1.6.11|1.6.12|1.6.13|1.6.9] would require
│           │  └─ python_abi 3.6 *_pypy36_pp73, which can be installed (as previously explained);
│           ├─ python-gssapi [1.6.10|1.6.11|...|1.7.0] would require
│           │  └─ python >=3.6,<3.7.0a0 , which can be installed;
│           ├─ python-gssapi [1.6.10|1.6.11|...|1.8.1] would require
│           │  └─ python >=3.7,<3.8.0a0 , which can be installed;
│           ├─ python-gssapi [1.6.10|1.6.11|...|1.8.3] would require
│           │  └─ python >=3.8,<3.9.0a0 , which can be installed;
│           ├─ python-gssapi [1.6.10|1.6.11|...|1.9.0] would require
│           │  └─ python >=3.9,<3.10.0a0 , which can be installed;
│           ├─ python-gssapi [1.6.12|1.6.13|...|1.7.3] would require
│           │  └─ python_abi 3.7 *_pypy37_pp73, which can be installed (as previously explained);
│           ├─ python-gssapi [1.7.2|1.7.3|...|1.9.0] would require
│           │  └─ python >=3.10,<3.11.0a0 , which can be installed;
│           ├─ python-gssapi [1.7.3|1.8.0|1.8.1|1.8.2] would require
│           │  └─ python_abi 3.8 *_pypy38_pp73, which can be installed (as previously explained);
│           ├─ python-gssapi [1.7.3|1.8.0|1.8.1|1.8.2|1.8.3] would require
│           │  ├─ pypy3.9 >=7.3.13 , which can be installed (as previously explained);
│           │  └─ python_abi 3.9 *_pypy39_pp73, which can be installed (as previously explained);
│           ├─ python-gssapi [1.8.2|1.8.3|1.9.0] would require
│           │  └─ python >=3.11,<3.12.0a0 , which can be installed;
│           ├─ python-gssapi [1.8.2|1.8.3|1.9.0] would require
│           │  └─ python_abi 3.12.* *_cp312, which can be installed (as previously explained);
│           ├─ python-gssapi 1.8.2 would require
│           │  └─ pypy3.8 >=7.3.11 , which can be installed (as previously explained);
│           └─ python-gssapi 1.8.2 would require
│              └─ pypy3.9 >=7.3.11 , which can be installed (as previously explained);
└─ python 3.13**  is not installable because there are no viable options
   ├─ python 3.13.0 conflicts with any installable versions previously reported;
   └─ python [3.13.0rc1|3.13.0rc2|3.13.0rc3] would require
      └─ _python_rc, which does not exist (perhaps a missing channel).

Wait for conda-forge/python-gssapi-feedstock#32.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also need to wait for conda-forge/kombu-feedstock#78:

error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ dvc =* * is installable with the potential options
    ...
    │  └─ dvc [3.49.0|3.50.0|...|3.58.0] would require
    │     └─ celery =* * with the potential options
    ...
    │        ├─ celery [5.3.0|5.3.1|5.3.4] would require
    │        │  └─ kombu [>=5.3.0,<6.0 *|>=5.3.1,<6.0 *|>=5.3.2,<6.0 *] with the potential options
    │        │     ├─ kombu [5.3.0|5.3.1|...|5.4.1] would require
    │        │     │  └─ python >=3.10,<3.11.0a0 * with the potential options
    │        │     │     ├─ python [3.10.7|3.10.8|3.11.0|3.9.14|3.9.15], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.0|3.10.1|...|3.9.9], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.4|3.9.12], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.5|3.9.13], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.0|3.10.1|...|3.10.9], which can be installed;
    │        │     │     └─ python [3.10.6|3.11.0], which can be installed (as previously explained);
    │        │     ├─ kombu [5.3.0|5.3.1|...|5.4.1] would require
    │        │     │  └─ python >=3.11,<3.12.0a0 * with the potential options
    │        │     │     ├─ python [3.10.7|3.10.8|3.11.0|3.9.14|3.9.15], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.6|3.11.0], which can be installed (as previously explained);
    │        │     │     └─ python [3.11.0|3.11.1|...|3.11.9], which can be installed;
    │        │     ├─ kombu [5.3.0|5.3.1|5.3.2] would require
    │        │     │  └─ python_abi ==3.8 *_pypy38_pp73, which can be installed (as previously explained);
    │        │     ├─ kombu [4.6.10|4.6.11|...|5.4.0] would require
    │        │     │  └─ python >=3.8,<3.9.0a0 *, which can be installed;
    │        │     ├─ kombu [5.3.0|5.3.1|...|5.4.0] would require
    │        │     │  └─ python_abi ==3.9 *_pypy39_pp73, which can be installed (as previously explained);
    │        │     ├─ kombu [5.3.0|5.3.1|...|5.4.1] would require
    │        │     │  └─ python >=3.9,<3.10.0a0 * with the potential options
    │        │     │     ├─ python [3.10.7|3.10.8|3.11.0|3.9.14|3.9.15], which can be installed (as previously explained);
    │        │     │     ├─ python [3.9.10|3.9.12|...|3.9.9], which can be installed;
    │        │     │     ├─ python [3.9.0|3.9.1], which can be installed (as previously explained);
    │        │     │     ├─ python 3.9.1, which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.0|3.10.1|...|3.9.9], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.4|3.9.12], which can be installed (as previously explained);
    │        │     │     ├─ python [3.10.5|3.9.13], which can be installed (as previously explained);
    │        │     │     ├─ python 3.9.2, which can be installed (as previously explained);
    │        │     │     └─ python [3.9.4|3.9.5|3.9.6|3.9.7], which can be installed (as previously explained);
    │        │     └─ kombu [5.3.2|5.3.3|...|5.4.1] would require
    │        │        └─ python_abi =3.12 *_cp312, which can be installed (as previously explained);

Copy link
Member

Choose a reason for hiding this comment

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

conda-forge/python-gssapi-feedstock#32 has been superseded by conda-forge/python-gssapi-feedstock#33.

So we still need to wait for conda-forge/kombu-feedstock#78. kombu's Python 3.13 support was added in celery/kombu#2052, which first appeared in kombu v5.5.0rc2.

kombu v5.5.0rc2 was released two months ago, and there is still no kombu v5.5.0 out. Not sure how long we have to wait.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, for reference, we applied a workaround for dvc in #3695, and pyarrow now has a Python 3.13 build since conda-forge/pyarrow-feedstock#139.

@@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.12
- python>=3.10
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that this has changed from python=3.12 to python>=3.10 to folllow SPEC 0 (same with NumPy, pandas and xarray lines below).

@weiji14 weiji14 mentioned this pull request Dec 19, 2024
49 tasks
@seisman seisman marked this pull request as ready for review December 19, 2024 00:44
@seisman
Copy link
Member

seisman commented Dec 19, 2024

This PR should be good to merge after all CI passes, except one minor comment above.

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@weiji14 weiji14 merged commit 823d9c0 into main Dec 19, 2024
21 of 22 checks passed
@weiji14 weiji14 deleted the python-3.13 branch December 19, 2024 01:02
@weiji14
Copy link
Member Author

weiji14 commented Dec 19, 2024

Thanks @seisman! Just tracking our time to support new Python versions, still hoping we can keep this to under 2 months:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants