From 5b2663a12d6c4d84a243cc49b7c74c1a60c50a8c Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Tue, 17 Mar 2026 15:48:56 +0100 Subject: [PATCH 1/2] Update the project metadata for metatomic-torchsim --- python/metatomic_torchsim/CHANGELOG.md | 5 +++++ python/metatomic_torchsim/LICENSE | 1 + python/metatomic_torchsim/MANIFEST.in | 1 + python/metatomic_torchsim/README.md | 15 +++++++-------- python/metatomic_torchsim/pyproject.toml | 1 + setup.py | 3 +-- 6 files changed, 16 insertions(+), 10 deletions(-) create mode 120000 python/metatomic_torchsim/LICENSE diff --git a/python/metatomic_torchsim/CHANGELOG.md b/python/metatomic_torchsim/CHANGELOG.md index c56cd6303..d74929e06 100644 --- a/python/metatomic_torchsim/CHANGELOG.md +++ b/python/metatomic_torchsim/CHANGELOG.md @@ -13,3 +13,8 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Removed --> + +## [Unreleased](https://github.com/metatensor/metatomic/) + +- `metatomic-torchsim` is now a standalone package, containing the TorchSim + integration for metatomic models. diff --git a/python/metatomic_torchsim/LICENSE b/python/metatomic_torchsim/LICENSE new file mode 120000 index 000000000..30cff7403 --- /dev/null +++ b/python/metatomic_torchsim/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/python/metatomic_torchsim/MANIFEST.in b/python/metatomic_torchsim/MANIFEST.in index 576b01ef3..7f7a9efed 100644 --- a/python/metatomic_torchsim/MANIFEST.in +++ b/python/metatomic_torchsim/MANIFEST.in @@ -1,2 +1,3 @@ include AUTHORS +include LICENSE include git_version_info diff --git a/python/metatomic_torchsim/README.md b/python/metatomic_torchsim/README.md index 275dbb411..cf474c860 100644 --- a/python/metatomic_torchsim/README.md +++ b/python/metatomic_torchsim/README.md @@ -1,9 +1,10 @@ # metatomic-torchsim -TorchSim integration for metatomic atomistic models. +TorchSim integration for metatomic models. -Wraps metatomic models as TorchSim `ModelInterface` instances, enabling their -use in TorchSim molecular dynamics and other simulation workflows. +This package allows you to wrap metatomic models as TorchSim `ModelInterface` +instances, enabling their use in TorchSim molecular dynamics and other +simulation workflows. ## Installation @@ -11,9 +12,6 @@ use in TorchSim molecular dynamics and other simulation workflows. pip install metatomic-torchsim ``` -For universal potential models, see -[upet](https://github.com/lab-cosmo/upet). - ## Usage ```python @@ -29,5 +27,6 @@ forces = output["forces"] stress = output["stress"] ``` -For full documentation, see the -[torch-sim engine page](https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html). +For full documentation, see the [torch-sim engine +page](https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html) in +metatomic documentation. diff --git a/python/metatomic_torchsim/pyproject.toml b/python/metatomic_torchsim/pyproject.toml index a1252ef88..059ae6bc3 100644 --- a/python/metatomic_torchsim/pyproject.toml +++ b/python/metatomic_torchsim/pyproject.toml @@ -32,6 +32,7 @@ dependencies = [ homepage = "https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html" documentation = "https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html" repository = "https://github.com/metatensor/metatomic/tree/main/python/metatomic_torchsim" +changelog = "https://github.com/metatensor/metatomic/blob/main/python/metatomic_torchsim/CHANGELOG.md" ### ======================================================================== ### diff --git a/setup.py b/setup.py index b38f1ba0e..ced9f7146 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ ROOT = os.path.realpath(os.path.dirname(__file__)) METATOMIC_TORCH = os.path.join(ROOT, "python", "metatomic_torch") +METATOMIC_TORCHSIM = os.path.join(ROOT, "python", "metatomic_torchsim") if __name__ == "__main__": @@ -13,8 +14,6 @@ # when packaging a sdist for release, we should never use local dependencies METATOMIC_NO_LOCAL_DEPS = os.environ.get("METATOMIC_NO_LOCAL_DEPS", "0") == "1" - METATOMIC_TORCHSIM = os.path.join(ROOT, "python", "metatomic_torchsim") - if not METATOMIC_NO_LOCAL_DEPS and os.path.exists(METATOMIC_TORCH): # we are building from a git checkout extras_require["torch"] = f"metatomic-torch @ file://{METATOMIC_TORCH}" From 9e34977b431c5bd0cae8516b11fb68d41d059d4c Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Tue, 17 Mar 2026 15:53:51 +0100 Subject: [PATCH 2/2] Update the project to use packaging 26 --- pyproject.toml | 5 +---- python/metatomic_torch/pyproject.toml | 2 +- python/metatomic_torch/setup.py | 13 ++++++------- python/metatomic_torchsim/pyproject.toml | 2 +- python/metatomic_torchsim/setup.py | 13 ++++++------- tox.ini | 2 +- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6be6ad3f0..2e5270427 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,10 +34,7 @@ changelog = "https://docs.metatensor.org/metatomic/latest/torch/CHANGELOG.html" ### ======================================================================== ### [build-system] -requires = [ - "setuptools >=77", - "packaging >=23", -] +requires = ["setuptools >=77"] build-backend = "setuptools.build_meta" [tool.setuptools] diff --git a/python/metatomic_torch/pyproject.toml b/python/metatomic_torch/pyproject.toml index 9107dafd5..5cc4be61e 100644 --- a/python/metatomic_torch/pyproject.toml +++ b/python/metatomic_torch/pyproject.toml @@ -34,7 +34,7 @@ changelog = "https://docs.metatensor.org/metatomic/latest/torch/CHANGELOG.html" [build-system] requires = [ "setuptools >=77", - "packaging >=23", + "packaging >=26", "cmake", "metatensor-torch >=0.8.0,<0.9.0", # we also add torch to this list in the build backend below diff --git a/python/metatomic_torch/setup.py b/python/metatomic_torch/setup.py index 2335be98f..6ab76d98b 100644 --- a/python/metatomic_torch/setup.py +++ b/python/metatomic_torch/setup.py @@ -229,13 +229,12 @@ def create_version_number(version): release = (major, minor + 1, 0) pre = None - # this is using a private API which is intended to become public soon: - # https://github.com/pypa/packaging/pull/698. In the mean time we'll - # use this - version._version = version._version._replace(release=release) - version._version = version._version._replace(pre=pre) - version._version = version._version._replace(dev=("dev", n_commits)) - version._version = version._version._replace(local=(git_hash,)) + version = version.__replace__( + release=release, + pre=pre, + dev=n_commits, + local=git_hash, + ) return str(version) diff --git a/python/metatomic_torchsim/pyproject.toml b/python/metatomic_torchsim/pyproject.toml index 059ae6bc3..4a76680a0 100644 --- a/python/metatomic_torchsim/pyproject.toml +++ b/python/metatomic_torchsim/pyproject.toml @@ -39,7 +39,7 @@ changelog = "https://github.com/metatensor/metatomic/blob/main/python/metatomic_ [build-system] requires = [ "setuptools >=77", - "packaging >=23", + "packaging >=26", ] build-backend = "setuptools.build_meta" diff --git a/python/metatomic_torchsim/setup.py b/python/metatomic_torchsim/setup.py index 9d542f8d1..328c246a6 100644 --- a/python/metatomic_torchsim/setup.py +++ b/python/metatomic_torchsim/setup.py @@ -90,13 +90,12 @@ def create_version_number(version): release = (major, minor + 1, 0) pre = None - # this is using a private API which is intended to become public soon: - # https://github.com/pypa/packaging/pull/698. In the mean time we'll - # use this - version._version = version._version._replace(release=release) - version._version = version._version._replace(pre=pre) - version._version = version._version._replace(dev=("dev", n_commits)) - version._version = version._version._replace(local=(git_hash,)) + version = version.__replace__( + release=release, + pre=pre, + dev=n_commits, + local=git_hash, + ) return str(version) diff --git a/tox.ini b/tox.ini index cdcd65179..7f0c85c46 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ build_single_wheel = --no-deps --no-build-isolation --check-build-dependencies packaging_deps = setuptools >= 77 - packaging >= 23 + packaging >=26 cmake testing_deps =