Skip to content

Python 3.13 support #4365

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

Merged
merged 9 commits into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"

- name: Build source distribution
run: |
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"

- name: Get build artifacts
uses: actions/download-artifact@v4
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ jobs:
# Maximize CI coverage of different platforms and python versions while minimizing the
# total number of jobs. We run all pytest splits with the oldest supported python
# version (currently 3.10) on windows (seems most likely to surface errors) and with
# newest version (currently 3.12) on ubuntu (to get complete coverage on unix).
# newest version (currently 3.13) on ubuntu (to get complete coverage on unix).
config:
- os: windows-latest
python: "3.10"
python: "3.11"
resolution: highest
extras: ci,optional,prototypes
- os: windows-latest
python: "3.10"
python: "3.11"
resolution: highest
extras: ci,prototypes,optional,numpy-v1 # Test NP1 on Windows (quite buggy ATM)
- os: ubuntu-latest
python: "3.12"
python: "3.13"
resolution: lowest-direct
extras: ci,prototypes,optional
- os: macos-latest
python: "3.11"
python: "3.12"
resolution: lowest-direct
extras: ci,prototypes # test with only required dependencies installed

Expand Down Expand Up @@ -71,7 +71,8 @@ jobs:
if: matrix.config.os == 'ubuntu-latest'
run: |
micromamba install -n pmg -c conda-forge bader enumlib \
openff-toolkit packmol pygraphviz tblite --yes
packmol pygraphviz tblite --yes
# openff-toolkit # TODO: doesn't support Python 3.13 yet

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand All @@ -86,7 +87,7 @@ jobs:
uv pip install $WHEEL_FILE[${{matrix.config.extras}}] --resolution=${{matrix.config.resolution}}

- name: Install DGL and MatGL specially on ubuntu.
if: matrix.config.os == 'ubuntu-latest'
if: matrix.config.os == 'ubuntu-latest' && matrix.config.python < '3.13'
run: |
micromamba activate pmg
pip install --upgrade dgl -f https://data.dgl.ai/wheels/torch-2.4/repo.html
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Python Materials Genomics is a robust materials analysis code that defines core
and molecules with support for many electronic structure codes. It is currently the core analysis code powering the
Materials Project (https://materialsproject.org)."""
readme = "README.md"
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10"
keywords = [
"ABINIT",
"VASP",
Expand All @@ -48,6 +48,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Physics",
Expand Down Expand Up @@ -90,7 +91,7 @@ Pypi = "https://pypi.org/project/pymatgen"
abinit = ["netcdf4>=1.7.2"]
ase = ["ase>=3.23.0"]
electronic_structure = ["fdint>=2.0.2"]
mlp = ["matgl>=1.2.5"]
mlp = ["matgl>=1.2.5 ; python_version<'3.13'"]
numba = ["numba>=0.55"]
numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM)
zeopp = ["pyzeo"] # Note: requires voro++ and zeo++ to be installed
Expand Down