Skip to content

Commit bb4afb7

Browse files
authored
Update the metadata for metatomic-torchsim (#180)
* Update the project metadata for metatomic-torchsim * Update the project to use packaging 26
1 parent b5b3598 commit bb4afb7

11 files changed

Lines changed: 32 additions & 31 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ changelog = "https://docs.metatensor.org/metatomic/latest/torch/CHANGELOG.html"
3434
### ======================================================================== ###
3535

3636
[build-system]
37-
requires = [
38-
"setuptools >=77",
39-
"packaging >=23",
40-
]
37+
requires = ["setuptools >=77"]
4138
build-backend = "setuptools.build_meta"
4239

4340
[tool.setuptools]

python/metatomic_torch/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ changelog = "https://docs.metatensor.org/metatomic/latest/torch/CHANGELOG.html"
3434
[build-system]
3535
requires = [
3636
"setuptools >=77",
37-
"packaging >=23",
37+
"packaging >=26",
3838
"cmake",
3939
"metatensor-torch >=0.8.0,<0.9.0",
4040
# we also add torch to this list in the build backend below

python/metatomic_torch/setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,12 @@ def create_version_number(version):
229229
release = (major, minor + 1, 0)
230230
pre = None
231231

232-
# this is using a private API which is intended to become public soon:
233-
# https://github.com/pypa/packaging/pull/698. In the mean time we'll
234-
# use this
235-
version._version = version._version._replace(release=release)
236-
version._version = version._version._replace(pre=pre)
237-
version._version = version._version._replace(dev=("dev", n_commits))
238-
version._version = version._version._replace(local=(git_hash,))
232+
version = version.__replace__(
233+
release=release,
234+
pre=pre,
235+
dev=n_commits,
236+
local=git_hash,
237+
)
239238

240239
return str(version)
241240

python/metatomic_torchsim/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1313
1414
### Removed
1515
-->
16+
17+
## [Unreleased](https://github.com/metatensor/metatomic/)
18+
19+
- `metatomic-torchsim` is now a standalone package, containing the TorchSim
20+
integration for metatomic models.

python/metatomic_torchsim/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include AUTHORS
2+
include LICENSE
23
include git_version_info
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# metatomic-torchsim
22

3-
TorchSim integration for metatomic atomistic models.
3+
TorchSim integration for metatomic models.
44

5-
Wraps metatomic models as TorchSim `ModelInterface` instances, enabling their
6-
use in TorchSim molecular dynamics and other simulation workflows.
5+
This package allows you to wrap metatomic models as TorchSim `ModelInterface`
6+
instances, enabling their use in TorchSim molecular dynamics and other
7+
simulation workflows.
78

89
## Installation
910

1011
```bash
1112
pip install metatomic-torchsim
1213
```
1314

14-
For universal potential models, see
15-
[upet](https://github.com/lab-cosmo/upet).
16-
1715
## Usage
1816

1917
```python
@@ -29,5 +27,6 @@ forces = output["forces"]
2927
stress = output["stress"]
3028
```
3129

32-
For full documentation, see the
33-
[torch-sim engine page](https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html).
30+
For full documentation, see the [torch-sim engine
31+
page](https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html) in
32+
metatomic documentation.

python/metatomic_torchsim/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ dependencies = [
3232
homepage = "https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html"
3333
documentation = "https://docs.metatensor.org/metatomic/latest/engines/torch-sim.html"
3434
repository = "https://github.com/metatensor/metatomic/tree/main/python/metatomic_torchsim"
35+
changelog = "https://github.com/metatensor/metatomic/blob/main/python/metatomic_torchsim/CHANGELOG.md"
3536

3637
### ======================================================================== ###
3738

3839
[build-system]
3940
requires = [
4041
"setuptools >=77",
41-
"packaging >=23",
42+
"packaging >=26",
4243
]
4344
build-backend = "setuptools.build_meta"
4445

python/metatomic_torchsim/setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,12 @@ def create_version_number(version):
9090
release = (major, minor + 1, 0)
9191
pre = None
9292

93-
# this is using a private API which is intended to become public soon:
94-
# https://github.com/pypa/packaging/pull/698. In the mean time we'll
95-
# use this
96-
version._version = version._version._replace(release=release)
97-
version._version = version._version._replace(pre=pre)
98-
version._version = version._version._replace(dev=("dev", n_commits))
99-
version._version = version._version._replace(local=(git_hash,))
93+
version = version.__replace__(
94+
release=release,
95+
pre=pre,
96+
dev=n_commits,
97+
local=git_hash,
98+
)
10099

101100
return str(version)
102101

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
ROOT = os.path.realpath(os.path.dirname(__file__))
77
METATOMIC_TORCH = os.path.join(ROOT, "python", "metatomic_torch")
8+
METATOMIC_TORCHSIM = os.path.join(ROOT, "python", "metatomic_torchsim")
89

910

1011
if __name__ == "__main__":
@@ -13,8 +14,6 @@
1314
# when packaging a sdist for release, we should never use local dependencies
1415
METATOMIC_NO_LOCAL_DEPS = os.environ.get("METATOMIC_NO_LOCAL_DEPS", "0") == "1"
1516

16-
METATOMIC_TORCHSIM = os.path.join(ROOT, "python", "metatomic_torchsim")
17-
1817
if not METATOMIC_NO_LOCAL_DEPS and os.path.exists(METATOMIC_TORCH):
1918
# we are building from a git checkout
2019
extras_require["torch"] = f"metatomic-torch @ file://{METATOMIC_TORCH}"

0 commit comments

Comments
 (0)