Skip to content
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
5 changes: 3 additions & 2 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
name: ${{ matrix.name }} (torch v${{ matrix.torch-version }})
strategy:
matrix:
torch-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10', '2.11']
torch-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10', '2.11', '2.12']
arch: ['arm64', 'x86_64']
os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15', 'windows-2022']
exclude:
Expand Down Expand Up @@ -139,7 +139,8 @@ jobs:
- {torch-version: '2.8', cibw-python: 'cp312-*'}
- {torch-version: '2.9', cibw-python: 'cp312-*'}
- {torch-version: '2.10', cibw-python: 'cp313-*'}
- {torch-version: '2.11', cibw-python: 'cp313-*'}
- {torch-version: '2.11', cibw-python: 'cp314-*'}
- {torch-version: '2.12', cibw-python: 'cp314-*'}
steps:
- uses: actions/checkout@v6
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/torch-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cargo-test-flags: --release

- os: ubuntu-24.04
torch-version: "2.11"
torch-version: "2.12"
python-version: "3.13"
cargo-test-flags: --release
do-valgrind: true
Expand All @@ -33,18 +33,18 @@ jobs:
- os: ubuntu-24.04
container: ubuntu:22.04
extra-name: ", cmake 3.22"
torch-version: "2.11"
torch-version: "2.12"
python-version: "3.13"
cargo-test-flags: ""
cxx-flags: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -g

- os: macos-15
torch-version: "2.11"
torch-version: "2.12"
python-version: "3.13"
cargo-test-flags: --release

- os: windows-2022
torch-version: "2.11"
torch-version: "2.12"
python-version: "3.13"
cargo-test-flags: --release

Expand Down
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ myst-parser # markdown => rst translation, used in extensions/featomic_json_

# dependencies for the tutorials
--extra-index-url https://download.pytorch.org/whl/cpu
metatensor-operations >=0.5.0-rc2,<0.6
metatensor-torch >=0.9.0-rc6,<0.10
metatomic-torch >= 0.1.12-rc2,<0.2
metatensor-operations >=0.5.0,<0.6
metatensor-torch >=0.9.0,<0.10
metatomic-torch >= 0.1.12,<0.2
torch
chemfiles
matplotlib
Expand Down
5 changes: 4 additions & 1 deletion featomic-torch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows
### Removed
-->

## [Version 0.7.4](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.4) - 2026-05-15

### Changed

- Added support for torch v2.11
- Added support for torch v2.11 and v2.12
- The code is now compatible with metatensor-torch v0.9.0

## [Version 0.7.3](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.3) - 2026-02-03

Expand Down
10 changes: 5 additions & 5 deletions featomic-torch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function(check_compatible_versions _dependency_ _actual_ _requested_)
endfunction()


set(REQUIRED_FEATOMIC_VERSION "0.6.6-rc1")
set(REQUIRED_FEATOMIC_VERSION "0.6.6")
if (NOT "$ENV{FEATOMIC_NO_LOCAL_DEPS}" STREQUAL "1")
# If building a dev version, we also need to update the
# REQUIRED_FEATOMIC_VERSION in the same way we update the
Expand Down Expand Up @@ -122,7 +122,7 @@ find_package(Torch 2.3 REQUIRED)
#
# When updating METATENSOR_TORCH_FETCH_VERSION, you will also have to update the
# SHA256 sum of the file in `FetchContent_Declare`.
set(METATENSOR_TORCH_FETCH_VERSION "0.9.0-rc6")
set(METATENSOR_TORCH_FETCH_VERSION "0.9.0")
set(REQUIRED_METATENSOR_TORCH_VERSION "0.9")
if (FEATOMIC_FETCH_METATENSOR_TORCH)
message(STATUS "Fetching metatensor-torch from github")
Expand All @@ -132,7 +132,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH)
FetchContent_Declare(
metatensor_torch
URL ${URL_ROOT}/metatensor-torch-v${METATENSOR_TORCH_FETCH_VERSION}/metatensor-torch-cxx-${METATENSOR_TORCH_FETCH_VERSION}.tar.gz
URL_HASH SHA256=73afb6795a04e6e31a993d11e35183d3aa3e97b2d30e14b1a4a04c45263a13bc
URL_HASH SHA256=4e31c235447b6bc14c7703c640e2f35409813c2f159a32b8d23386ad4a5abd57
)

FetchContent_MakeAvailable(metatensor_torch)
Expand All @@ -150,7 +150,7 @@ endif()
#
# When updating METATOMIC_TORCH_FETCH_VERSION, you will also have to update the
# SHA256 sum of the file in `FetchContent_Declare`.
set(METATOMIC_TORCH_FETCH_VERSION "0.1.12-rc2")
set(METATOMIC_TORCH_FETCH_VERSION "0.1.12")
set(REQUIRED_METATOMIC_TORCH_VERSION "0.1")
if (FEATOMIC_FETCH_METATENSOR_TORCH)
message(STATUS "Fetching metatomic-torch from github")
Expand All @@ -160,7 +160,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH)
FetchContent_Declare(
metatomic_torch
URL ${URL_ROOT}/metatomic-torch-v${METATOMIC_TORCH_FETCH_VERSION}/metatomic-torch-cxx-${METATOMIC_TORCH_FETCH_VERSION}.tar.gz
URL_HASH SHA256=38a0de4d9320487405b13ed208013895b829ab74cf9bb774e88c5b628368fc49
URL_HASH SHA256=d9e587c7ce3d9d6338ed5f6da119e2a3b29698381886f36a53603523c0499542
)

FetchContent_MakeAvailable(metatomic_torch)
Expand Down
2 changes: 1 addition & 1 deletion featomic-torch/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.4-rc2
0.7.4
2 changes: 1 addition & 1 deletion featomic-torch/tests/cmake-project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(featomic-torch-test-cmake-project CXX)
# We need to update the REQUIRED_FEATOMIC_VERSION in the same way we update the
# featomic version for dev builds
include(../../cmake/dev-versions.cmake)
set(REQUIRED_FEATOMIC_TORCH_VERSION "0.7.4-rc2")
set(REQUIRED_FEATOMIC_TORCH_VERSION "0.7.4")
create_development_version("${REQUIRED_FEATOMIC_TORCH_VERSION}" FEATOMIC_TORCH_FULL_VERSION "featomic-torch-v")
string(REGEX REPLACE "([0-9]*)\\.([0-9]*).*" "\\1.\\2" REQUIRED_FEATOMIC_TORCH_VERSION ${FEATOMIC_TORCH_FULL_VERSION})
find_package(featomic_torch ${REQUIRED_FEATOMIC_TORCH_VERSION} REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion featomic-torch/tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn setup_pytorch(build_dir: PathBuf) -> PathBuf {
.expect("failed to run python");
assert!(status.success(), "failed to run `python -m pip install --upgrade pip`");

let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.11.*".into());
let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.12.*".into());
let status = Command::new(&python)
.arg("-m")
.arg("pip")
Expand Down
6 changes: 6 additions & 0 deletions featomic/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows
### Removed
-->

## [Version 0.6.6](https://github.com/metatensor/featomic/releases/tag/featomic-v0.6.6) - 2026-05-15

### Changed

- The code is now compatible with metatensor v0.2.0

## [Version 0.6.5](https://github.com/metatensor/featomic/releases/tag/featomic-v0.6.5) - 2026-03-31

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions featomic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ endif()
#
# When updating METATENSOR_FETCH_VERSION, you will also have to update the
# SHA256 sum of the file in `FetchContent_Declare`.
set(METATENSOR_FETCH_VERSION "0.2.0-rc4")
set(METATENSOR_FETCH_VERSION "0.2.0")
set(METATENSOR_REQUIRED_VERSION "0.2")
if (FEATOMIC_FETCH_METATENSOR)
message(STATUS "Fetching metatensor-core from github")
Expand All @@ -256,7 +256,7 @@ if (FEATOMIC_FETCH_METATENSOR)
FetchContent_Declare(
metatensor
URL ${URL_ROOT}/metatensor-core-v${METATENSOR_FETCH_VERSION}/metatensor-core-cxx-${METATENSOR_FETCH_VERSION}.tar.gz
URL_HASH SHA256=192b8a416cf83e9fbfd0e45c5d4b8d9787e715463b767982e55dc69af309fb34
URL_HASH SHA256=809a799b1c8d58b7ede3868d6ebe4123924ba31e4637481f9ca5c8a0ed14be17
)

FetchContent_MakeAvailable(metatensor)
Expand Down
6 changes: 3 additions & 3 deletions featomic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "featomic"
version = "0.6.6-rc1"
version = "0.6.6"
authors = ["Guillaume Fraux <guillaume.fraux@epfl.ch>"]
edition = "2021"
rust-version = "1.74"
Expand All @@ -25,7 +25,7 @@ metatensor-static = ["metatensor/static"]
all-features = true

[dependencies]
metatensor = { version = "0.3.0-rc2", features = ["rayon"]}
metatensor = { version = "0.3.0", features = ["rayon"]}

ndarray = {version = "0.17", features = ["rayon", "serde", "approx"]}
num-traits = "0.2"
Expand Down Expand Up @@ -59,7 +59,7 @@ toml_writer = "=1.0.2"
[build-dependencies]
cbindgen = { version = "0.29", default-features = false }
fs_extra = "1"
metatensor = { version = "0.3.0-rc2" }
metatensor = { version = "0.3.0" }

# the last versions that supports Rust 1.74
tempfile = "=3.24.0"
Expand Down
2 changes: 1 addition & 1 deletion featomic/tests/cmake-project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(featomic-test-cmake-project C CXX)
# We need to update the REQUIRED_FEATOMIC_VERSION in the same way we update the
# featomic version for dev builds
include(../../cmake/dev-versions.cmake)
set(REQUIRED_FEATOMIC_VERSION "0.6.6-rc1")
set(REQUIRED_FEATOMIC_VERSION "0.6.6")
create_development_version("${REQUIRED_FEATOMIC_VERSION}" FEATOMIC_FULL_VERSION "featomic-v")
string(REGEX REPLACE "([0-9]*)\\.([0-9]*).*" "\\1.\\2" REQUIRED_FEATOMIC_VERSION ${FEATOMIC_FULL_VERSION})
find_package(featomic ${REQUIRED_FEATOMIC_VERSION} REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion python/featomic/build-backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def get_requires_for_build_wheel(config_settings=None):
defaults = build_meta.get_requires_for_build_wheel(config_settings)
return defaults + [
"cmake",
"metatensor-core >=0.2.0rc4,<0.3",
"metatensor-core >=0.2.0,<0.3",
]
4 changes: 2 additions & 2 deletions python/featomic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ classifiers = [
]

dependencies = [
"metatensor-core >=0.2.0rc4,<0.3",
"metatensor-operations >=0.5.0rc2,<0.6",
"metatensor-core >=0.2.0,<0.3",
"metatensor-operations >=0.5.0,<0.6",
"wigners",
]

Expand Down
41 changes: 20 additions & 21 deletions python/featomic/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import glob
import os
import pathlib
import subprocess
import sys

Expand All @@ -11,8 +12,8 @@
from setuptools.command.sdist import sdist


ROOT = os.path.realpath(os.path.dirname(__file__))
FEATOMIC_SRC = os.path.realpath(os.path.join(ROOT, "..", "..", "featomic"))
ROOT = pathlib.Path(__file__).parent.resolve()
FEATOMIC_SRC = (ROOT / ".." / ".." / "featomic").resolve()

FEATOMIC_BUILD_TYPE = os.environ.get("FEATOMIC_BUILD_TYPE", "release")
if FEATOMIC_BUILD_TYPE not in ["debug", "release"]:
Expand All @@ -21,9 +22,7 @@
"expected 'debug' or 'release'"
)

# The code for featomic-torch needs to live in `featomic_torch` directory until
# https://github.com/pypa/pip/issues/13093 is fixed.
FEATOMIC_TORCH_SRC = os.path.realpath(os.path.join(ROOT, "..", "featomic_torch"))
FEATOMIC_TORCH_SRC = (ROOT / ".." / "featomic_torch").resolve()


class universal_wheel(bdist_wheel):
Expand All @@ -47,8 +46,8 @@ def run(self):
import metatensor

source_dir = FEATOMIC_SRC
build_dir = os.path.join(ROOT, "build", "cmake-build")
install_dir = os.path.join(os.path.realpath(self.build_lib), "featomic")
build_dir = ROOT / "build" / "cmake-build"
install_dir = pathlib.Path(self.build_lib).resolve() / "featomic"

try:
os.mkdir(build_dir)
Expand Down Expand Up @@ -154,8 +153,8 @@ def run(self):


def generate_cxx_tar():
script = os.path.join(ROOT, "..", "..", "scripts", "package-featomic.sh")
assert os.path.exists(script)
script = ROOT / ".." / ".." / "scripts" / "package-featomic.sh"
assert script.exists()

try:
output = subprocess.run(
Expand Down Expand Up @@ -184,7 +183,7 @@ def generate_cxx_tar():

def get_rust_version():
# read version from Cargo.toml
with open(os.path.join(FEATOMIC_SRC, "Cargo.toml")) as fd:
with open(FEATOMIC_SRC / "Cargo.toml") as fd:
for line in fd:
if line.startswith("version"):
_, version = line.split(" = ")
Expand All @@ -204,15 +203,15 @@ def git_version_info():
"""
TAG_PREFIX = "featomic-v"

if os.path.exists("git_version_info"):
if (ROOT / "git_version_info").exists():
# we are building from a sdist, without git available, but the git
# version was recorded in the `git_version_info` file
with open("git_version_info") as fd:
with open(ROOT / "git_version_info") as fd:
n_commits = int(fd.readline().strip())
git_hash = fd.readline().strip()
else:
script = os.path.join(ROOT, "..", "..", "scripts", "git-version-info.py")
assert os.path.exists(script)
script = ROOT / ".." / ".." / "scripts" / "git-version-info.py"
assert script.exists()

output = subprocess.run(
[sys.executable, script, TAG_PREFIX],
Expand Down Expand Up @@ -268,10 +267,10 @@ def create_version_number(version):


if __name__ == "__main__":
if not os.path.exists(FEATOMIC_SRC):
if not FEATOMIC_SRC.exists():
# we are building from a sdist, which should include featomic Rust
# sources as a tarball
tarballs = glob.glob(os.path.join(ROOT, "featomic-*.tar.gz"))
tarballs = glob.glob("featomic-*.tar.gz", root_dir=ROOT)

if not len(tarballs) == 1:
raise RuntimeError(
Expand All @@ -280,25 +279,25 @@ def create_version_number(version):
"scripts/package-featomic.sh"
)

FEATOMIC_SRC = os.path.realpath(tarballs[0])
FEATOMIC_SRC = pathlib.Path(tarballs[0]).resolve()
subprocess.run(
["cmake", "-E", "tar", "xf", FEATOMIC_SRC],
cwd=ROOT,
check=True,
)

FEATOMIC_SRC = ".".join(FEATOMIC_SRC.split(".")[:-2])
FEATOMIC_SRC = pathlib.Path(".".join(str(FEATOMIC_SRC).split(".")[:-2]))

with open(os.path.join(ROOT, "AUTHORS")) as fd:
with open(ROOT / "AUTHORS") as fd:
authors = fd.read().splitlines()

extras_require = {}

# when packaging a sdist for release, we should never use local dependencies
FEATOMIC_NO_LOCAL_DEPS = os.environ.get("FEATOMIC_NO_LOCAL_DEPS", "0") == "1"
if not FEATOMIC_NO_LOCAL_DEPS and os.path.exists(FEATOMIC_TORCH_SRC):
if not FEATOMIC_NO_LOCAL_DEPS and FEATOMIC_TORCH_SRC.exists():
# we are building from a git checkout
extras_require["torch"] = f"featomic-torch @ file://{FEATOMIC_TORCH_SRC}"
extras_require["torch"] = f"featomic-torch @ {FEATOMIC_TORCH_SRC.as_uri()}"
else:
# we are building from a sdist/installing from a wheel
extras_require["torch"] = "featomic-torch"
Expand Down
15 changes: 8 additions & 7 deletions python/featomic_torch/build-backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# dependencies to featomic, using the local version if it exists, and otherwise
# falling back to the one on PyPI.
import os
import pathlib

from setuptools import build_meta


ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
FEATOMIC_SRC = os.path.realpath(os.path.join(ROOT, "..", "featomic"))
ROOT = pathlib.Path(__file__).parent.parent.resolve()
FEATOMIC_SRC = (ROOT / ".." / "featomic").resolve()
FORCED_FEATOMIC_VERSION = os.environ.get("FEATOMIC_TORCH_BUILD_WITH_FEATOMIC_VERSION")

FEATOMIC_NO_LOCAL_DEPS = os.environ.get("FEATOMIC_NO_LOCAL_DEPS", "0") == "1"
Expand All @@ -17,12 +18,12 @@
# from a sdist on a non-released version
FEATOMIC_DEP = f"featomic =={FORCED_FEATOMIC_VERSION}"

elif not FEATOMIC_NO_LOCAL_DEPS and os.path.exists(FEATOMIC_SRC):
elif not FEATOMIC_NO_LOCAL_DEPS and FEATOMIC_SRC.exists():
# we are building from a git checkout
FEATOMIC_DEP = f"featomic @ file://{FEATOMIC_SRC}"
FEATOMIC_DEP = f"featomic @ {FEATOMIC_SRC.as_uri()}"
else:
# we are building from a sdist
FEATOMIC_DEP = "featomic >=0.6.6rc1,<0.7"
FEATOMIC_DEP = "featomic >=0.6.6,<0.7"

FORCED_TORCH_VERSION = os.environ.get("FEATOMIC_TORCH_BUILD_WITH_TORCH_VERSION")
if FORCED_TORCH_VERSION is not None:
Expand All @@ -42,7 +43,7 @@ def get_requires_for_build_wheel(config_settings=None):
return defaults + [
"cmake",
TORCH_DEP,
"metatensor-torch >=0.9.0rc6,<0.10",
"metatomic-torch >=0.1.12rc2,<0.2",
"metatensor-torch >=0.9.0,<0.10",
"metatomic-torch >=0.1.12,<0.2",
FEATOMIC_DEP,
]
Loading
Loading