diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml new file mode 100644 index 0000000..cac8c7a --- /dev/null +++ b/.github/workflows/cli.yml @@ -0,0 +1,30 @@ +create-release: + runs-on: ubuntu-latest + # Use a container with GLIBC 2.17 + container: quay.io/pypa/manylinux2014_x86_64 + steps: + - name: Show GLIBC + run: ldd --version + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - uses: Swatinem/rust-cache@v1 + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --manifest-path cli/Cargo.toml + - name: Upload binary + uses: actions/upload-artifact@4 + with: + name: cli-tool + path: cli + diff --git a/Cargo.toml b/Cargo.toml index 6718eeb..0b2e1a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,3 +30,4 @@ reqwest = { version = "0.11", features = ["blocking", "json"], default-features [dev-dependencies] tempfile = "3.9" + diff --git a/python/README.md b/python/README.md index af8e8b3..052c580 100644 --- a/python/README.md +++ b/python/README.md @@ -1,6 +1,6 @@ # Overview -pycrate is a python library that is built upon a rust backend for interfacing with [RO-Crates](https://www.researchobject.org/ro-crate/1.1/). It's designed to be maximally flexible with minimal onboarding, allowing you to incorprate it into scrpits/ data pipelines as easily as possible. This also relies on you to have an understanding of the structure of an RO-Crate, but focuses more on the fact that some metadata is better than no metadata. +rocraters is a python library that is built upon a rust backend for interfacing with [RO-Crates](https://www.researchobject.org/ro-crate/1.1/). It's designed to be maximally flexible with minimal onboarding, allowing you to incorprate it into scrpits/ data pipelines as easily as possible. This also relies on you to have an understanding of the structure of an RO-Crate, but focuses more on the fact that some metadata is better than no metadata. # Build diff --git a/src/ro_crate/metadata_descriptor.rs b/src/ro_crate/metadata_descriptor.rs index aea503a..b08870e 100644 --- a/src/ro_crate/metadata_descriptor.rs +++ b/src/ro_crate/metadata_descriptor.rs @@ -13,7 +13,6 @@ use serde::{ }; use std::collections::HashMap; use std::fmt; -use std::marker::PhantomData; /// Represents the metadata descriptor for entire RoCrate. /// @@ -140,19 +139,12 @@ pub trait CustomSerialize: Serialize { /// `@id`, `@type`, `conformsTo`, and `about` keys to populate the corresponding fields /// of `MetadataDescriptor`. All other keys are treated as dynamic properties and are /// stored in the `dynamic_entity` hashmap. -/// -/// # Implementation Details -/// `MetadataDescriptorVisitor` uses `PhantomData` to correctly implement the `Visitor` trait -/// without needing an actual instance of `MetadataDescriptor`. This allows the visitor to be -/// generic over the `MetadataDescriptor` type, ensuring type safety and correctness. impl<'de> Deserialize<'de> for MetadataDescriptor { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct MetadataDescriptorVisitor { - marker: PhantomData MetadataDescriptor>, - } + struct MetadataDescriptorVisitor; impl<'de> Visitor<'de> for MetadataDescriptorVisitor { type Value = MetadataDescriptor; @@ -203,9 +195,7 @@ impl<'de> Deserialize<'de> for MetadataDescriptor { } } - deserializer.deserialize_map(MetadataDescriptorVisitor { - marker: PhantomData, - }) + deserializer.deserialize_map(MetadataDescriptorVisitor) } }