Skip to content

Commit 841a30c

Browse files
committed
refactor: restructure to Cargo workspace layout
- Library crate moved to crates/opentimstdf/ - Python bindings crate moved to crates/opentimstdf-py/ - pyproject.toml moved to repository root - Root Cargo.toml rewritten as workspace manifest with shared metadata - CI updated to use --workspace flag for clippy and test - Publish workflow updated to reference new crate path - Version bumped to 1.0.4
1 parent 981071b commit 841a30c

21 files changed

Lines changed: 87 additions & 65 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: cargo fmt --all -- --check
3636

3737
- name: cargo clippy
38-
run: cargo clippy --all-targets -- -D warnings
38+
run: cargo clippy --workspace --all-targets -- -D warnings
3939

4040
- name: cargo test
41-
run: cargo test --all-targets
41+
run: cargo test --workspace --all-targets

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- uses: PyO3/maturin-action@v1
4848
with:
4949
target: ${{ matrix.target }}
50-
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
50+
args: --release --out dist --find-interpreter --manifest-path crates/opentimstdf-py/Cargo.toml
5151
manylinux: auto
5252
- uses: actions/upload-artifact@v4
5353
with:
@@ -62,7 +62,7 @@ jobs:
6262
- uses: PyO3/maturin-action@v1
6363
with:
6464
command: sdist
65-
args: --out dist --manifest-path python/Cargo.toml
65+
args: --out dist --manifest-path crates/opentimstdf-py/Cargo.toml
6666
- uses: actions/upload-artifact@v4
6767
with:
6868
name: sdist

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ nohup.out
1414
**/__pycache__/
1515
**/*.pyc
1616
**/*.pyo
17-
*.egg-info/
17+
**/*.egg-info/
18+
**/.pytest_cache/
19+
**/dist/
20+
**/*.so
21+
**/*.pyd
22+
**/*.dylib
1823
.venv/
1924

2025
# Editor / OS

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.4] - 2026-05-17
8+
9+
### Changed
10+
11+
- Restructured to a Cargo workspace layout. The library crate is now at
12+
`crates/opentimstdf/` and the Python bindings crate at
13+
`crates/opentimstdf-py/`. The `pyproject.toml` is now at the repository
14+
root. No public API changes.
15+
716
## [1.0.3] - 2026-05-17
817

918
### Fixed

Cargo.toml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
[package]
2-
name = "opentimstdf"
3-
version = "1.0.3"
1+
[workspace]
2+
resolver = "2"
3+
members = ["crates/opentimstdf", "crates/opentimstdf-py"]
4+
5+
[workspace.package]
6+
version = "1.0.4"
47
edition = "2021"
58
rust-version = "1.75"
6-
description = "Rust reader for timsTOF .d/ (TDF) mass spectrometry bundles."
79
authors = ["Nathan Riley <git@nathanriley.com>"]
810
license = "Apache-2.0"
911
repository = "https://github.com/Sigilweaver/OpenTimsTDF"
1012
homepage = "https://github.com/Sigilweaver/OpenTimsTDF"
11-
readme = "README.md"
1213
keywords = ["mass-spectrometry", "bruker", "timstof", "tdf", "proteomics"]
1314
categories = ["parser-implementations", "science"]
1415

15-
[lints.rust]
16-
unsafe_code = "forbid"
17-
18-
[dependencies]
19-
thiserror = "2"
20-
rusqlite = { version = "0.31", features = ["bundled"] }
21-
zstd = "0.13"
16+
[workspace.dependencies]
17+
opentimstdf = { path = "crates/opentimstdf" }
18+
pyo3 = { version = "0.22", features = ["extension-module", "abi3-py38"] }
2219

23-
[[example]]
24-
name = "dump"
25-
path = "examples/dump.rs"
20+
[workspace.lints.rust]
21+
unsafe_code = "forbid"

crates/opentimstdf-py/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "opentimstdf-py"
3+
description = "Python bindings for the OpenTimsTDF library."
4+
readme = "../../README.md"
5+
version.workspace = true
6+
edition.workspace = true
7+
rust-version.workspace = true
8+
authors.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
homepage.workspace = true
12+
keywords.workspace = true
13+
categories.workspace = true
14+
publish = false
15+
16+
[lib]
17+
name = "opentimstdf"
18+
crate-type = ["cdylib"]
19+
20+
[lints.rust]
21+
unsafe_code = "allow"
22+
23+
[lints.clippy]
24+
useless_conversion = "allow"
25+
26+
[dependencies]
27+
opentimstdf.workspace = true
28+
pyo3 = { workspace = true }

crates/opentimstdf/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "opentimstdf"
3+
description = "Rust reader for timsTOF .d/ (TDF) mass spectrometry bundles."
4+
readme = "../../README.md"
5+
version.workspace = true
6+
edition.workspace = true
7+
rust-version.workspace = true
8+
authors.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
homepage.workspace = true
12+
keywords.workspace = true
13+
categories.workspace = true
14+
15+
[lints.rust]
16+
unsafe_code = "forbid"
17+
18+
[dependencies]
19+
thiserror = "2"
20+
rusqlite = { version = "0.31", features = ["bundled"] }
21+
zstd = "0.13"

0 commit comments

Comments
 (0)