Skip to content

Commit 64e1037

Browse files
authored
Merge pull request aldanor#4 from metno/feature/naming-crates
Rename hdf5* -> hdf5-metno*
2 parents 8edce51 + de3e491 commit 64e1037

38 files changed

+74
-69
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install HDF5
3737
run: sudo apt-get update && sudo apt-get install libhdf5-dev
3838
- name: Run cargo ${{matrix.command}}
39-
run: cargo ${{matrix.command}} ${{matrix.command == 'fmt' && '--all -- --check' || '--workspace --exclude hdf5-src -- -D warnings -D clippy::cargo -A clippy::multiple-crate-versions'}}
39+
run: cargo ${{matrix.command}} ${{matrix.command == 'fmt' && '--all -- --check' || '--workspace --exclude hdf5-metno-src -- -D warnings -D clippy::cargo -A clippy::multiple-crate-versions'}}
4040

4141
doc: # This task should mirror the procedure on docs.rs
4242
runs-on: ubuntu-latest
@@ -152,9 +152,9 @@ jobs:
152152
uses: dtolnay/rust-toolchain@stable
153153
with: {toolchain: '${{matrix.rust}}'}
154154
- name: Build and test all crates
155-
run: cargo test --workspace -vvv --features hdf5-sys/static,hdf5-sys/zlib --exclude hdf5-derive
155+
run: cargo test --workspace -vvv --features hdf5-sys/static,hdf5-sys/zlib --exclude hdf5-metno-derive
156156
- name: Build and test with filters and other features
157-
run: cargo test --workspace -v --features hdf5-sys/static,hdf5-sys/zlib,lzf,blosc,f16,complex --exclude hdf5-derive
157+
run: cargo test --workspace -v --features hdf5-sys/static,hdf5-sys/zlib,lzf,blosc,f16,complex --exclude hdf5-metno-derive
158158
if: matrix.rust != 'stable-gnu'
159159
- name: Run examples
160160
run: |
@@ -282,7 +282,7 @@ jobs:
282282
with: {toolchain: "1.77"}
283283
- name: Build and test all crates
284284
run:
285-
cargo test --workspace -vv --features=hdf5-sys/static,hdf5-sys/zlib --exclude=hdf5-derive
285+
cargo test --workspace -vv --features=hdf5-sys/static,hdf5-sys/zlib --exclude=hdf5-metno-derive
286286

287287
# wine:
288288
# name: wine
@@ -299,7 +299,7 @@ jobs:
299299
# - name: Build and test
300300
# env:
301301
# CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER: wine64
302-
# run: cargo test --workspace --features hdf5-sys/static --target x86_64-pc-windows-gnu --exclude=hdf5-derive
302+
# run: cargo test --workspace --features hdf5-sys/static --target x86_64-pc-windows-gnu --exclude=hdf5-metno-derive
303303

304304
addr_san:
305305
name: Address sanitizer
@@ -314,4 +314,4 @@ jobs:
314314
- name: Run test with sanitizer
315315
env:
316316
RUSTFLAGS: "-Z sanitizer=address"
317-
run: cargo test --features hdf5-sys/static --target x86_64-unknown-linux-gnu --workspace --exclude hdf5-derive
317+
run: cargo test --features hdf5-sys/static --target x86_64-unknown-linux-gnu --workspace --exclude hdf5-metno-derive

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ authors = [
1212
]
1313
keywords = ["hdf5"]
1414
license = "MIT OR Apache-2.0"
15-
repository = "https://github.com/aldanor/hdf5-rust"
16-
homepage = "https://github.com/aldanor/hdf5-rust"
15+
repository = "https://github.com/metno/hdf5-rust"
16+
homepage = "https://github.com/metno/hdf5-rust"
1717
edition = "2021"
1818

1919
[workspace.dependencies]
@@ -26,8 +26,8 @@ mpi-sys = "0.2"
2626
num-complex = { version = "0.4", default-features = false }
2727
regex = "1.10"
2828
# internal
29-
hdf5 = { version = "0.8.1", path = "hdf5" } # !V
30-
hdf5-derive = { version = "0.8.1", path = "hdf5-derive" } # !V
31-
hdf5-src = { version = "0.8.1", path = "hdf5-src" } # !V
32-
hdf5-sys = { version = "0.8.1", path = "hdf5-sys" } # !V
33-
hdf5-types = { version = "0.8.1", path = "hdf5-types" } # !V
29+
hdf5 = { package = "hdf5-metno", version = "0.8.1", path = "hdf5" } # !V
30+
hdf5-derive = { package = "hdf5-metno-derive", version = "0.8.1", path = "hdf5-derive" } # !V
31+
hdf5-src = { package = "hdf5-metno-src", version = "0.8.1", path = "hdf5-src" } # !V
32+
hdf5-sys = { package = "hdf5-metno-sys", version = "0.8.1", path = "hdf5-sys" } # !V
33+
hdf5-types = { package = "hdf5-metno-types", version = "0.8.1", path = "hdf5-types" } # !V

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
HDF5 for Rust.
44

5-
[![Build](https://github.com/aldanor/hdf5-rust/workflows/CI/badge.svg)](https://github.com/aldanor/hdf5-rust/actions?query=branch%3Amaster)
6-
[![Latest Version](https://img.shields.io/crates/v/hdf5.svg)](https://crates.io/crates/hdf5)
7-
[![Documentation](https://docs.rs/hdf5/badge.svg)](https://docs.rs/hdf5)
8-
[![Changelog](https://img.shields.io/github/v/release/aldanor/hdf5-rust)](https://github.com/aldanor/hdf5-rust/blob/master/CHANGELOG.md)
5+
[![Build](https://github.com/metno/hdf5-rust/workflows/CI/badge.svg)](https://github.com/metno/hdf5-rust/actions?query=branch%3Amain)
6+
[![Latest Version](https://img.shields.io/crates/v/hdf5-metno.svg)](https://crates.io/crates/hdf5-metno)
7+
[![Documentation](https://docs.rs/hdf5-metno/badge.svg)](https://docs.rs/hdf5-metno)
8+
[![Changelog](https://img.shields.io/github/v/release/metno/hdf5-rust)](https://github.com/metno/hdf5-rust/blob/master/CHANGELOG.md)
99
![hdf5: rustc 1.77+](https://img.shields.io/badge/hdf5-rustc_1.77+-lightblue.svg)
10-
[![Total Lines](https://tokei.rs/b1/github/aldanor/hdf5-rust)](https://github.com/aldanor/hdf5-rust)
10+
[![Total Lines](https://tokei.rs/b1/github/metno/hdf5-rust)](https://github.com/metno/hdf5-rust)
1111
[![Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
1212
[![MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
1313

14-
The `hdf5` crate (previously known as `hdf5-rs`) provides thread-safe Rust bindings and
14+
The `hdf5-metno` crate (also known under the pre-fork name of `hdf5`) provides thread-safe Rust bindings and
1515
high-level wrappers for the HDF5 library API. Some of the features include:
1616

1717
- Thread-safety with non-threadsafe libhdf5 builds guaranteed via reentrant mutexes.
@@ -23,6 +23,12 @@ Direct low-level bindings are also available and are provided in the `hdf5-sys`
2323

2424
Requires HDF5 library of version 1.8.4 or later.
2525

26+
## Fork
27+
This is a fork of https://github.com/aldanor/hdf5-rust used for publishing newer versions of the crate. This includes a change in the crate name to allow publishing on crates.io. For backwards compatibility consider using the following in your `Cargo.toml`:
28+
```yaml
29+
hdf5 = { package = "hdf5-metno", version = "0.8.1" }
30+
```
31+
2632
## Example
2733

2834
```rust

hdf5-derive/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hdf5-derive"
2+
name = "hdf5-metno-derive"
33
description = "Derive macro for HDF5 structs and enums."
44
categories = ["procedural-macro-helpers"]
55
readme = "README.md"
@@ -23,4 +23,4 @@ syn = { version = "2.0", features = ["derive", "extra-traits"]}
2323

2424
[dev-dependencies]
2525
trybuild = "1.0"
26-
hdf5.workspace = true
26+
hdf5-metno = { path = "../hdf5" }

hdf5-derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
2323
let expanded = quote! {
2424
#[allow(dead_code, unused_variables, unused_attributes)]
2525
const #dummy: () = {
26-
extern crate hdf5 as _h5;
26+
use ::hdf5_metno as _h5;
2727

2828
#[automatically_derived]
2929
unsafe impl #impl_generics _h5::types::H5Type for #name #ty_generics #where_clause {

hdf5-derive/tests/compile-fail/empty-enum.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot derive `H5Type` for empty enums
2-
--> $DIR/empty-enum.rs:7:6
2+
--> tests/compile-fail/empty-enum.rs:6:6
33
|
4-
7 | enum Foo {}
4+
6 | enum Foo {}
55
| ^^^

hdf5-derive/tests/compile-fail/empty-struct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot derive `H5Type` for empty structs
2-
--> $DIR/empty-struct.rs:7:8
2+
--> tests/compile-fail/empty-struct.rs:6:8
33
|
4-
7 | struct Foo {}
4+
6 | struct Foo {}
55
| ^^^

hdf5-derive/tests/compile-fail/empty-tuple-struct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot derive `H5Type` for empty tuple structs
2-
--> $DIR/empty-tuple-struct.rs:7:8
2+
--> tests/compile-fail/empty-tuple-struct.rs:6:8
33
|
4-
7 | struct Foo();
4+
6 | struct Foo();
55
| ^^^

hdf5-derive/tests/compile-fail/enum-no-repr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `H5Type` can only be derived for enums with explicit representation
2-
--> $DIR/enum-no-repr.rs:7:6
2+
--> tests/compile-fail/enum-no-repr.rs:6:6
33
|
4-
7 | enum Foo {
4+
6 | enum Foo {
55
| ^^^

hdf5-derive/tests/compile-fail/enum-non-scalar.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `H5Type` can only be derived for enums with scalar discriminants
2-
--> $DIR/enum-non-scalar.rs:7:6
2+
--> tests/compile-fail/enum-non-scalar.rs:6:6
33
|
4-
7 | enum Foo {
4+
6 | enum Foo {
55
| ^^^

hdf5-derive/tests/compile-fail/pd-empty-struct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
use std::marker::PhantomData;
54

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot derive `H5Type` for empty structs
2-
--> $DIR/pd-empty-struct.rs:9:8
2+
--> tests/compile-fail/pd-empty-struct.rs:8:8
33
|
4-
9 | struct Foo<T> {
4+
8 | struct Foo<T> {
55
| ^^^

hdf5-derive/tests/compile-fail/pd-empty-tuple-struct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
use std::marker::PhantomData;
54

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot derive `H5Type` for empty tuple structs
2-
--> $DIR/pd-empty-tuple-struct.rs:9:8
2+
--> tests/compile-fail/pd-empty-tuple-struct.rs:8:8
33
|
4-
9 | struct Foo<T>(PhantomData<T>);
4+
8 | struct Foo<T>(PhantomData<T>);
55
| ^^^

hdf5-derive/tests/compile-fail/struct-no-repr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `H5Type` requires repr(C), repr(packed) or repr(transparent) for structs
2-
--> $DIR/struct-no-repr.rs:7:8
2+
--> tests/compile-fail/struct-no-repr.rs:6:8
33
|
4-
7 | struct Foo {
4+
6 | struct Foo {
55
| ^^^

hdf5-derive/tests/compile-fail/tuple-struct-no-repr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `H5Type` requires repr(C), repr(packed) or repr(transparent) for tuple structs
2-
--> $DIR/tuple-struct-no-repr.rs:7:8
2+
--> tests/compile-fail/tuple-struct-no-repr.rs:6:8
33
|
4-
7 | struct Foo(i64);
4+
6 | struct Foo(i64);
55
| ^^^

hdf5-derive/tests/compile-fail/unit-struct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
extern crate hdf5_derive;
2-
use hdf5_derive::H5Type;
1+
use hdf5_metno_derive::H5Type;
32

43
#[derive(H5Type)]
54
//~^ ERROR proc-macro derive
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: cannot derive `H5Type` for unit structs
2-
--> $DIR/unit-struct.rs:7:8
2+
--> tests/compile-fail/unit-struct.rs:6:8
33
|
4-
7 | struct Foo;
4+
6 | struct Foo;
55
| ^^^

hdf5-derive/tests/test.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
#[macro_use]
2-
extern crate hdf5_derive;
3-
41
use std::marker::PhantomData;
52
use std::mem;
63

74
use hdf5::types::TypeDescriptor as TD;
85
use hdf5::types::*;
6+
use hdf5_metno as hdf5;
7+
use hdf5_metno_derive::H5Type;
98

109
#[derive(H5Type)]
1110
#[repr(C)]

hdf5-src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hdf5-src"
2+
name = "hdf5-metno-src"
33
license-file = "ext/hdf5/COPYING"
44
build = "build.rs"
55
description = "Build script for compiling HDF5 C library from source."

hdf5-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hdf5-sys"
2+
name = "hdf5-metno-sys"
33
build = "build.rs"
44
description = "Native bindings to the HDF5 library."
55
links = "hdf5"

hdf5-types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hdf5-types"
2+
name = "hdf5-metno-types"
33
description = "Native Rust equivalents of HDF5 types."
44
readme = "README.md"
55
build = "build.rs"

hdf5/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "hdf5"
2+
name = "hdf5-metno"
33
readme = "../README.md"
44
description = "Thread-safe Rust bindings for the HDF5 library."
55
build = "build.rs"

hdf5/examples/chunking.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Create, write, and read a chunked dataset
22
33
use hdf5::{File, Result};
4+
use hdf5_metno as hdf5;
45
use ndarray::Array2;
56

67
fn main() -> Result<()> {

hdf5/examples/simple.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[cfg(feature = "blosc")]
22
use hdf5::filters::blosc_set_nthreads;
33
use hdf5::{File, H5Type, Result};
4+
use hdf5_metno as hdf5;
45
use ndarray::{arr2, s};
56

67
#[derive(H5Type, Clone, PartialEq, Debug)] // register with HDF5

hdf5/tests/common/gen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::iter;
44

55
use hdf5::types::{FixedAscii, FixedUnicode, VarLenArray, VarLenAscii, VarLenUnicode};
66
use hdf5::H5Type;
7+
use hdf5_metno as hdf5;
78

89
use half::f16;
910
use ndarray::{ArrayD, SliceInfo, SliceInfoElem};

hdf5/tests/common/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use super::gen::gen_ascii;
22

3+
use hdf5_metno as hdf5;
4+
35
pub fn random_filename() -> String {
46
gen_ascii(&mut rand::thread_rng(), 8)
57
}

hdf5/tests/test_dataset.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::io::{Read, Seek, SeekFrom};
55
use ndarray::{s, Array1, Array2, ArrayD, IxDyn, SliceInfo};
66
use rand::prelude::{Rng, SeedableRng, SmallRng};
77

8+
use hdf5_metno as hdf5;
89
use hdf5_types::TypeDescriptor;
910

1011
mod common;

hdf5/tests/test_datatypes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ mod common;
33

44
use hdf5::types::{TypeDescriptor as TD, *};
55
use hdf5::{from_id, Datatype, H5Type};
6+
use hdf5_metno as hdf5;
67

78
use hdf5_sys::h5i::H5I_INVALID_HID;
89

hdf5/tests/test_plist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::str::FromStr;
44
use hdf5::dataset::*;
55
use hdf5::file::*;
66
use hdf5::plist::*;
7+
use hdf5_metno as hdf5;
78

89
macro_rules! test_pl {
910
($ty:ident, $field:ident ($($arg:expr),+): $($name:ident=$value:expr),+) => (

hdf5/tests/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use hdf5_metno as hdf5;
2+
13
#[test]
24
fn roundtrip_compound_type() {
35
use hdf5::H5Type;

0 commit comments

Comments
 (0)