Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a668508
feat: query chemfiles and readcon in the Lua build
HaoZeke Nov 19, 2026
3d15b4f
ci: build and test with chemfiles and readcon-core
HaoZeke Nov 19, 2026
190e424
docs: record the release path and software authors
HaoZeke Nov 19, 2026
0e928ec
fix: follow the seams-core reader macros
HaoZeke Nov 19, 2026
570ad29
ci: note the readcon-core floor when the wrap moves
HaoZeke Nov 19, 2026
7e52f6c
build: regenerate version copies with cogapp
HaoZeke Nov 19, 2026
0640724
docs: keep the software author list from the base
HaoZeke Nov 19, 2026
4ab7311
fix: write the release version with meson rewrite
HaoZeke Nov 19, 2026
291253b
docs: restore the Lua reference to the base text
HaoZeke Nov 19, 2026
18f84c2
fix: parse the meson rewrite project version in Sphinx
HaoZeke Nov 19, 2026
8567c3d
build: stamp the citation ship date and Doxyfile version with cogapp
HaoZeke Nov 19, 2026
45815f5
docs: describe the ship date and the unreleased changelog preview
HaoZeke Nov 19, 2026
c1bcfc2
docs: list has_chemfiles and has_readcon
HaoZeke Nov 19, 2026
80847e6
test: read a two-atom DCD fixture
HaoZeke Nov 19, 2026
b50e495
fix: stamp the citation date on bump and check the DCD box
HaoZeke Nov 19, 2026
bb2b302
fix(readers): honor disable flags and harden readers CI (#43)
HaoZeke Nov 20, 2026
fa6bb8d
fix(docs): resolve edit links from the built ref (#43)
HaoZeke Nov 20, 2026
379593c
fix: install the LuaRocks rock where require can find it (#43)
HaoZeke Nov 20, 2026
a0c9073
fix: run Meson tests under the Lua version the module links (#43)
HaoZeke Nov 20, 2026
838d928
ci: test Lua 5.3 and 5.4 builds with both installed (#43)
HaoZeke Nov 20, 2026
37acd3f
fix: accept fennel 1.5.3 up to 2.0 in the rockspec (#43)
HaoZeke Nov 20, 2026
24c894c
ci: run LuaRocks on Lua 5.4 so the rockspec installs fennel (#43)
HaoZeke Nov 21, 2026
ab48254
test: check every reader in every build instead of skipping (#43)
HaoZeke Nov 21, 2026
44f985e
docs: leave the release process page to main (#43)
HaoZeke Nov 21, 2026
51b6ed4
docs: add a changelog fragment for the rockspec (#43)
HaoZeke Nov 21, 2026
77d6b20
docs: keep the DCD box lengths in one testing paragraph (#43)
HaoZeke Nov 21, 2026
21260ca
ci: fail on a nonzero skip count with any Meson version (#43)
HaoZeke Nov 21, 2026
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
170 changes: 169 additions & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build_test:
name: ${{ matrix.os }}
Expand All @@ -28,16 +30,35 @@ jobs:
libblas
liblapack
lua=5.4
luarocks=3.12.2=lua54*
cmake
cache-environment: true
# conda-forge has no Lua 5.4 build of luarocks 3.13.0, so an unpinned
# luarocks resolves to the LuaJIT build. LuaJIT cannot load the
# luarocks.org manifest (more than 65536 constants in one chunk), and
# the rockspec's fennel dependency is then unresolvable.
- name: LuaRocks runs on Lua 5.4
shell: bash -el {0}
run: |
set -euxo pipefail
luarocks --version
lr_lua=$(luarocks config variables.LUA)
"$lr_lua" -e 'assert(_VERSION == "Lua 5.4", _VERSION); assert(jit == nil, "LuaJIT")'
- name: Configure and build
shell: bash -el {0}
run: |
meson setup bbdir --prefix=/usr --libdir=lib --wrap-mode=nofallback
meson compile -C bbdir
- name: Tests
shell: bash -el {0}
run: meson test -C bbdir -v --print-errorlogs
run: |
set -euxo pipefail
meson test -C bbdir -v --print-errorlogs
if grep -Eq '^Skipped:[[:space:]]+[1-9]' bbdir/meson-logs/testlog.txt; then
echo 'meson test skipped tests' >&2
exit 1
fi
test "$(grep -c '^missing input/readers/' bbdir/meson-logs/testlog.txt)" -eq 4
- name: Test staged install
shell: bash -el {0}
run: |
Expand All @@ -46,3 +67,150 @@ jobs:
export LUA_CPATH="$PWD/stage/usr/lib/?.so;;"
export DSEAMS_INSTALL_ROOT="$PWD/stage"
lua example_lua/library/installed.lua
- name: Test LuaRocks local-tree install
shell: bash -el {0}
run: |
set -euxo pipefail
luarocks --lua-version=5.4 make --tree "$PWD/.luarocks" rockspec
luarocks --lua-version=5.4 --tree "$PWD/.luarocks" list --porcelain
luarocks --lua-version=5.4 --tree "$PWD/.luarocks" list --porcelain fennel | grep -E '^fennel[[:space:]]+1\.'
eval "$(luarocks --lua-version=5.4 path --tree "$PWD/.luarocks")"
lua -e 'local tree = os.getenv("PWD") .. "/.luarocks/"; local fennel_file = assert(package.searchpath("fennel", package.path)); assert(fennel_file:sub(1, #tree) == tree, fennel_file .. " is not in the rock tree"); local major, minor, patch = require("fennel").version:match("^(%d+)%.(%d+)%.(%d+)"); major, minor, patch = tonumber(major), tonumber(minor), tonumber(patch); assert(major == 1 and (minor > 5 or (minor == 5 and patch >= 3)), "fennel " .. require("fennel").version); print("fennel " .. require("fennel").version .. " from " .. fennel_file)'
lua -e 'local d = require("dseams"); require("yoda"); local fennel = require("fennel"); local lua_file = assert(package.searchpath("dseams", package.path)); local fnl_file = lua_file:gsub("dseams%.lua$", "dseams.fnl"); local wrapped = fennel.dofile(fnl_file); assert(type(wrapped["chill-plus"]) == "function"); local cloud = d.core.readXYZ("example_lua/full_api/cube.xyz"); assert(cloud.nop > 0)'

lua_abi:
name: Lua ${{ matrix.lua }} beside the other Lua
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
lua: ['5.3', '5.4']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Lua 5.3 and 5.4 together
run: |
sudo apt-get update
sudo apt-get install -y lua5.3 liblua5.3-dev lua5.4 liblua5.4-dev \
meson ninja-build pkg-config g++ libeigen3-dev libblas-dev liblapack-dev
- name: Configure, build, and test against Lua ${{ matrix.lua }}
run: |
set -euxo pipefail
meson setup bbdir --wrap-mode=nofallback -Dlua_version=${{ matrix.lua }}
meson compile -C bbdir
readelf -d bbdir/dseams_core.so | grep -F "liblua${{ matrix.lua }}.so"
meson test -C bbdir -v --print-errorlogs
if grep -Eq '^Skipped:[[:space:]]+[1-9]' bbdir/meson-logs/testlog.txt; then
echo 'meson test skipped tests' >&2
exit 1
fi
grep -F 'abi_match interpreter=${{ matrix.lua }} linked=${{ matrix.lua }}' bbdir/meson-logs/testlog.txt

readers:
name: chemfiles and readcon
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@df2a88e9fe4098bad09cb42c3dec7187f15861fc
with:
toolchain: stable
- name: Cache cargo-c
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/bin/cargo-capi
~/.cargo/bin/cargo-cbuild
~/.cargo/bin/cargo-cinstall
~/.cargo/bin/cargo-ctest
~/.cargo/.crates.toml
~/.cargo/.crates2.json
key: cargo-c-0.10.26-${{ runner.os }}-${{ runner.arch }}
- uses: mamba-org/setup-micromamba@f457c30a868e4760d3a6fcea5f25dc655b8edf39 # v3.2.1
with:
environment-name: yoda
create-args: >-
cxx-compiler
meson
ninja
pkg-config
eigen
libblas
liblapack
lua=5.4
cmake
openssl
make
cache-environment: true
- name: Install chemfiles 0.10.4 and readcon-core v0.14.10
shell: bash -el {0}
run: |
set -euxo pipefail
curl -fsSL -o chemfiles.tar.gz https://github.com/chemfiles/chemfiles/archive/refs/tags/0.10.4.tar.gz
tar -xzf chemfiles.tar.gz
cmake -S chemfiles-0.10.4 -B chemfiles-build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \
-DCMAKE_C_COMPILER="${CC:-gcc}" \
-DCMAKE_CXX_COMPILER="${CXX:-g++}" \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DBUILD_SHARED_LIBS=ON
cmake --build chemfiles-build --parallel
cmake --install chemfiles-build
# 0.10.4 installs a CMake package and no pkg-config file.
mkdir -p "$CONDA_PREFIX/lib/pkgconfig"
printf '%s\n' \
"prefix=${CONDA_PREFIX}" \
'libdir=${prefix}/lib' \
'includedir=${prefix}/include' \
'' \
'Name: chemfiles' \
'Description: Library for reading and writing chemistry files' \
'Version: 0.10.4' \
'Libs: -L${libdir} -lchemfiles' \
'Cflags: -I${includedir}' \
> "$CONDA_PREFIX/lib/pkgconfig/chemfiles.pc"
cargo install cargo-c --version 0.10.26 --locked
# v0.14.10 is the readcon-core revision in the seams-core wrap
# this tree builds. When that wrap moves, this pin must track
# seams-core's floor (>=0.16.2, the floor in seams-core v2.14.1).
git clone --depth 1 --branch v0.14.10 https://github.com/lode-org/readcon-core.git
cargo cinstall --release --prefix "$CONDA_PREFIX" \
--libdir lib --pkgconfigdir lib/pkgconfig \
--manifest-path readcon-core/Cargo.toml
pkg-config --modversion chemfiles
pkg-config --modversion readcon-core
- name: Configure, require both readers, and test
shell: bash -el {0}
run: |
set -euxo pipefail
meson setup bbdir --prefix=/usr --libdir=lib --wrap-mode=nofallback \
-Dwith_chemfiles=enabled -Dwith_readcon=enabled
meson compile -C bbdir
export LUA_PATH="$PWD/lua/?.lua;;"
export LUA_CPATH="$PWD/bbdir/?.so;;"
lua -e 'local d = require("dseams"); assert(d.has_chemfiles() == true); assert(d.has_readcon() == true)'
meson test -C bbdir -v --print-errorlogs
if grep -Eq '^Skipped:[[:space:]]+[1-9]' bbdir/meson-logs/testlog.txt; then
echo 'meson test skipped tests' >&2
exit 1
fi
for f in cuh2.con water.dcd water.gro water.pdb; do
grep -E "^read input/readers/$f nop=" bbdir/meson-logs/testlog.txt
done
- name: Configure with readers disabled and prove runtime disable
shell: bash -el {0}
run: |
set -euxo pipefail
meson setup bbdir-disabled --prefix=/usr --libdir=lib --wrap-mode=nofallback \
-Dwith_chemfiles=disabled -Dwith_readcon=disabled
meson compile -C bbdir-disabled
export LUA_PATH="$PWD/lua/?.lua;;"
export LUA_CPATH="$PWD/bbdir-disabled/?.so;;"
lua -e 'local d=require("dseams"); assert(d.has_chemfiles()==false); assert(d.has_readcon()==false); local okc, errc = pcall(d.read, "input/readers/water.dcd", {frame=1}); assert(okc == false and tostring(errc):find("chemfiles missing", 1, true) ~= nil); local okr, errr = pcall(d.read, "input/readers/cuh2.con", {frame=1}); assert(okr == false and tostring(errr):find("readcon-core missing", 1, true) ~= nil)'
meson test -C bbdir-disabled -v --print-errorlogs --suite readers
if grep -Eq '^Skipped:[[:space:]]+[1-9]' bbdir-disabled/meson-logs/testlog.txt; then
echo 'meson test skipped tests' >&2
exit 1
fi
for f in cuh2.con water.dcd water.gro water.pdb; do
grep -E "^missing input/readers/$f " bbdir-disabled/meson-logs/testlog.txt
done
4 changes: 2 additions & 2 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Docs
on:
push:
branches: [main]
branches: [main, develop]
tags: ["v*"]
pull_request:
branches: [main]
branches: [main, develop]

jobs:
build-docs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nix flake

on:
push:
branches: [main]
branches: [main, develop]
paths:
- '.github/workflows/ci_nix.yml'
- 'flake.nix'
Expand All @@ -14,7 +14,7 @@ on:
- 'example_lua/**'
- 'input/**'
pull_request:
branches: [main]
branches: [main, develop]
paths:
- '.github/workflows/ci_nix.yml'
- 'flake.nix'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ bbdir/
docs/source/xml/
*.swp
.DS_Store
__pycache__/
21 changes: 21 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@ cff-version: 1.2.0
message: "If you use this software, please cite it using the metadata below."
title: "yodaStruct: Lua and Fennel front end for d-SEAMS"
type: software
# [[[cog
# import dseams_version as v
# cog.outl('version: "%s"' % v.VERSION)
# ]]]
version: "2.10.0"
# [[[end]]]
# [[[cog
# import os
# import re
# import dseams_version as v
# released = os.environ.get("YODA_RELEASE_DATE")
# if released:
# released = released.strip()
# else:
# text = (v.ROOT / "CITATION.cff").read_text(encoding="utf-8")
# released = re.search(
# r'(?m)^date-released: "(\d{4}-\d{2}-\d{2})"',
# text,
# ).group(1)
# cog.outl('date-released: "%s"' % released)
# ]]]
date-released: "2026-09-06"
# [[[end]]]
license: MIT
repository-code: "https://github.com/d-SEAMS/yodaStruct"
url: https://dseams.info
Expand Down
1 change: 1 addition & 0 deletions changelog.d/+dcd-fixture.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`dseams.read` reads `input/readers/water.dcd`, a two-atom trajectory written by chemfiles.
1 change: 1 addition & 0 deletions changelog.d/+engine-reader-query.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`dseams.has_chemfiles` and `dseams.has_readcon` follow the macros on the linked seams-core, including a readcon-core wrap when no system library is installed.
1 change: 1 addition & 0 deletions changelog.d/+readers.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`dseams.has_chemfiles` and `dseams.has_readcon` report whether this build can read PDB, GRO, and DCD files through chemfiles and `.con` files through readcon-core.
1 change: 1 addition & 0 deletions changelog.d/+rockspec.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`luarocks make rockspec` builds `dseams_core` for the Lua version LuaRocks installs for, installs `dseams`, `yoda`, and their Fennel sources where `require` finds them, and pulls in `fennel >= 1.5.3, < 2.0`.
27 changes: 27 additions & 0 deletions ci/version/dseams_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Release version for cog snippets, read from meson.build.

The ``version`` keyword of ``project()`` in meson.build is the only place
the release version is written. ``meson rewrite`` sets it during
``cog bump``. Every copy listed in ci/version/files.txt is regenerated
from it:

python3 -m cogapp -I ci/version -r @ci/version/files.txt

Call cogapp through `python -m cogapp`, because cocogitto also installs
a `cog` executable.
"""

import json
import subprocess
from pathlib import Path

ROOT = Path(__file__).resolve().parents[2]

_info = json.loads(
subprocess.check_output(
["meson", "introspect", "--projectinfo", "meson.build"],
cwd=ROOT,
text=True,
)
)
VERSION = _info["version"]
7 changes: 7 additions & 0 deletions ci/version/files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Version copies regenerated by cogapp from project() in meson.build.
# python3 -m cogapp -I ci/version -r @ci/version/files.txt
nix/package.nix
CITATION.cff
towncrier.toml
rockspec
docs/source/Doxyfile
43 changes: 43 additions & 0 deletions cog.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Cocogitto release driver. Towncrier owns CHANGELOG.md.
# cog bump --auto runs three hooks, then commits and tags:
# meson rewrite writes the project() version in meson.build
# cogapp copies that version into ci/version/files.txt
# YODA_RELEASE_DATE=$(date +%F) on that command sets date-released
# towncrier writes CHANGELOG.md
# luarocks new_version names the upload rockspec.
# The tag push is the maintainer's. Publishing to LuaRocks is luarocks upload.

from_latest_tag = true
ignore_merge_commits = true
disable_changelog = true
disable_bump_commit = false
tag_prefix = "v"
branch_whitelist = ["main", "master"]

pre_bump_hooks = [
"meson rewrite kwargs set project / version {{version}}",
"YODA_RELEASE_DATE=$(date +%F) python3 -m cogapp -I ci/version -r @ci/version/files.txt",
"towncrier build --yes --version {{version}}",
]

post_bump_hooks = [
"git --no-pager show --stat HEAD",
"echo \"Tagged v{{version}}. Push this commit and the tag, then luarocks new_version rockspec {{version}} --tag v{{version}} and luarocks upload dseams-{{version}}-1.rockspec.\"",
]

[commit_types]
feat = { changelog_title = "Features" }
fix = { changelog_title = "Bug Fixes" }
perf = { changelog_title = "Performance" }
refactor = { changelog_title = "Refactoring" }
docs = { changelog_title = "Documentation" }
test = { changelog_title = "Tests" }
build = { changelog_title = "Build System" }
ci = { changelog_title = "CI" }
chore = { changelog_title = "Miscellaneous" }
style = { changelog_title = "Style" }
revert = { changelog_title = "Reverts" }

[changelog]
path = "CHANGELOG.md"
authors = [{ username = "HaoZeke", signature = "Rohit Goswami" }]
Loading
Loading