GenericMappingTools / GenericMappingTools/pygmt

Support free-threaded Python builds

Open
#3,994 0 comments 0 reactions 0 assignees View on GitHub
feature request longterm
Dominant language
Python
Stars
874
Forks
255
Avg merge
1d 21h
Merged PRs (30d)
40

Description

### Description of the desired feature

Python 3.13 came out with an experimental free-threaded mode with the global-interpreter lock disabled ([PEP 703](https://peps.python.org/pep-0703/)). This issue is to track the addition for PyGMT to build free-threaded compatible wheels.

**Main guide**: https://py-free-threading.github.io/porting/

Steps:
- [ ] Test building PyGMT on Python ~3.13t~ 3.14t in CI
- https://py-free-threading.github.io/ci/
- [ ] Document thread safety guarantees via trove classifiers
- https://py-free-threading.github.io/porting/#define-and-document-thread-safety-guarantees
- [ ] Validate thread safety using [`pytest-freethreaded`](https://github.com/tonybaloney/pytest-freethreaded) or [`pytest-run-parallel`](https://github.com/Quansight-Labs/pytest-run-parallel)
- https://py-free-threading.github.io/testing/

Notes:
- Some [GMT modules already support multi-threading](https://docs.generic-mapping-tools.org/6.5/reference/options.html#option-x-core) via the `-x` flag, which happens via OpenMP, need to be careful that we don't do threading of many PyGMT functions + call multi-threaded GMT functions
- Related thread on multi-processing support - #217
- Dependencies that have added free-threading support
- NumPy (since 2.1) - https://numpy.org/doc/2.3/reference/thread_safety.html
- Pandas (since 2.2.3) - https://pandas.pydata.org/pandas-docs/version/2.2/whatsnew/v2.2.3.html#pandas-2-2-3-is-now-compatible-with-python-3-13

### Are you willing to help implement and maintain this feature?

Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.