diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a2ab5b..d40c895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -[Unreleased]: https://github.com/fastobo/fastobo-py/compare/v0.2.2...HEAD +[Unreleased]: https://github.com/fastobo/fastobo-py/compare/v0.3.0...HEAD + + +## [v0.3.0] - 2019-08-08 + +[v0.3.0]: https://github.com/fastobo/fastobo/compare/v0.2.2...v0.3.0 + +### Added +- `load_graph` and `dump_graph` functions to read and write OBO JSON files. + +### Changed +- Updated to `fastobo` [v0.7.1](https://github.com/fastobo/fastobo/blob/master/CHANGELOG.md#v071---2019-08-08). ## [v0.2.2] - 2019-07-24 @@ -15,7 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [v0.2.2]: https://github.com/fastobo/fastobo/compare/v0.2.1...v0.2.2 ### Changed -- Updated to `fastobo` [v0.6.1](https://github.com/fastobo/fastobo/blob/master/CHANGELOG.md#v061-2019-07-24). +- Updated to `fastobo` [v0.6.1](https://github.com/fastobo/fastobo/blob/master/CHANGELOG.md#v061---2019-07-24). - Updated to `url` v2.0.0. @@ -24,7 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [v0.2.1]: https://github.com/fastobo/fastobo/compare/v0.2.0...v0.2.1 ### Changed -- Updated to `fastobo` [v0.6.0](https://github.com/fastobo/fastobo/blob/master/CHANGELOG.md#v060-2019-07-23). +- Updated to `fastobo` [v0.6.0](https://github.com/fastobo/fastobo/blob/master/CHANGELOG.md#v060---2019-07-23). ### Fixed - Parser now accepts ISO 8601 dates with fractional second. diff --git a/Cargo.lock b/Cargo.lock index 9851617..1132c83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,7 +2,7 @@ # It is not intended for manual editing. [[package]] name = "aho-corasick" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -43,7 +43,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -85,7 +85,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -107,7 +107,7 @@ dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -117,7 +117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -141,7 +141,7 @@ dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -152,65 +152,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fastobo" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo-derive-internal 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo-derive-internal 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-syntax 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "opaque_typedef 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "opaque_typedef_macros 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fastobo-derive-internal" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fastobo-graphs" -version = "0.1.0" -source = "git+https://github.com/fastobo/fastobo-graphs#d51827787b4674ae2e130296ed45d4ecd4b4b771" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fastobo-py" -version = "0.2.1" +version = "0.3.0" dependencies = [ "built 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo-graphs 0.1.0 (git+https://github.com/fastobo/fastobo-graphs)", - "fastobo-py-derive-internal 0.2.1", + "fastobo 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo-graphs 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo-py-derive-internal 0.3.0", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "opaque_typedef 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "opaque_typedef_macros 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "pyo3 0.7.0 (git+https://github.com/PyO3/pyo3)", - "url 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fastobo-py-derive-internal" -version = "0.2.1" +version = "0.3.0" dependencies = [ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -242,19 +243,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "git2" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -270,16 +271,6 @@ name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "idna" version = "0.2.0" @@ -307,7 +298,7 @@ dependencies = [ "proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -328,7 +319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -348,13 +339,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -364,7 +355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -375,7 +366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "log" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -433,7 +424,7 @@ dependencies = [ [[package]] name = "opaque-debug" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -451,7 +442,7 @@ dependencies = [ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "strum 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "strum_macros 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -464,12 +455,7 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "percent-encoding" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -498,7 +484,7 @@ dependencies = [ "pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -513,7 +499,7 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -531,7 +517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -550,7 +536,7 @@ dependencies = [ [[package]] name = "pyo3" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a06bc" +source = "git+https://github.com/PyO3/pyo3#98b707918315e2db3a90ea953177b20a5cdeff49" dependencies = [ "indoc 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "inventory 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -558,10 +544,10 @@ dependencies = [ "mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "pyo3cls 0.7.0 (git+https://github.com/PyO3/pyo3)", - "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -569,22 +555,22 @@ dependencies = [ [[package]] name = "pyo3-derive-backend" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a06bc" +source = "git+https://github.com/PyO3/pyo3#98b707918315e2db3a90ea953177b20a5cdeff49" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pyo3cls" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a06bc" +source = "git+https://github.com/PyO3/pyo3#98b707918315e2db3a90ea953177b20a5cdeff49" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "pyo3-derive-backend 0.7.0 (git+https://github.com/PyO3/pyo3)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -602,23 +588,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.10" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "rustc_version" @@ -648,20 +630,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -671,7 +653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -681,7 +663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -693,7 +675,7 @@ dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -703,7 +685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "spin" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -724,12 +706,12 @@ dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "0.15.42" +version = "0.15.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -744,7 +726,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -771,7 +753,7 @@ name = "toml" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -784,11 +766,6 @@ name = "ucd-trie" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "ucd-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -822,29 +799,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "url" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "utf8-ranges" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "vcpkg" version = "0.2.7" @@ -883,7 +845,7 @@ dependencies = [ ] [metadata] -"checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" +"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "22130e92352b948e7e82a49cdb0aa94f2211761117f29e052dd397c1ac33542b" "checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" @@ -902,17 +864,16 @@ dependencies = [ "checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" "checksum err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3d8ff65eb6c2fc68e76557239d16f5698fd56603925b89856d3f0f7105fd4543" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -"checksum fastobo 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6a720cbc4839cee9a23d61e6916cc1cfbb3807c41c7a92ceb07b0c514775eee4" -"checksum fastobo-derive-internal 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b0ae95ea5c22b656db11e8a294248079f9cc27e56af4d9b4cb2fbaecc223e6b7" -"checksum fastobo-graphs 0.1.0 (git+https://github.com/fastobo/fastobo-graphs)" = "" +"checksum fastobo 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e0441ea4e48bdbb47df077eb802025a40ba4766ed0873c34dc3ab8fa06c8d4e" +"checksum fastobo-derive-internal 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34d9de80af26852544692e439067143130b5e7a1f862c45eb7d0c8eb3226b1da" +"checksum fastobo-graphs 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5ec23cfedb0211343bd3a2c316cd85b6cb04c758e5619d96d26af2ab715766d8" "checksum fastobo-syntax 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bccff634d27f19eb17d86d713bb913d9d29ce5848f849ac2eb95f0450d578166" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum ghost 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5297b71943dc9fea26a3241b178c140ee215798b7f79f7773fd61683e25bca74" -"checksum git2 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "924b2e7d2986e625dcad89e8a429a7b3adee3c3d71e585f4a66c4f7e78715e31" +"checksum git2 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8cb400360e8a4d61b10e648285bbfa919bbf9519d0d5d5720354456f44349226" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum indoc 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1f59f228c76fda6ecd8dab79683039a7054c748587f682a911094f473647bd6" "checksum indoc-impl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "63f070ef080db3601c1a0ecc75c7bb35104cc0ce2d7c4e049952a96a61d8933b" @@ -921,10 +882,10 @@ dependencies = [ "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" "checksum libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb" -"checksum libgit2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "941a41e23f77323b8c9d2ee118aec9ee39dfc176078c18b4757d3bad049d9ff7" +"checksum libgit2-sys 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4c179ed6d19cd3a051e68c177fbbc214e79ac4724fac3a850ec9f3d3eb8a5578" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" "checksum mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f2d82b34c7fb11bb41719465c060589e291d505ca4735ea30016a91f6fc79c3b" "checksum mashup-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "aa607bfb674b4efb310512527d64266b065de3f894fc52f84efcbf7eaa5965fb" @@ -932,17 +893,16 @@ dependencies = [ "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" -"checksum opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum opaque_typedef 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1fb29535b88837a9217e97088accb62cd7497f8a88db40df021390d80068162e" "checksum opaque_typedef_macros 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5568ae0dfa3ac221c99fce88fa9d5c0d77b858873b952f17270c101579d53b99" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum percent-encoding 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba4f28a6faf4ffea762ba8f4baef48c61a6db348647c73095034041fc79dd954" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "933085deae3f32071f135d799d75667b63c8dc1f4537159756e3d4ceab41868c" "checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" "checksum pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63120576c4efd69615b5537d3d052257328a4ca82876771d6944424ccfd9f646" "checksum pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f249ea6de7c7b7aba92b4ff4376a994c6dbd98fd2166c89d5c4947397ecb574d" -"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" +"checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" "checksum proc-macro-hack 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "463bf29e7f11344e58c9e01f171470ab15c925c6822ad75028cc1c0e1d1eb63b" "checksum proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "982a35d1194084ba319d65c4a68d24ca28f5fdb5b8bc20899e4eef8641ea5178" "checksum proc-macro-hack-impl 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "38c47dcb1594802de8c02f3b899e2018c78291168a22c281be21ea0fb4796842" @@ -952,38 +912,35 @@ dependencies = [ "checksum pyo3cls 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b23da8dfd98a84bd7e08700190a5d9f7d2d38abd4369dd1dae651bc40bfd2cc" -"checksum regex-syntax 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5485bf1523a9ed51c4964273f22f63f24e31632adb5dad134f488f86a3875c" +"checksum regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26" +"checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)" = "d46b3dfedb19360a74316866cef04687cd4d6a70df8e6a506c63512790769b72" -"checksum serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)" = "c22a0820adfe2f257b098714323563dd06426502abbbce4f51b72ef544c5027f" +"checksum serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5626ac617da2f2d9c48af5515a21d5a480dbd151e01bb1c355e26a3e68113" +"checksum serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "01e69e1b8a631f245467ee275b8c757b818653c6d704cdbcaeb56b56767b529c" "checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" "checksum serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "38b08a9a90e5260fe01c6480ec7c811606df6d3a660415808c3c3fa8ed95b582" "checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" -"checksum spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44363f6f51401c34e7be73db0db371c04705d35efbe9f7d6082e03a921a32c55" +"checksum spin 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbdb51a221842709c2dd65b62ad4b78289fc3e706a02c17a26104528b6aa7837" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum strum 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e5d1c33039533f051704951680f1adfd468fd37ac46816ded0d9ee068e60f05f" "checksum strum_macros 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "47cd23f5c7dee395a00fa20135e2ec0fffcdfa151c56182966d7a3261343432e" -"checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e" +"checksum syn 0.15.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ee06ea4b620ab59a2267c6b48be16244a3389f8bfa0986bdd15c35b890b00af3" "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b8c96d7873fa7ef8bdeb3a9cda3ac48389b4154f32b9803b4bc26220b677b039" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8f00ed7be0c1ff1e24f46c3d2af4859f7e863672ba3a6e92e7cff702bf9f06c2" -"checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" "checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "834b4441326c660336850c5c0926cc20548e848967a5f57bc20c2b741c8d41f4" -"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77ddaf52e65c6b81c56b7e957c0b1970f7937f21c5c6774c4e56fcb4e20b48c6" -"checksum utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" +"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" "checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" diff --git a/Cargo.toml b/Cargo.toml index 1178d00..9c07105 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["derive"] [package] name = "fastobo-py" -version = "0.2.2" +version = "0.3.0" authors = ["Martin Larralde "] publish = false build = "src/build.rs" @@ -16,14 +16,13 @@ name = "fastobo_py" built = "0.3.1" [dependencies] -pyo3 = { git = "https://github.com/PyO3/pyo3" } -# pyo3-built = "0.2.0" +pyo3 = { git = "https://github.com/PyO3/pyo3", features = ["unsound-subclass"] } pest = "2.1.1" libc = "0.2.59" url = "2.0.0" opaque_typedef = "0.0.5" opaque_typedef_macros = "0.0.5" -fastobo = "0.6.0" -fastobo-graphs = { git = "https://github.com/fastobo/fastobo-graphs" } +fastobo = "0.7.0" +fastobo-graphs = "0.1.1" fastobo-py-derive-internal = { path = "./derive" } diff --git a/derive/Cargo.toml b/derive/Cargo.toml index 83bdeec..b569c2c 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastobo-py-derive-internal" -version = "0.2.2" +version = "0.3.0" authors = ["Martin Larralde "] edition = "2018" publish = false diff --git a/setup.cfg b/setup.cfg index 13f6fca..e266c56 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = fastobo -version = 0.2.2 +version = 0.3.0 author = Martin Larralde author-email = martin.larralde@ens-paris-saclay.fr home-page = https://github.com/fastobo/fastobo-py diff --git a/src/error.rs b/src/error.rs index 70578a0..9c5ce14 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,6 +7,7 @@ use pest::error::LineColLocation; use pyo3::exceptions::OSError; use pyo3::exceptions::RuntimeError; use pyo3::exceptions::SyntaxError; +use pyo3::exceptions::ValueError; use pyo3::PyErr; use fastobo::parser::Rule; @@ -135,3 +136,30 @@ impl Into> for Error { Err(pyo3::PyErr::from(self)) } } + +/// A wrapper to convert `fastobo_graphs::error::Error` into a `PyErr`. +pub struct GraphError(fastobo_graphs::error::Error); + +impl From for GraphError { + fn from(e: fastobo_graphs::error::Error) -> Self { + GraphError(e) + } +} + +impl From for PyErr { + fn from(err: GraphError) -> Self { + match err.0 { + fastobo_graphs::error::Error::OboSyntaxError(error) => { + Error::from(error).into() + } + fastobo_graphs::error::Error::IOError(error) => { + let desc = ::description(&error).to_string(); + match error.raw_os_error() { + Some(code) => OSError::py_err((code, desc)), + None => OSError::py_err((desc,)), + } + } + other => ValueError::py_err(other.to_string()), + } + } +} diff --git a/src/py/abc.rs b/src/py/abc.rs index f583fa4..77091ca 100644 --- a/src/py/abc.rs +++ b/src/py/abc.rs @@ -25,7 +25,6 @@ use pyo3::PyTypeInfo; use fastobo::ast as obo; use crate::error::Error; -use crate::pyfile::PyFile; use crate::utils::AsGILRef; use crate::utils::ClonePy; diff --git a/src/py/doc.rs b/src/py/doc.rs index d04b27b..0c3cac6 100644 --- a/src/py/doc.rs +++ b/src/py/doc.rs @@ -26,7 +26,6 @@ use fastobo::ast as obo; use fastobo::visit::VisitMut; use crate::error::Error; -use crate::pyfile::PyFile; use crate::utils::AsGILRef; use crate::utils::ClonePy; diff --git a/src/py/mod.rs b/src/py/mod.rs index e7775fc..49a8317 100644 --- a/src/py/mod.rs +++ b/src/py/mod.rs @@ -28,10 +28,13 @@ use pyo3::PyTypeInfo; use fastobo::ast as obo; use fastobo::visit::VisitMut; use fastobo_graphs::FromGraph; +use fastobo_graphs::IntoGraph; use fastobo_graphs::model::GraphDocument; use crate::error::Error; -use crate::pyfile::PyFile; +use crate::error::GraphError; +use crate::pyfile::PyFileRead; +use crate::pyfile::PyFileWrite; use crate::utils::AsGILRef; use crate::utils::ClonePy; @@ -70,7 +73,6 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { use self::xref::PyInit_xref; m.add("__package__", "fastobo")?; - // m.add("__built__", pyo3_built!(py, built))?; add_submodule!(py, m, abc); add_submodule!(py, m, doc); @@ -117,17 +119,17 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { fn load(py: Python, fh: &PyAny) -> PyResult { if let Ok(s) = fh.downcast_ref::() { let path = s.to_string()?; - match obo::OboDoc::from_file(path.as_ref()) { + match fastobo::from_file(path.as_ref()) { Ok(doc) => Ok(doc.into_py(py)), Err(e) => Error::from(e).into(), } } else { - match PyFile::from_object(fh.py(), fh) { + match PyFileRead::from_object(fh.py(), fh) { // Object is a binary file-handle: attempt to parse the // document and return an `OboDoc` object. Ok(f) => { let mut bufreader = std::io::BufReader::new(f); - match obo::OboDoc::from_stream(&mut bufreader) { + match fastobo::from_reader(&mut bufreader) { Ok(doc) => Ok(doc.into_py(py)), Err(e) => bufreader .into_inner() @@ -209,11 +211,13 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// Returns: /// `~fastobo.doc.OboDoc`: the first graph of the OBO graph /// converted to an OBO document. The schema allows for more than - /// one graph but this is never really used. + /// one graph but this is only used when merging imports into the + /// same document. /// /// Raises: /// TypeError: when the argument is not a `str` or a binary stream. - /// SyntaxError: when the document is not in valid OBO syntax. + /// ValueError: when the JSON is not a valid OBO Graph. + /// SyntaxError: when the document contains invalid OBO identifiers. /// OSError: when an underlying OS error occurs. /// *other*: any exception raised by ``fh.read``. /// @@ -225,13 +229,7 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// >>> url = "http://purl.obolibrary.org/obo/pato.json" /// >>> doc = fastobo.load_graph(urlopen(url)) /// >>> doc[3] - /// TermFrame(Url('http://purl.obolibrary.org/obo/PATO_0000000')) - /// - /// Note: - /// OBO graphs only contains URL identifiers, and deserializing one - /// will not compact this function automatically. Consider using the - /// `~fastobo.doc.OboDoc.compact_ids` method if that is the expected - /// result. + /// TermFrame(PrefixedIdent('PATO', '0000000')) /// #[pyfn(m, "load_graph")] fn load_graph(py: Python, fh: &PyAny) -> PyResult { @@ -239,16 +237,17 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { let doc: GraphDocument = if let Ok(s) = fh.downcast_ref::() { let path = s.to_string()?; fastobo_graphs::from_file(path.as_ref()) - .map_err(|e| RuntimeError::py_err(e.to_string()))? + .map_err(|e| PyErr::from(GraphError::from(e)))? } else { - match PyFile::from_object(fh.py(), fh) { + match PyFileRead::from_object(fh.py(), fh) { // Object is a binary file-handle: attempt to parse the // document and return an `OboDoc` object. Ok(mut f) => { fastobo_graphs::from_reader(&mut f) .map_err(|e| f .into_err() - .unwrap_or_else(|| RuntimeError::py_err(e.to_string())))? + .unwrap_or_else(|| GraphError::from(e).into()) + )? } // Object is not a binary file-handle: wrap the inner error // into a `TypeError` and raise that error. @@ -267,12 +266,76 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { // Convert the graph to an OBO document let graph = doc.graphs.into_iter().next().unwrap(); - let doc = obo::OboDoc::from_graph(graph) - .map_err(|e| RuntimeError::py_err(e.to_string()))?; + let doc = obo::OboDoc::from_graph(graph).map_err(GraphError::from)?; // Convert the OBO document to a Python handle Ok(OboDoc::from_py(doc, py)) } + /// dump_graph(doc, fh) + /// -- + /// + /// Dump an OBO graph into the given writer or file handle, serialized + /// into a compact JSON representation. + /// + /// Arguments: + /// fh (str or file-handle): the path to a file, or a writable + /// **binary** stream to write the serialized graph into. + /// *A binary stream needs a* ``write(b)`` *method that accepts + /// binary strings*. + /// doc (`~fastobo.doc.OboDoc`): the OBO document to be converted + /// into an OBO Graph. + /// + /// Raises: + /// TypeError: when the argument have invalid types. + /// ValueError: when the JSON serialization fails. + /// OSError: when an underlying OS error occurs. + /// *other*: any exception raised by ``fh.read``. + /// + /// Example: + /// Use ``fastobo`` to convert an OBO file into an OBO graph: + /// + /// >>> doc = fastobo.load("tests/data/plana.obo") + /// >>> fastobo.dump_graph(doc, "tests/data/plana.json") + /// + #[pyfn(m, "dump_graph")] + fn dump_graph(py: Python, obj: &OboDoc, fh: &PyAny) -> PyResult<()> { + // Convert OBO document to an OBO Graph document. + let doc = obo::OboDoc::from_py(obj.clone_py(py), py).into_graph() + .map_err(|e| RuntimeError::py_err(e.to_string()))?; + // Write the document + if let Ok(s) = fh.downcast_ref::() { + // Write into a file if given a path as a string. + let path = s.to_string()?; + fastobo_graphs::to_file(path.as_ref(), &doc) + .map_err(|e| PyErr::from(GraphError::from(e))) + } else { + // Write into the handle if given a writable file. + match PyFileWrite::from_object(fh.py(), fh) { + // Object is a binary file-handle: attempt to write the + // `GraphDocument` to the file handle. + Ok(mut f) => { + fastobo_graphs::to_writer(&mut f, &doc) + .map_err(|e| f + .into_err() + .unwrap_or_else(|| GraphError::from(e).into()) + ) + } + // Object is not a binary file-handle: wrap the inner error + // into a `TypeError` and raise that error. + Err(inner) => { + let msg = "expected path or binary file handle"; + let err = TypeError::py_err(msg).to_object(py); + err.call_method1( + py, + "__setattr__", + ("__cause__".to_object(py), inner.to_object(py)), + )?; + return Err(PyErr::from_instance(err.as_ref(py).as_ref())); + } + } + } + } + Ok(()) } diff --git a/src/pyfile.rs b/src/pyfile.rs index 644c276..2aeb2c3 100644 --- a/src/pyfile.rs +++ b/src/pyfile.rs @@ -1,6 +1,7 @@ use std::cell::RefCell; use std::io::Error as IoError; use std::io::Read; +use std::io::Write; use std::marker::PhantomData; use std::sync::Arc; @@ -16,14 +17,41 @@ use pyo3::PyDowncastError; use pyo3::PyErrValue; use pyo3::PyObject; -pub struct PyFile<'p> { +// --------------------------------------------------------------------------- + +macro_rules! transmute_error { + ($self:ident, $e:ident, $msg:expr) => ({ + // Attempt to transmute the Python OSError to an actual + // Rust `std::io::Error` using `from_raw_os_error`. + if $e.is_instance::($self.py) { + if let PyErrValue::Value(obj) = &$e.pvalue { + if let Ok(code) = obj.getattr($self.py, "errno") { + if let Ok(n) = code.extract::($self.py) { + return Err(IoError::from_raw_os_error(n)); + } + } + } + } + + // if the conversion is not possible for any reason we fail + // silently, wrapping the Python error, and returning a + // generic Rust error instead. + $self.err = Some($e); + Err(IoError::new(std::io::ErrorKind::Other, $msg)) + }) +} + +// --------------------------------------------------------------------------- + +/// A wrapper around a readable Python file. +pub struct PyFileRead<'p> { file: pyo3::PyObject, py: Python<'p>, err: Option, } -impl<'p> PyFile<'p> { - pub fn from_object(py: Python<'p>, obj: &T) -> PyResult> +impl<'p> PyFileRead<'p> { + pub fn from_object(py: Python<'p>, obj: &T) -> PyResult> where T: AsPyPointer, { @@ -31,7 +59,7 @@ impl<'p> PyFile<'p> { let file = PyObject::from_borrowed_ptr(py, obj.as_ptr()); let res = file.call_method1(py, "read", (0,))?; if py.is_instance::(&res).unwrap_or(false) { - Ok(PyFile { + Ok(PyFileRead { file, py, err: None, @@ -48,7 +76,7 @@ impl<'p> PyFile<'p> { } } -impl<'p> Read for PyFile<'p> { +impl<'p> Read for PyFileRead<'p> { fn read(&mut self, buf: &mut [u8]) -> Result { unsafe { match self.file.call_method1(self.py, "read", (buf.len(),)) { @@ -68,26 +96,70 @@ impl<'p> Read for PyFile<'p> { )) } } - Err(e) => { - // Attempt to transmute the Python OSError to an actual - // Rust `std::io::Error` using `from_raw_os_error`. - if e.is_instance::(self.py) { - if let PyErrValue::Value(obj) = &e.pvalue { - if let Ok(code) = obj.getattr(self.py, "errno") { - if let Ok(n) = code.extract::(self.py) { - return Err(IoError::from_raw_os_error(n)); - } - } - } - } + Err(e) => transmute_error!(self, e, "read method failed") + } + } + } +} + +// --------------------------------------------------------------------------- + +/// A wrapper around a writable Python file. +pub struct PyFileWrite<'p> { + file: pyo3::PyObject, + py: Python<'p>, + err: Option, +} - // if the conversion is not possible for any reason we fail - // silently, wrapping the Python error, and returning a - // generic Rust error instead. - self.err = Some(e); - Err(IoError::new(std::io::ErrorKind::Other, "fh.read failed")) +impl<'p> PyFileWrite<'p> { + pub fn from_object(py: Python<'p>, obj: &T) -> PyResult> + where + T: AsPyPointer, + { + // FIXME + unsafe { + let file = PyObject::from_borrowed_ptr(py, obj.as_ptr()); + file.call_method1(py, "write", (0, PyBytes::new(py, b""))) + .map(|_| PyFileWrite { + file, + py, + err: None, + }) + } + } + + pub fn into_err(self) -> Option { + self.err + } +} + +impl<'p> Write for PyFileWrite<'p> { + fn write(&mut self, buf: &[u8]) -> Result { + let bytes = PyBytes::new(self.py, buf); + match self.file.call_method1(self.py, "write", (bytes,)) { + Ok(obj) => { + // unimplemented!() + // Check `fh.write` returned int, else raise a `TypeError`. + if let Ok(len) = usize::extract(&obj.as_ref(self.py)) { + Ok(len) + } else { + let ty = obj.as_ref(self.py).get_type().name().to_string(); + let msg = format!("expected int, found {}", ty); + self.err = Some(TypeError::py_err(msg)); + Err(IoError::new( + std::io::ErrorKind::Other, + "write method did not return int", + )) } } + Err(e) => transmute_error!(self, e, "write method failed"), + } + } + + fn flush(&mut self) -> Result<(), IoError> { + match self.file.call_method0(self.py, "flush") { + Ok(_) => Ok(()), + Err(e) => transmute_error!(self, e, "flush method failed"), } } } diff --git a/tests/data/.gitignore b/tests/data/.gitignore new file mode 100644 index 0000000..7eae192 --- /dev/null +++ b/tests/data/.gitignore @@ -0,0 +1 @@ +plana.json