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

Support python3.13 #4100

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2ca9d02
explicitly test 3.13 in test workflow
DanielYang59 Oct 10, 2024
47b4cde
add 3.13 classifier
DanielYang59 Oct 10, 2024
bb4554d
drop install for openff-toolkit for now
DanielYang59 Oct 10, 2024
3661359
bump chgnet to support numpy 2
DanielYang59 Oct 10, 2024
7a8d6ff
loose torch pin
DanielYang59 Oct 10, 2024
f3176b4
try to remove manual install of torch
DanielYang59 Oct 10, 2024
02fbe6a
bump github action version
DanielYang59 Oct 10, 2024
249821b
revert bump of chgnet version
DanielYang59 Oct 10, 2024
2673ce1
bump chgnet to 0.4.0 to support np2
DanielYang59 Oct 10, 2024
dc47253
migrate deprecated config
DanielYang59 Oct 10, 2024
300f4e4
pin python < 3.13 for chgnet and matgl
DanielYang59 Oct 10, 2024
464defe
try to exclude some python313 incompatible packages
DanielYang59 Oct 10, 2024
d01bf59
should work for python 3.13 now
DanielYang59 Oct 10, 2024
16caa14
revert migrated changes
DanielYang59 Oct 10, 2024
5fb01a7
NEED CONFIRM: bump numpy to 1.26.2 to support python 3.13
DanielYang59 Oct 10, 2024
960a44b
bump h5py to support python 3.13
DanielYang59 Oct 10, 2024
a8a765a
bump scipy to support python 3.13
DanielYang59 Oct 10, 2024
44fda8d
merge master
DanielYang59 Nov 19, 2024
0f02418
remove duplicate from merging
DanielYang59 Nov 19, 2024
687effa
clean up comments
DanielYang59 Nov 20, 2024
cb0adc9
skip netcdf4 for python3.13 as 1.6.5 cannot be installed
DanielYang59 Nov 20, 2024
ccda40d
make wheel build quiet
DanielYang59 Nov 20, 2024
0f9d2a1
test openff-toolkit
DanielYang59 Nov 21, 2024
18175db
still cannot install openff-toolkit
DanielYang59 Nov 21, 2024
e3f69e5
clean up comment
DanielYang59 Nov 21, 2024
f2cebdf
Merge branch 'master' into support-python313
shyuep Dec 11, 2024
e7f9b28
Merge branch 'master' into support-python313
DanielYang59 Dec 12, 2024
cf318de
remove manual torch install
DanielYang59 Dec 12, 2024
54bbc6b
fix python version pin
DanielYang59 Dec 20, 2024
b3ca5f2
Merge branch 'master' into support-python313
DanielYang59 Dec 24, 2024
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
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ 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"
resolution: highest
extras: ci,optional
- os: windows-latest
python: "3.10"
python: "3.12"
resolution: highest
extras: ci,optional,numpy-v1 # Test NP1 on Windows (quite buggy ATM)
- os: ubuntu-latest
python: "3.12"
python: "3.13"
resolution: lowest-direct
extras: ci,optional
- os: macos-latest
Expand Down Expand Up @@ -71,19 +71,17 @@ jobs:
- name: Install ubuntu-only conda dependencies
if: matrix.config.os == 'ubuntu-latest'
run: |
micromamba install -n pmg -c conda-forge bader enumlib \
openff-toolkit packmol pygraphviz tblite --yes
micromamba install -n pmg -c conda-forge --yes \
bader enumlib packmol pygraphviz tblite
# openff-toolkit
# TODO: openff-toolkit doesn't support Python 3.13 yet

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install pymatgen and dependencies via uv
run: |
micromamba activate pmg
# TODO1 (use uv over pip) uv install torch is flaky, track #3826
# TODO2 (pin torch version): DGL library (matgl) doesn't support torch > 2.2.1,
# see: https://discuss.dgl.ai/t/filenotfounderror-cannot-find-dgl-c-graphbolt-library/4302
pip install torch==2.2.1

# Install from wheels to test the content
uv build --wheel --no-build-logs
Expand Down
19 changes: 11 additions & 8 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,<3.14"
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 All @@ -64,9 +65,9 @@ dependencies = [
"pybtex>=0.24.0",
"requests>=2.32",
"ruamel.yaml>=0.17.0",
"scipy>=1.13.0",
# scipy<1.14.1 is incompatible with NumPy 2.0 on Windows
# https://github.com/scipy/scipy/issues/21052
"scipy>=1.13.0",
"scipy>=1.14.1; platform_system == 'Windows'",
"spglib>=2.5.0",
"sympy>=1.3", # PR #4116
Expand All @@ -92,27 +93,29 @@ ase = ["ase>=3.23.0"]
ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"]
docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"]
electronic_structure = ["fdint>=2.0.2"]
mlp = ["chgnet>=0.3.8", "matgl>=1.1.3"]
numba = ["numba>=0.55"]
numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM)
mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"]
numba = ["numba>=0.55; python_version<'3.13'"]
numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (buggy at this moment)
optional = [
"pymatgen[abinit,ase,mlp,tblite]",
"beautifulsoup4",
# BoltzTraP2 build fails on Windows GitHub runners
"BoltzTraP2>=24.9.4 ; platform_system != 'Windows'",
# TODO: BoltzTraP2 depends on netcdf4 which doesn't support Python 3.13 yet
"BoltzTraP2>=24.9.4 ; platform_system != 'Windows' and python_version<'3.13'",
"chemview>=0.6",
"f90nml>=1.1.2",
"galore>=0.6.1",
"h5py>=3.11.0",
"hiphive>=1.3.1",
"hiphive>=1.3.1; python_version<'3.13'",
"jarvis-tools>=2020.7.14",
"matplotlib>=3.8",
"openbabel-wheel>=3.1.1.20",
"phonopy>=2.23",
"seekpath>=2.0.1",
]
# tblite only support Python 3.12+ through conda-forge
# https://github.com/tblite/tblite/issues/175
tblite = [ "tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'"]
tblite = ["tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'"]
vis = ["vtk>=6.0.0"]

[project.scripts]
Expand Down
Loading