Skip to content

Support python3.13 #4100

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

Closed
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
67 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
c0d36b1
Merge remote-tracking branch 'upstream/master' into support-python313
DanielYang59 Jan 10, 2025
e3d26b9
Merge branch 'master' into support-python313
DanielYang59 Jan 24, 2025
50f4622
un-skip netcdf4 and BoltzTraP2
DanielYang59 Jan 24, 2025
56108b6
unskip hiphive
DanielYang59 Jan 24, 2025
dcd65e1
unskip numba
DanielYang59 Jan 24, 2025
b7051d7
try to un-skip openff-toolkit
DanielYang59 Jan 24, 2025
4fbf58f
Revert "try to un-skip openff-toolkit"
DanielYang59 Jan 24, 2025
6a6be7b
Merge branch 'master' into support-python313
DanielYang59 Jan 29, 2025
300129b
Merge branch 'master' into support-python313
DanielYang59 Jan 31, 2025
05e98d2
Merge branch 'master' into support-python313
DanielYang59 Jan 31, 2025
5ea26e3
fix mypy error
DanielYang59 Feb 8, 2025
26007e9
add types for analysis.eos
DanielYang59 Feb 8, 2025
c9cc898
TODO: to be reverted, test 3.13 across all platforms
DanielYang59 Feb 9, 2025
3e55250
add requires decorator to is_valid_bibtex
DanielYang59 Feb 9, 2025
5fd64ab
skip prototype test if pybtex is not available
DanielYang59 Feb 9, 2025
b04042c
more readable error msg from the start
DanielYang59 Feb 9, 2025
a73d390
Merge branch 'support-python313' of https://github.com/DanielYang59/p…
DanielYang59 Feb 9, 2025
9f2dda1
make pybtex optional
DanielYang59 Feb 9, 2025
ea66fe3
Merge branch 'master' into support-python313
DanielYang59 Feb 14, 2025
4825b12
Revert "add types for analysis.eos"
DanielYang59 Feb 14, 2025
2692696
revert: make pybtex optional
DanielYang59 Feb 14, 2025
769b2fb
Revert "skip prototype test if pybtex is not available"
DanielYang59 Feb 14, 2025
ebfd917
reapply requires to is_valid_bibtex
DanielYang59 Feb 14, 2025
af559fa
insert debug tags
DanielYang59 Feb 14, 2025
4cf635a
Revert "insert debug tags"
DanielYang59 Feb 14, 2025
f11974f
add PR tag
DanielYang59 Feb 14, 2025
f8830ee
Merge branch 'master' into support-python313
DanielYang59 Feb 18, 2025
26a6558
Merge branch 'master' into support-python313
DanielYang59 Feb 25, 2025
e070511
Merge branch 'master' into support-python313
DanielYang59 Mar 26, 2025
5a62a9c
Merge branch 'master' into support-python313
DanielYang59 Mar 26, 2025
f95bb55
Merge branch 'support-python313' of https://github.com/DanielYang59/p…
DanielYang59 Apr 10, 2025
eac06e4
skip matgl in py 3.13
DanielYang59 Apr 10, 2025
6bb5818
skip matgl on python 3.13
DanielYang59 Apr 10, 2025
d5379cb
also catch runtimeerror from requires
DanielYang59 Apr 10, 2025
003742e
fix excpetion catcher
DanielYang59 Apr 10, 2025
38d8b04
drop python upper pin
DanielYang59 Apr 17, 2025
fc27b81
Merge branch 'master' of github.com:materialsproject/pymatgen into su…
DanielYang59 Apr 17, 2025
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: 5 additions & 10 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,20 +71,15 @@ 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 bader enumlib packmol pygraphviz tblite --yes
# TODO: openff-toolkit doesn't support Python 3.13 yet

- name: Install pymatgen and dependencies via uv
run: |
micromamba activate pmg

pip install uv

# 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 pip install build
python -m build --wheel
Expand Down
35 changes: 23 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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,18 +65,15 @@ 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.14.1; platform_system == 'Windows'",
"scipy>=1.14.1",
"spglib>=2.5.0",
"sympy>=1.3", # PR #4116
"tabulate>=0.9",
"tqdm>=4.60",
"uncertainties>=3.1.4",
# NumPy documentation suggests pinning the current major version as the C API is used
# https://numpy.org/devdocs/dev/depending_on_numpy.html#runtime-dependency-version-ranges
"numpy>=1.25.0,<3",
"numpy>=1.26.2,<3",
]
version = "2024.11.13"

Expand All @@ -90,6 +88,13 @@ Pypi = "https://pypi.org/project/pymatgen"
# PR4128: netcdf4 1.7.[0/1] yanked, 1.7.1.post[1/2]/1.7.2 cause CI error
abinit = ["netcdf4>=1.6.5,!=1.7.1.post1,!=1.7.1.post2,!=1.7.2"]
ase = ["ase>=3.23.0"]
# tblite only support Python 3.12+ through conda-forge
# https://github.com/tblite/tblite/issues/175
tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"]
vis = ["vtk>=6.0.0"]
abinit = ["netcdf4>=1.7.1; python_version<'3.13'"]
mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"]
electronic_structure = ["fdint>=2.0.2"]
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"]
Expand All @@ -100,21 +105,27 @@ 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",
"chgnet>=0.4.0; python_version<'3.13'",
"f90nml>=1.1.2",
"galore>=0.6.1",
"h5py>=3.11.0",
"hiphive>=1.3.1",
"h5py>=3.12.1",
"jarvis-tools>=2020.7.14",
"matgl>=1.1.3; python_version<'3.13'",
"matplotlib>=3.8",
"netcdf4>=1.6.5; python_version<'3.13'",
"phonopy>=2.23",
"seekpath>=2.0.1",
# tblite only support Python 3.12+ through conda-forge
# https://github.com/tblite/tblite/issues/175
"hiphive>=1.3.1; python_version<'3.13'",
"openbabel-wheel>=3.1.1.20",
"tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'",
]
# 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'"]
vis = ["vtk>=6.0.0"]
numba = ["numba>=0.55; python_version<'3.13'"]
numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM)

[project.scripts]
pmg = "pymatgen.cli.pmg:main"
Expand Down
Loading