From 8953724d176608a8555b39ab82807ff7a27bb869 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2019 20:22:47 +0000 Subject: [PATCH 01/17] Bump libc from 0.2.58 to 0.2.59 (#19) --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 907ee04..8e304ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,7 +20,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -30,7 +30,7 @@ version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -93,7 +93,7 @@ name = "chrono" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -206,7 +206,7 @@ dependencies = [ "built 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-py-derive 0.1.1", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (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)", @@ -260,7 +260,7 @@ version = "0.9.1" 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.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (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.6 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -342,7 +342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.58" +version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -351,7 +351,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (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)", ] @@ -362,7 +362,7 @@ version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -535,7 +535,7 @@ source = "git+https://github.com/PyO3/pyo3#9669edbfe387a14912cd1abdb2cbcf506466a 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)", - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", "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)", @@ -728,7 +728,7 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -869,7 +869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum inventory-impl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8a877ae8bce77402d5e9ed870730939e097aad827b2a932b361958fa9d6e75aa" "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.58 (registry+https://github.com/rust-lang/crates.io-index)" = "6281b86796ba5e4366000be6e9e18bf35580adf9e63fbe2294aadb587613a319" +"checksum libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3262021842bf00fe07dbd6cf34ff25c99d7a7ebef8deea84db72be3ea3bb0aff" "checksum libgit2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "941a41e23f77323b8c9d2ee118aec9ee39dfc176078c18b4757d3bad049d9ff7" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" diff --git a/Cargo.toml b/Cargo.toml index 7dbc1ed..b5becba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ built = "0.3.1" pyo3 = { git = "https://github.com/PyO3/pyo3" } # pyo3-built = "0.2.0" pest = "2.1.1" -libc = "0.2.58" +libc = "0.2.59" url = "1.7.2" opaque_typedef = "0.0.5" opaque_typedef_macros = "0.0.5" From be1ee835d0eeb63d4a0a4492d1541584d026e3c9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2019 20:07:31 +0000 Subject: [PATCH 02/17] Bump pyo3 from `9669edb` to `5d85ea7` (#20) --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e304ef..7b85a08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -531,7 +531,7 @@ dependencies = [ [[package]] name = "pyo3" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#9669edbfe387a14912cd1abdb2cbcf506466ab05" +source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" 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)", @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "pyo3-derive-backend" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#9669edbfe387a14912cd1abdb2cbcf506466ab05" +source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -560,7 +560,7 @@ dependencies = [ [[package]] name = "pyo3cls" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#9669edbfe387a14912cd1abdb2cbcf506466ab05" +source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" 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)", From 82098c5d3a6da1d947b29a89415fe7708dc8e929 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2019 21:11:03 +0000 Subject: [PATCH 03/17] Bump fastobo from 0.4.3 to 0.4.4 (#18) --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b85a08..9a05477 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,11 +175,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fastobo" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo-derive-internal 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo-derive-internal 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "opaque_typedef 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "fastobo-derive-internal" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -204,7 +204,7 @@ name = "fastobo-py" version = "0.1.1" dependencies = [ "built 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-py-derive 0.1.1", "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", "opaque_typedef 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -853,8 +853,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -"checksum fastobo 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69bf0b963a54634d671f6a49034189a0c195d67c4c31fd95301ea8a5449697ae" -"checksum fastobo-derive-internal 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c5039f643fab58dbeb0d7ef59ac411434aea66e0eee5825a83ccf8b5a9e1a6d2" +"checksum fastobo 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25dd8c5f00ce9b44d8aad3056d8685d7f348ea8b5ea31a0623502d0b02d7f434" +"checksum fastobo-derive-internal 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "556fe278a2033c14d0b2088dd42d3056d822ee86e9d59f485382e817c5fe8367" "checksum fastobo-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a71748f8bbf323ef09606aa3e812e9a7d0ac5ad23750354bc66d47600543869" "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" diff --git a/Cargo.toml b/Cargo.toml index b5becba..3f55df9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,5 +23,5 @@ libc = "0.2.59" url = "1.7.2" opaque_typedef = "0.0.5" opaque_typedef_macros = "0.0.5" -fastobo = "0.4.3" +fastobo = "0.4.4" fastobo-py-derive = { path = "./derive" } From 2e3f3aef6a405c055796cfa7448d62e73ea3e999 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 10:32:37 +0000 Subject: [PATCH 04/17] Bump quote from 0.6.12 to 0.6.13 (#21) --- Cargo.lock | 40 ++++++++++++++++++++-------------------- derive/Cargo.toml | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a05477..fcaaae1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,7 +104,7 @@ name = "ctor" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.6.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -125,7 +125,7 @@ dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ident_case 1.0.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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -136,7 +136,7 @@ version = "0.9.0" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -163,7 +163,7 @@ version = "0.1.5" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -195,7 +195,7 @@ 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -218,7 +218,7 @@ dependencies = [ name = "fastobo-py-derive" version = "0.1.1" dependencies = [ - "quote 0.6.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -250,7 +250,7 @@ version = "0.1.0" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -305,7 +305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-hack 0.5.7 (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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -326,7 +326,7 @@ version = "0.1.3" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -442,7 +442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.3.0 (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.12 (registry+https://github.com/rust-lang/crates.io-index)", + "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.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -478,7 +478,7 @@ dependencies = [ "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -511,7 +511,7 @@ version = "0.5.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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -553,7 +553,7 @@ version = "0.7.0" source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -564,13 +564,13 @@ source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quote" -version = "0.6.12" +version = "0.6.13" 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)", @@ -638,7 +638,7 @@ version = "1.0.94" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -690,7 +690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -700,7 +700,7 @@ version = "0.15.39" 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.12 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -710,7 +710,7 @@ version = "0.10.2" 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.12 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -896,7 +896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pyo3 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" "checksum pyo3-derive-backend 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" "checksum pyo3cls 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" -"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252" "checksum regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0b2f0808e7d7e4fb1cb07feb6ff2f4bc827938f24f8c2e6a3beb7370af544bdd" "checksum regex-syntax 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d76410686f9e3a17f06128962e0ecc5755870bb890c34820c7af7f1db2e1d48" diff --git a/derive/Cargo.toml b/derive/Cargo.toml index b3a4f72..ba2defa 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -12,4 +12,4 @@ path = "lib.rs" [dependencies] syn = "0.15.36" -quote = "0.6.12" +quote = "0.6.13" From ebefd322207b08b45ab71991f823932fc22fb15e Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Tue, 16 Jul 2019 01:50:53 +0000 Subject: [PATCH 05/17] Bump `fastobo` dependency to `v0.5.0` --- Cargo.lock | 156 ++++++++++++++++++++++------------------------------- Cargo.toml | 2 +- 2 files changed, 65 insertions(+), 93 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcaaae1..200f9de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,10 +2,10 @@ # It is not intended for manual editing. [[package]] name = "aho-corasick" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -13,26 +13,6 @@ name = "autocfg" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "backtrace" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace-sys 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "bitflags" version = "1.1.0" @@ -93,7 +73,7 @@ name = "chrono" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -142,28 +122,20 @@ dependencies = [ [[package]] name = "digest" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "failure" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "failure_derive" +name = "err-derive" version = "0.1.5" 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)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -175,13 +147,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fastobo" -version = "0.4.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo-derive-internal 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo-derive-internal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.0 (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)", "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -190,7 +162,7 @@ dependencies = [ [[package]] name = "fastobo-derive-internal" -version = "0.4.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -204,9 +176,9 @@ name = "fastobo-py" version = "0.1.1" dependencies = [ "built 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fastobo 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-py-derive 0.1.1", - "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", @@ -260,9 +232,9 @@ version = "0.9.1" 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.59 (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.6 (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)", ] @@ -295,7 +267,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "indoc-impl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -303,7 +275,7 @@ name = "indoc-impl" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-hack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "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.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -342,7 +314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -351,7 +323,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.59 (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)", ] @@ -362,14 +334,14 @@ version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.59 (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)", - "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.6" +version = "0.4.7" 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)", @@ -405,7 +377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -507,7 +479,7 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.7" +version = "0.5.8" 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)", @@ -531,17 +503,17 @@ dependencies = [ [[package]] name = "pyo3" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" +source = "git+https://github.com/PyO3/pyo3#6e807f852b6969838fe6aaa4c98a926339b830d9" 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)", - "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "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.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (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)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -550,7 +522,7 @@ dependencies = [ [[package]] name = "pyo3-derive-backend" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" +source = "git+https://github.com/PyO3/pyo3#6e807f852b6969838fe6aaa4c98a926339b830d9" 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)", @@ -560,7 +532,7 @@ dependencies = [ [[package]] name = "pyo3cls" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#5d85ea7fdc793e298dcbed0696a07b13942a8ea5" +source = "git+https://github.com/PyO3/pyo3#6e807f852b6969838fe6aaa4c98a926339b830d9" 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)", @@ -578,37 +550,40 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.54" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.4 (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.8 (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.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "rustc-demangle" -version = "0.1.15" +name = "rustc_version" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "ryu" -version = "0.2.8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -644,11 +619,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.39" +version = "1.0.40" 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 0.2.8 (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.94 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -658,7 +633,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.8.0 (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)", ] @@ -728,8 +703,8 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -804,7 +779,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "vcpkg" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -832,10 +807,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum aho-corasick 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c" +"checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" "checksum autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0e49efa51329a5fd37e7c79db4621af617cd4e3e5bc224939808d076077077bf" -"checksum backtrace 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "18b50f5258d1a9ad8396d2d345827875de4261b158124d4c819d9b351454fae5" -"checksum backtrace-sys 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "12cb9f1eef1d1fc869ad5a26c9fa48516339a15e54a227a25460fc304815fdb3" "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" "checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" @@ -849,12 +822,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6" "checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c" "checksum darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d8dac1c6f1d29a41c4712b4400f878cb4fcc4c7628f298dd75038e024998d1" -"checksum digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f47366984d3ad862010e22c7ce81a7dbcaebbdfb37241a620f8b6596ee135c" -"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" -"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"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.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25dd8c5f00ce9b44d8aad3056d8685d7f348ea8b5ea31a0623502d0b02d7f434" -"checksum fastobo-derive-internal 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "556fe278a2033c14d0b2088dd42d3056d822ee86e9d59f485382e817c5fe8367" +"checksum fastobo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b94b198817cce4506abc5b4237d6f46556ebd431d7ce36fb29ebf76c03a4515" +"checksum fastobo-derive-internal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "614e011a6ca2f4f0624ec797f9148e81127787f64787d39c600b6d6d85b3ca06" "checksum fastobo-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a71748f8bbf323ef09606aa3e812e9a7d0ac5ad23750354bc66d47600543869" "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" @@ -869,15 +841,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum inventory-impl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8a877ae8bce77402d5e9ed870730939e097aad827b2a932b361958fa9d6e75aa" "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.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3262021842bf00fe07dbd6cf34ff25c99d7a7ebef8deea84db72be3ea3bb0aff" +"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 libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" -"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" +"checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" "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" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" +"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" @@ -890,23 +862,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "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 proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8" -"checksum proc-macro-hack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0c1dd4172a1e1f96f709341418f49b11ea6c2d95d53dca08c0f74cbd332d9cf3" +"checksum proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "982a35d1194084ba319d65c4a68d24ca28f5fdb5b8bc20899e4eef8641ea5178" "checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum pyo3 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" "checksum pyo3-derive-backend 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" "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.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252" -"checksum regex 1.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0b2f0808e7d7e4fb1cb07feb6ff2f4bc827938f24f8c2e6a3beb7370af544bdd" -"checksum regex-syntax 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d76410686f9e3a17f06128962e0ecc5755870bb890c34820c7af7f1db2e1d48" -"checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" -"checksum ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "b96a9549dc8d48f2c283938303c4b5a77aa29bfbc5b54b084fb1630408899a8f" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d9d8297cc20bbb6184f8b45ff61c8ee6a9ac56c156cec8e38c3e5084773c44ad" +"checksum regex-syntax 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9b01330cce219c1c6b2e209e5ed64ccd587ae5c67bed91c0b49eecf02ae40e21" +"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.94 (registry+https://github.com/rust-lang/crates.io-index)" = "076a696fdea89c19d3baed462576b8f6d663064414b5c793642da8dfeb99475b" "checksum serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)" = "ef45eb79d6463b22f5f9e16d283798b7c0175ba6050bc25c1a946c122727fe7b" -"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" +"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" "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" @@ -928,7 +900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "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 utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" -"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" +"checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" diff --git a/Cargo.toml b/Cargo.toml index 3f55df9..0205c59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,5 +23,5 @@ libc = "0.2.59" url = "1.7.2" opaque_typedef = "0.0.5" opaque_typedef_macros = "0.0.5" -fastobo = "0.4.4" +fastobo = "0.5.0" fastobo-py-derive = { path = "./derive" } From d745935c166873cc167294d9859e2320e6807eba Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Tue, 16 Jul 2019 22:45:46 +0000 Subject: [PATCH 06/17] Bump `Cargo.lock` to use newer version of `proc-macro-hack` --- Cargo.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 200f9de..113e94d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -358,7 +358,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "mashup-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -366,7 +366,7 @@ name = "mashup-impl" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -385,7 +385,7 @@ name = "num-integer" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -394,7 +394,7 @@ name = "num-traits" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -471,10 +471,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro-hack" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack-impl 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -489,7 +489,7 @@ dependencies = [ [[package]] name = "proc-macro-hack-impl" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -503,7 +503,7 @@ dependencies = [ [[package]] name = "pyo3" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#6e807f852b6969838fe6aaa4c98a926339b830d9" +source = "git+https://github.com/PyO3/pyo3#86cc84e692f92003d466cd6754ce24083d84213e" 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)", @@ -512,17 +512,17 @@ dependencies = [ "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.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.95 (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)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pyo3-derive-backend" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#6e807f852b6969838fe6aaa4c98a926339b830d9" +source = "git+https://github.com/PyO3/pyo3#86cc84e692f92003d466cd6754ce24083d84213e" 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)", @@ -532,7 +532,7 @@ dependencies = [ [[package]] name = "pyo3cls" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#6e807f852b6969838fe6aaa4c98a926339b830d9" +source = "git+https://github.com/PyO3/pyo3#86cc84e692f92003d466cd6754ce24083d84213e" 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)", @@ -601,15 +601,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.94" +version = "1.0.95" 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)", @@ -624,7 +624,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.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -713,7 +713,7 @@ name = "toml" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -784,7 +784,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "version_check" -version = "0.1.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -808,7 +808,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" -"checksum autocfg 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0e49efa51329a5fd37e7c79db4621af617cd4e3e5bc224939808d076077077bf" +"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" "checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" @@ -861,9 +861,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "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 proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8" +"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.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a" +"checksum proc-macro-hack-impl 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "38c47dcb1594802de8c02f3b899e2018c78291168a22c281be21ea0fb4796842" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum pyo3 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" "checksum pyo3-derive-backend 0.7.0 (git+https://github.com/PyO3/pyo3)" = "" @@ -876,8 +876,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "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.94 (registry+https://github.com/rust-lang/crates.io-index)" = "076a696fdea89c19d3baed462576b8f6d663064414b5c793642da8dfeb99475b" -"checksum serde_derive 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)" = "ef45eb79d6463b22f5f9e16d283798b7c0175ba6050bc25c1a946c122727fe7b" +"checksum serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)" = "e47a9fd6b2d2d2330b19b0b3e5248a170a5acd6356fd88c7bb30362ef9c70567" +"checksum serde_derive 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)" = "5ea8eb91549d859275aef70c58bb30bd62ce50e5eb1a52d32b1b6886e02f7bce" "checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" "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" @@ -901,7 +901,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" "checksum utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" "checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"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" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" From 58986f9a0a786718d16bf7c5c10224295948dfd5 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Wed, 17 Jul 2019 20:57:08 +0000 Subject: [PATCH 07/17] Use `Python` as argument directly in some getters --- src/py/header/clause.rs | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/py/header/clause.rs b/src/py/header/clause.rs index 9191e66..b4d079d 100644 --- a/src/py/header/clause.rs +++ b/src/py/header/clause.rs @@ -357,8 +357,7 @@ impl DateClause { /// `~datetime.datetime`: the date this document was last modified. #[getter] - fn get_date<'p>(&self) -> PyResult<&'p PyDateTime> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_date<'py>(&self, py: Python<'py>) -> PyResult<&'py PyDateTime> { PyDateTime::new( py, self.date.year() as i32, @@ -394,7 +393,7 @@ impl PyObjectProtocol for DateClause { let gil = Python::acquire_gil(); let py = gil.python(); let fmt = PyString::new(py, "DateClause({!r})").to_object(py); - fmt.call_method1(py, "format", (self.get_date()?,)) + fmt.call_method1(py, "format", (self.get_date(py)?,)) } fn __str__(&self) -> PyResult { @@ -697,8 +696,7 @@ impl SubsetdefClause { /// `~fastobo.id.Ident`: the identifier of the declared subset. #[getter] - fn get_subset(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_subset<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.subset.to_object(py)) } @@ -1146,8 +1144,7 @@ impl IdspaceClause { /// `~fastobo.id.Url`: the URL used to expand IDs of this IDspace. #[getter] - fn get_url(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_url<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.url.clone_py(py)) } @@ -1238,8 +1235,7 @@ impl FromPy for obo::HeaderClause { impl TreatXrefsAsEquivalentClause { /// `~fastobo.id.IdentPrefix`: the ID prefix to select some Xrefs with. #[getter] - fn get_idspace(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_idspace<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.idspace.clone_py(py)) } } @@ -1319,8 +1315,7 @@ impl FromPy for obo::HeaderClause { impl TreatXrefsAsGenusDifferentiaClause { /// `~fastobo.id.IdentPrefix`: the ID prefix to select some Xrefs with. #[getter] - fn get_idspace(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_idspace<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.idspace.clone_py(py)) } } @@ -1409,8 +1404,7 @@ impl FromPy for obo::HeaderClause { impl TreatXrefsAsReverseGenusDifferentiaClause { /// `~fastobo.id.IdentPrefix`: the ID prefix to select some Xrefs with. #[getter] - fn get_idspace(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_idspace<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.idspace.clone_py(py)) } } @@ -1494,8 +1488,7 @@ impl FromPy for obo::HeaderClause { impl TreatXrefsAsRelationshipClause { /// `~fastobo.id.IdentPrefix`: the ID prefix to select some Xrefs with. #[getter] - fn get_idspace(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_idspace<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.idspace.clone_py(py)) } } @@ -1569,8 +1562,7 @@ impl FromPy for obo::HeaderClause { impl TreatXrefsAsIsAClause { /// `~fastobo.id.IdentPrefix`: the ID prefix to select some Xrefs with. #[getter] - fn get_idspace(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_idspace<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.idspace.clone_py(py)) } } @@ -1634,8 +1626,7 @@ impl FromPy for obo::HeaderClause { impl TreatXrefsAsHasSubclassClause { /// `~fastobo.id.IdentPrefix`: the ID prefix to select some Xrefs with. #[getter] - fn get_idspace(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_idspace<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.idspace.clone_py(py)) } } From 75ab70378a7357eee692d0f145bbf8efc4b9da7b Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Wed, 17 Jul 2019 23:21:31 +0000 Subject: [PATCH 08/17] Add provisional support for OBO graph deserialization --- Cargo.lock | 47 ++++++++++++++++++++++++++++++ Cargo.toml | 2 ++ src/error.rs | 2 +- src/lib.rs | 1 + src/py/mod.rs | 80 +++++++++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 128 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 113e94d..34bd1fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,6 +128,11 @@ dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dtoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "err-derive" version = "0.1.5" @@ -171,12 +176,25 @@ dependencies = [ "syn 0.15.39 (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#2c4dec16216a1fa4cce67afd441d5a2f759792c1" +dependencies = [ + "err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo 0.5.0 (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.95 (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.1.1" dependencies = [ "built 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fastobo-graphs 0.1.0 (git+https://github.com/fastobo/fastobo-graphs)", "fastobo-py-derive 0.1.1", "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)", @@ -339,6 +357,11 @@ dependencies = [ "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "linked-hash-map" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "log" version = "0.4.7" @@ -627,6 +650,17 @@ dependencies = [ "serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_yaml" +version = "0.8.9" +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.95 (registry+https://github.com/rust-lang/crates.io-index)", + "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sha-1" version = "0.8.1" @@ -806,6 +840,14 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "yaml-rust" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] "checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" "checksum autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "22130e92352b948e7e82a49cdb0aa94f2211761117f29e052dd397c1ac33542b" @@ -823,10 +865,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c" "checksum darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d8dac1c6f1d29a41c4712b4400f878cb4fcc4c7628f298dd75038e024998d1" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"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.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b94b198817cce4506abc5b4237d6f46556ebd431d7ce36fb29ebf76c03a4515" "checksum fastobo-derive-internal 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "614e011a6ca2f4f0624ec797f9148e81127787f64787d39c600b6d6d85b3ca06" +"checksum fastobo-graphs 0.1.0 (git+https://github.com/fastobo/fastobo-graphs)" = "" "checksum fastobo-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a71748f8bbf323ef09606aa3e812e9a7d0ac5ad23750354bc66d47600543869" "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" @@ -844,6 +888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "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 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 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" @@ -879,6 +924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)" = "e47a9fd6b2d2d2330b19b0b3e5248a170a5acd6356fd88c7bb30362ef9c70567" "checksum serde_derive 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)" = "5ea8eb91549d859275aef70c58bb30bd62ce50e5eb1a52d32b1b6886e02f7bce" "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" @@ -905,3 +951,4 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" diff --git a/Cargo.toml b/Cargo.toml index 0205c59..fe28eea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,5 +23,7 @@ libc = "0.2.59" url = "1.7.2" opaque_typedef = "0.0.5" opaque_typedef_macros = "0.0.5" + fastobo = "0.5.0" +fastobo-graphs = { git = "https://github.com/fastobo/fastobo-graphs"} fastobo-py-derive = { path = "./derive" } diff --git a/src/error.rs b/src/error.rs index 1a9fd0a..70578a0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -125,7 +125,7 @@ impl From for PyErr { } } - _ => RuntimeError::py_err("todo"), + other => RuntimeError::py_err(format!("{}", other)), } } } diff --git a/src/lib.rs b/src/lib.rs index ff36a3f..bc79a96 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,7 @@ extern crate opaque_typedef_macros; extern crate opaque_typedef; #[macro_use] extern crate fastobo_py_derive; +extern crate fastobo_graphs; #[macro_use] pub mod macros; diff --git a/src/py/mod.rs b/src/py/mod.rs index 3f38944..272810e 100644 --- a/src/py/mod.rs +++ b/src/py/mod.rs @@ -26,6 +26,7 @@ use pyo3::PySequenceProtocol; use pyo3::PyTypeInfo; use fastobo::ast as obo; +use fastobo_graphs::FromGraph; use crate::error::Error; use crate::pyfile::PyFile; @@ -98,12 +99,12 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// *other*: any exception raised by ``fh.read``. /// /// Example: - /// Use ``requests`` and ``fastobo`` to parse an ontology downloaded + /// Use ``urllib`` and ``fastobo`` to parse an ontology downloaded /// from the Berkeley BOP portal: /// - /// >>> import requests + /// >>> from urllib.request import urlopen /// >>> url = "http://purl.obolibrary.org/obo/cmo.obo" - /// >>> doc = fastobo.load(requests.get(url, stream=True).raw) + /// >>> doc = fastobo.load(urlopen(url)) /// >>> doc.header[2] /// OntologyClause('cmo.obo') #[pyfn(m, "load")] @@ -186,5 +187,78 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { } } + /// load_graph(fh) + /// -- + /// + /// Load an OBO graph from the given path or file handle. + /// + /// Arguments: + /// fh (str or file-handle): the path to an OBO graph file, or a + /// **binary** stream that contains a serialized OBO document. + /// *A binary stream needs a* ``read(x)`` *method returning* + /// ``x`` *bytes*. + /// + /// Returns: + /// `~fastobo.doc.OboDoc`: the first graph of the OBO graph + /// converted to an OBO document. + /// + /// Raises: + /// TypeError: when the argument is not a `str` or a binary stream. + /// SyntaxError: when the document is not in valid OBO syntax. + /// OSError: when an underlying OS error occurs. + /// *other*: any exception raised by ``fh.read``. + /// + /// Example: + /// Use ``urllib`` and ``fastobo`` to parse an ontology downloaded + /// from the Berkeley BOP portal: + /// + /// >>> from urllib.request import urlopen + /// >>> url = "http://purl.obolibrary.org/obo/pato.json" + /// >>> doc = fastobo.load_graph(urlopen(url)) + /// >>> doc[4] + /// TermFrame(Url('http://purl.obolibrary.org/obo/PATO_0000000')) + #[pyfn(m, "load_graph")] + fn load_graph(py: Python, fh: &PyAny) -> PyResult { + if let Ok(s) = fh.downcast_ref::() { + let path = s.to_string()?; + match fastobo_graphs::from_file(path.as_ref()) { + Err(e) => Err(RuntimeError::py_err(format!("{}", e))), + Ok(doc) => { + let graph = doc.graphs.into_iter().next().unwrap(); + Ok(obo::OboDoc::from_graph(graph).into_py(py)) + } + } + } else { + match PyFile::from_object(fh.py(), fh) { + // Object is a binary file-handle: attempt to parse the + // document and return an `OboDoc` object. + Ok(mut f) => { + match fastobo_graphs::from_reader(&mut f) { + Ok(doc) => { + let graph = doc.graphs.into_iter().next().unwrap(); + Ok(obo::OboDoc::from_graph(graph).into_py(py)) + } + Err(e) => f + .into_err() + .unwrap_or_else(|| RuntimeError::py_err(format!("{}", 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)), + )?; + Err(PyErr::from_instance(err.as_ref(py).as_ref())) + } + } + } + } + Ok(()) } From b23b1432618e09fa39f3cf89afbbe1602bc1f9f9 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Thu, 18 Jul 2019 01:03:36 +0000 Subject: [PATCH 09/17] Fix implementation of `load_graph` to use new error chains from `fastobo-graphs` --- Cargo.lock | 28 ++++++++++++++-------------- src/py/mod.rs | 41 ++++++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34bd1fc..c1d5d78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,12 +179,12 @@ dependencies = [ [[package]] name = "fastobo-graphs" version = "0.1.0" -source = "git+https://github.com/fastobo/fastobo-graphs#2c4dec16216a1fa4cce67afd441d5a2f759792c1" +source = "git+https://github.com/fastobo/fastobo-graphs#4209f4d6bb0f6e873ef8800116d46ddf620f5919" dependencies = [ "err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo 0.5.0 (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.95 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -526,7 +526,7 @@ dependencies = [ [[package]] name = "pyo3" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#86cc84e692f92003d466cd6754ce24083d84213e" +source = "git+https://github.com/PyO3/pyo3#cf8f63cacf0ac4029d18a572688f7e8b93fa32f6" 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)", @@ -535,7 +535,7 @@ dependencies = [ "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.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (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)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "pyo3-derive-backend" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#86cc84e692f92003d466cd6754ce24083d84213e" +source = "git+https://github.com/PyO3/pyo3#cf8f63cacf0ac4029d18a572688f7e8b93fa32f6" 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)", @@ -555,7 +555,7 @@ dependencies = [ [[package]] name = "pyo3cls" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#86cc84e692f92003d466cd6754ce24083d84213e" +source = "git+https://github.com/PyO3/pyo3#cf8f63cacf0ac4029d18a572688f7e8b93fa32f6" 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)", @@ -624,15 +624,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.95" +version = "1.0.97" 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)", @@ -647,7 +647,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.95 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -657,7 +657,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.95 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -747,7 +747,7 @@ name = "toml" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -921,8 +921,8 @@ dependencies = [ "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.95 (registry+https://github.com/rust-lang/crates.io-index)" = "e47a9fd6b2d2d2330b19b0b3e5248a170a5acd6356fd88c7bb30362ef9c70567" -"checksum serde_derive 1.0.95 (registry+https://github.com/rust-lang/crates.io-index)" = "5ea8eb91549d859275aef70c58bb30bd62ce50e5eb1a52d32b1b6886e02f7bce" +"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_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" diff --git a/src/py/mod.rs b/src/py/mod.rs index 272810e..cbf20a2 100644 --- a/src/py/mod.rs +++ b/src/py/mod.rs @@ -26,7 +26,9 @@ use pyo3::PySequenceProtocol; use pyo3::PyTypeInfo; use fastobo::ast as obo; +use fastobo::visit::VisitMut; use fastobo_graphs::FromGraph; +use fastobo_graphs::model::GraphDocument; use crate::error::Error; use crate::pyfile::PyFile; @@ -219,30 +221,20 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// TermFrame(Url('http://purl.obolibrary.org/obo/PATO_0000000')) #[pyfn(m, "load_graph")] fn load_graph(py: Python, fh: &PyAny) -> PyResult { - if let Ok(s) = fh.downcast_ref::() { + // Parse the source graph document. + let doc: GraphDocument = if let Ok(s) = fh.downcast_ref::() { let path = s.to_string()?; - match fastobo_graphs::from_file(path.as_ref()) { - Err(e) => Err(RuntimeError::py_err(format!("{}", e))), - Ok(doc) => { - let graph = doc.graphs.into_iter().next().unwrap(); - Ok(obo::OboDoc::from_graph(graph).into_py(py)) - } - } + fastobo_graphs::from_file(path.as_ref()) + .map_err(|e| RuntimeError::py_err(e.to_string()))? } else { match PyFile::from_object(fh.py(), fh) { // Object is a binary file-handle: attempt to parse the // document and return an `OboDoc` object. Ok(mut f) => { - match fastobo_graphs::from_reader(&mut f) { - Ok(doc) => { - let graph = doc.graphs.into_iter().next().unwrap(); - Ok(obo::OboDoc::from_graph(graph).into_py(py)) - } - Err(e) => f + fastobo_graphs::from_reader(&mut f) + .map_err(|e| f .into_err() - .unwrap_or_else(|| RuntimeError::py_err(format!("{}", e))) - .into(), - } + .unwrap_or_else(|| RuntimeError::py_err(e.to_string())))? } // Object is not a binary file-handle: wrap the inner error // into a `TypeError` and raise that error. @@ -254,10 +246,21 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { "__setattr__", ("__cause__".to_object(py), inner.to_object(py)), )?; - Err(PyErr::from_instance(err.as_ref(py).as_ref())) + return Err(PyErr::from_instance(err.as_ref(py).as_ref())); } } - } + }; + + // Convert the graph to an OBO document + let graph = doc.graphs.into_iter().next().unwrap(); + let mut doc = obo::OboDoc::from_graph(graph) + .map_err(|e| RuntimeError::py_err(e.to_string()))?; + + // Shrink IDs in OBO document + // fastobo::visit::IdCompactor::new().visit_doc(&mut doc); + + // Convert the OBO document to a Python handle + Ok(OboDoc::from_py(doc, py)) } Ok(()) From 819c10effd617f74352396126c3b06c273f3a10c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2019 07:41:07 +0000 Subject: [PATCH 10/17] Bump pyo3 from `cf8f63c` to `20534ec` (#23) --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1d5d78..3ca1bee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -526,7 +526,7 @@ dependencies = [ [[package]] name = "pyo3" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#cf8f63cacf0ac4029d18a572688f7e8b93fa32f6" +source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a06bc" 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)", @@ -545,7 +545,7 @@ dependencies = [ [[package]] name = "pyo3-derive-backend" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#cf8f63cacf0ac4029d18a572688f7e8b93fa32f6" +source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a06bc" 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)", @@ -555,7 +555,7 @@ dependencies = [ [[package]] name = "pyo3cls" version = "0.7.0" -source = "git+https://github.com/PyO3/pyo3#cf8f63cacf0ac4029d18a572688f7e8b93fa32f6" +source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a06bc" 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)", From 7b97051f13bc9ae6fd89d50704d61180923eb3dc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2019 08:40:06 +0000 Subject: [PATCH 11/17] Bump syn from 0.15.39 to 0.15.40 (#24) --- Cargo.lock | 38 +++++++++++++++++++------------------- derive/Cargo.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ca1bee..190ba0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -173,7 +173,7 @@ 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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -209,7 +209,7 @@ name = "fastobo-py-derive" version = "0.1.1" dependencies = [ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -241,7 +241,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -296,7 +296,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", "unindent 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -317,7 +317,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -440,7 +440,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -474,7 +474,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -507,7 +507,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -549,7 +549,7 @@ source = "git+https://github.com/PyO3/pyo3#20534ec22a58addcfa701393d02386f2617a0 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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -560,7 +560,7 @@ 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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -637,7 +637,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -700,12 +700,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "0.15.39" +version = "0.15.40" 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)", @@ -720,7 +720,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.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -931,7 +931,7 @@ dependencies = [ "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.39 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c" +"checksum syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)" = "bc945221ccf4a7e8c31222b9d1fc77aefdd6638eb901a6ce457a3dc29d4c31e8" "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" diff --git a/derive/Cargo.toml b/derive/Cargo.toml index ba2defa..d03cfae 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -11,5 +11,5 @@ proc-macro = true path = "lib.rs" [dependencies] -syn = "0.15.36" +syn = "0.15.40" quote = "0.6.13" From 038b6a4c521347a8fb7d21ba09438813b0d73a61 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Mon, 22 Jul 2019 13:13:51 +0000 Subject: [PATCH 12/17] Use `py` as argument in getters instead of acquiring the GIL manually --- src/py/doc.rs | 5 ++--- src/py/id.rs | 6 ++---- src/py/syn.rs | 3 +-- src/py/term/clause.rs | 9 +++------ src/py/typedef/clause.rs | 9 +++------ 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/py/doc.rs b/src/py/doc.rs index 418d5fa..57b10be 100644 --- a/src/py/doc.rs +++ b/src/py/doc.rs @@ -71,7 +71,7 @@ impl FromPy for EntityFrame { /// The abstract syntax tree corresponding to an OBO document. #[pyclass(subclass, module = "fastobo.doc")] -#[derive(Debug)] +#[derive(Debug, PyList)] pub struct OboDoc { header: Py, entities: Vec, @@ -124,8 +124,7 @@ impl FromPy for fastobo::ast::OboDoc { #[pymethods] impl OboDoc { #[getter] - fn get_header(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_header<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.header.clone_ref(py)) } diff --git a/src/py/id.rs b/src/py/id.rs index 24983c9..19e356f 100644 --- a/src/py/id.rs +++ b/src/py/id.rs @@ -273,8 +273,7 @@ impl PrefixedIdent { /// `~fastobo.id.IdentPrefix`: the IDspace of the identifier. #[getter] - fn get_prefix(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_prefix<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.prefix.clone_ref(py)) } @@ -296,8 +295,7 @@ impl PrefixedIdent { /// `~fastobo.id.IdentLocal`: the local part of the identifier. #[getter] - fn get_local(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_local<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.local.clone_ref(py)) } diff --git a/src/py/syn.rs b/src/py/syn.rs index 8fb4f18..5221684 100644 --- a/src/py/syn.rs +++ b/src/py/syn.rs @@ -201,8 +201,7 @@ impl Synonym { } #[getter] - pub fn get_xrefs(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + pub fn get_xrefs<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.xrefs.clone_ref(py)) } diff --git a/src/py/term/clause.rs b/src/py/term/clause.rs index 3f46b44..036d184 100644 --- a/src/py/term/clause.rs +++ b/src/py/term/clause.rs @@ -454,8 +454,7 @@ impl DefClause { #[getter] /// `~fastobo.xrefs.XrefList`: a list of xrefs supporting the definition. - fn get_xrefs(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_xrefs<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.xrefs.clone_py(py)) } } @@ -680,8 +679,7 @@ impl SynonymClause { #[getter] /// `~fastobo.syn.Synonym`: a possible synonym for this term. - fn get_synonym(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_synonym<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.synonym.clone_py(py)) } @@ -769,8 +767,7 @@ impl XrefClause { #[getter] /// `~fastobo.xref.Xref`: a cross-reference relevant to this term. - fn get_xref(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_xref<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.xref.clone_ref(py)) } diff --git a/src/py/typedef/clause.rs b/src/py/typedef/clause.rs index d505d57..67218bf 100644 --- a/src/py/typedef/clause.rs +++ b/src/py/typedef/clause.rs @@ -525,8 +525,7 @@ impl DefClause { #[getter] /// `~fastobo.xrefs.XrefList`: a list of xrefs supporting the definition. - fn get_xrefs(&self) -> PyResult { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_xrefs<'py>(&self, py: Python<'py>) -> PyResult { Ok(self.xrefs.clone_py(py)) } } @@ -749,8 +748,7 @@ impl SynonymClause { #[getter] /// `~fastobo.syn.Synonym`: a possible synonym for this term. - fn get_synonym(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_synonym<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.synonym.clone_py(py)) } @@ -839,8 +837,7 @@ impl XrefClause { } #[getter] - fn get_xref(&self) -> PyResult> { - let py = unsafe { Python::assume_gil_acquired() }; + fn get_xref<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.xref.clone_ref(py)) } From 824c2ed201e3f51e33d2f425e49019c3951b408c Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Mon, 22 Jul 2019 13:55:30 +0000 Subject: [PATCH 13/17] Bump dependencies in `Cargo.toml` and `Cargo.lock` --- Cargo.lock | 26 +++++++++++++------------- Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 190ba0a..7733f69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,7 @@ dependencies = [ [[package]] name = "fastobo-graphs" version = "0.1.0" -source = "git+https://github.com/fastobo/fastobo-graphs#4209f4d6bb0f6e873ef8800116d46ddf620f5919" +source = "git+https://github.com/fastobo/fastobo-graphs#25cc965b2cad2b019107105642b4a1487eee63b6" dependencies = [ "err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -453,7 +453,7 @@ name = "pest" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -534,7 +534,7 @@ 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.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", "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)", @@ -578,22 +578,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex" -version = "1.1.9" +version = "1.2.0" 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)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.10 (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.8" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -757,12 +757,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ucd-trie" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ucd-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -915,8 +915,8 @@ 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.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d9d8297cc20bbb6184f8b45ff61c8ee6a9ac56c156cec8e38c3e5084773c44ad" -"checksum regex-syntax 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9b01330cce219c1c6b2e209e5ed64ccd587ae5c67bed91c0b49eecf02ae40e21" +"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 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" @@ -937,8 +937,8 @@ dependencies = [ "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.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77" -"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" +"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" diff --git a/Cargo.toml b/Cargo.toml index fe28eea..2c35a7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,5 +25,5 @@ opaque_typedef = "0.0.5" opaque_typedef_macros = "0.0.5" fastobo = "0.5.0" -fastobo-graphs = { git = "https://github.com/fastobo/fastobo-graphs"} +fastobo-graphs = { git = "https://github.com/fastobo/fastobo-graphs" } fastobo-py-derive = { path = "./derive" } From 3f51db502e0fa83c20a4e982781f99a40e69c60e Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Mon, 22 Jul 2019 14:24:23 +0000 Subject: [PATCH 14/17] Prevent `fastobo` from crashing on instance frames --- src/py/doc.rs | 6 ++- src/py/instance/clause.rs | 0 src/py/instance/frame.rs | 99 +++++++++++++++++++++++++++++++++++++++ src/py/instance/mod.rs | 15 ++++++ src/py/mod.rs | 10 +++- 5 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 src/py/instance/clause.rs create mode 100644 src/py/instance/frame.rs diff --git a/src/py/doc.rs b/src/py/doc.rs index 57b10be..4d37b34 100644 --- a/src/py/doc.rs +++ b/src/py/doc.rs @@ -33,6 +33,7 @@ use super::abc::AbstractFrame; use super::header::frame::HeaderFrame; use super::term::frame::TermFrame; use super::typedef::frame::TypedefFrame; +use super::instance::frame::InstanceFrame; // --- Module export --------------------------------------------------------- @@ -50,6 +51,7 @@ fn module(_py: Python, m: &PyModule) -> PyResult<()> { pub enum EntityFrame { Term(Py), Typedef(Py), + Instance(Py), } impl FromPy for EntityFrame { @@ -61,7 +63,9 @@ impl FromPy for EntityFrame { fastobo::ast::EntityFrame::Typedef(frame) => { Py::new(py, TypedefFrame::from_py(frame, py)).map(EntityFrame::Typedef) } - _ => unimplemented!(), + fastobo::ast::EntityFrame::Instance(frame) => { + Py::new(py, InstanceFrame::from_py(frame, py)).map(EntityFrame::Instance) + }, } .expect("could not allocate on Python heap") } diff --git a/src/py/instance/clause.rs b/src/py/instance/clause.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/py/instance/frame.rs b/src/py/instance/frame.rs new file mode 100644 index 0000000..95c21e2 --- /dev/null +++ b/src/py/instance/frame.rs @@ -0,0 +1,99 @@ +use std::fmt::Display; +use std::fmt::Formatter; +use std::fmt::Result as FmtResult; +use std::fmt::Write; +use std::str::FromStr; + +use pyo3::exceptions::IndexError; +use pyo3::exceptions::TypeError; +use pyo3::exceptions::ValueError; +use pyo3::prelude::*; +use pyo3::types::PyAny; +use pyo3::types::PyIterator; +use pyo3::types::PyString; +use pyo3::AsPyPointer; +use pyo3::PyNativeType; +use pyo3::PyObjectProtocol; +use pyo3::PySequenceProtocol; +use pyo3::PyTypeInfo; + +use fastobo::ast; +use fastobo::share::Cow; +use fastobo::share::Redeem; +use fastobo::share::Share; + +use super::super::abc::AbstractEntityFrame; +use super::super::id::Ident; +use crate::utils::ClonePy; + +#[pyclass(extends=AbstractEntityFrame, module="fastobo.instance")] +// #[derive(Debug, PyList)] +#[derive(Debug)] +pub struct InstanceFrame { + id: Ident, + //clauses: Vec, +} + +impl InstanceFrame { + pub fn new(id: Ident) -> Self { + // Self::with_clauses(id, Vec::new()) + Self { id } + } + + // pub fn with_clauses(id: Ident, clauses: Vec) -> Self { + // Self { id, clauses } + // } +} + +impl ClonePy for InstanceFrame { + fn clone_py(&self, py: Python) -> Self { + Self { + id: self.id.clone_py(py), + // clauses: self.clauses.clone_py(py), + } + } +} + +impl Display for InstanceFrame { + fn fmt(&self, f: &mut Formatter) -> FmtResult { + let gil = Python::acquire_gil(); + let py = gil.python(); + fastobo::ast::InstanceFrame::from_py(self.clone_py(py), py).fmt(f) + } +} + +impl FromPy for InstanceFrame { + fn from_py(frame: fastobo::ast::InstanceFrame, py: Python) -> Self { + // Self::with_clauses( + // Ident::from_py(frame.id().as_ref().clone(), py), + // frame + // .into_iter() + // .map(|line| TypedefClause::from_py(line.into_inner(), py)) + // .collect(), + // ) + Self::new(Ident::from_py(frame.id().as_ref().clone(), py)) + } +} + +impl FromPy for fastobo::ast::InstanceFrame { + fn from_py(frame: InstanceFrame, py: Python) -> Self { + // fastobo::ast::InstanceFrame::with_clauses( + // fastobo::ast::InstanceIdent::new(frame.id.into_py(py)), + // frame + // .clauses + // .iter() + // .map(|f| fastobo::ast::InstanceClause::from_py(f, py)) + // .map(fastobo::ast::Line::from) + // .collect(), + // ) + fastobo::ast::InstanceFrame::new( + fastobo::ast::InstanceIdent::new(frame.id.into_py(py)) + ) + } +} + +impl FromPy for fastobo::ast::EntityFrame { + fn from_py(frame: InstanceFrame, py: Python) -> Self { + Self::from(fastobo::ast::InstanceFrame::from_py(frame, py)) + } +} diff --git a/src/py/instance/mod.rs b/src/py/instance/mod.rs index e69de29..e9e4f87 100644 --- a/src/py/instance/mod.rs +++ b/src/py/instance/mod.rs @@ -0,0 +1,15 @@ +pub mod clause; +pub mod frame; + +use pyo3::prelude::*; + +#[pymodule(instance)] +pub fn module(py: Python, m: &PyModule) -> PyResult<()> { + m.add_class::()?; + + register!(py, m, InstanceFrame, "collections.abc", MutableSequence); + + m.add("__name__", "fastobo.instance")?; + + Ok(()) +} diff --git a/src/py/mod.rs b/src/py/mod.rs index cbf20a2..df834bb 100644 --- a/src/py/mod.rs +++ b/src/py/mod.rs @@ -41,6 +41,7 @@ pub mod abc; pub mod doc; pub mod header; pub mod id; +pub mod instance; pub mod pv; pub mod syn; pub mod term; @@ -61,6 +62,7 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { use self::doc::PyInit_doc; use self::header::PyInit_header; use self::id::PyInit_id; + use self::instance::PyInit_instance; use self::pv::PyInit_pv; use self::syn::PyInit_syn; use self::term::PyInit_term; @@ -74,6 +76,7 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { add_submodule!(py, m, doc); add_submodule!(py, m, header); add_submodule!(py, m, id); + add_submodule!(py, m, instance); add_submodule!(py, m, pv); add_submodule!(py, m, syn); add_submodule!(py, m, term); @@ -192,7 +195,9 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// load_graph(fh) /// -- /// - /// Load an OBO graph from the given path or file handle. + /// Load an OBO graph from the given path or file handle. Both JSON and + /// YAML formats are supported. *Actually, since YAML is a superset of + /// JSON, all graphs are in YAML format...* /// /// Arguments: /// fh (str or file-handle): the path to an OBO graph file, or a @@ -202,7 +207,8 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// /// Returns: /// `~fastobo.doc.OboDoc`: the first graph of the OBO graph - /// converted to an OBO document. + /// converted to an OBO document. The schema allows for more than + /// one graph but this is never really used. /// /// Raises: /// TypeError: when the argument is not a `str` or a binary stream. From a9fee115107378750ff2edea7de647df199a539b Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Mon, 22 Jul 2019 15:19:50 +0000 Subject: [PATCH 15/17] Add Rust-backed methods to compact and decompact IDs in an `OboDoc` --- src/py/doc.rs | 69 +++++++++++++++++++++++++++++++++++++++++- src/py/mod.rs | 21 ++++++++----- tests/test_doctests.py | 2 ++ 3 files changed, 83 insertions(+), 9 deletions(-) diff --git a/src/py/doc.rs b/src/py/doc.rs index 4d37b34..edea876 100644 --- a/src/py/doc.rs +++ b/src/py/doc.rs @@ -23,6 +23,7 @@ use pyo3::PySequenceProtocol; use pyo3::PyTypeInfo; use fastobo::ast as obo; +use fastobo::visit::VisitMut; use crate::error::Error; use crate::pyfile::PyFile; @@ -64,7 +65,7 @@ impl FromPy for EntityFrame { Py::new(py, TypedefFrame::from_py(frame, py)).map(EntityFrame::Typedef) } fastobo::ast::EntityFrame::Instance(frame) => { - Py::new(py, InstanceFrame::from_py(frame, py)).map(EntityFrame::Instance) + Py::new(py, InstanceFrame::from_py(frame, py)).map(EntityFrame::Instance) }, } .expect("could not allocate on Python heap") @@ -127,6 +128,7 @@ impl FromPy for fastobo::ast::OboDoc { #[pymethods] impl OboDoc { + /// `~fastobo.header.HeaderFrame`: the header containing ontology metadata. #[getter] fn get_header<'py>(&self, py: Python<'py>) -> PyResult> { Ok(self.header.clone_ref(py)) @@ -138,6 +140,71 @@ impl OboDoc { self.header = Py::new(py, header.clone_py(py))?; Ok(()) } + + /// compact_ids(self, /) + /// -- + /// + /// Create a semantically equivalent OBO document with compact identifiers. + /// + /// The OBO specification describes how to perform an URI decompaction + /// using either ID spaces declared in the document header, builtin ID + /// spaces, or a default rule using the `purl.obolibrary.org` domain. + /// By applying the reverse operation, a new ontology can be created with + /// compact identifiers. Some URLs may not have a compact representation + /// if they don't correspond to any decompaction rule. + /// + /// Example: + /// >>> doc = fastobo.loads(textwrap.dedent( + /// ... """ + /// ... idspace: MassBank http://www.massbank.jp/jsp/FwdRecord.jsp?id= + /// ... + /// ... [Term] + /// ... id: http://purl.obolibrary.org/obo/CHEBI_27958 + /// ... xref: http://www.massbank.jp/jsp/FwdRecord.jsp?id=EA281701 + /// ... """ + /// ... )) + /// >>> compact_doc = doc.compact_ids() + /// >>> print(compact_doc[0]) + /// [Term] + /// id: CHEBI:27958 + /// xref: MassBank:EA281701 + /// + /// + fn compact_ids(&self) -> PyResult { + let py = unsafe { Python::assume_gil_acquired() }; + let mut doc = obo::OboDoc::from_py(self.clone_py(py), py); + fastobo::visit::IdCompactor::new().visit_doc(&mut doc); + Ok(doc.into_py(py)) + } + + /// decompact_ids(self, /) + /// -- + /// + /// Create a semantically equivalent OBO document with IRI identifiers. + /// + /// Example: + /// >>> doc = fastobo.loads(textwrap.dedent( + /// ... """ + /// ... idspace: MassBank http://www.massbank.jp/jsp/FwdRecord.jsp?id= + /// ... + /// ... [Term] + /// ... id: CHEBI:27958 + /// ... xref: MassBank:EA281701 + /// ... """ + /// ... )) + /// >>> url_doc = doc.decompact_ids() + /// >>> print(url_doc[0]) + /// [Term] + /// id: http://purl.obolibrary.org/obo/CHEBI_27958 + /// xref: http://www.massbank.jp/jsp/FwdRecord.jsp?id=EA281701 + /// + /// + fn decompact_ids(&self) -> PyResult { + let py = unsafe { Python::assume_gil_acquired() }; + let mut doc = obo::OboDoc::from_py(self.clone_py(py), py); + fastobo::visit::IdDecompactor::new().visit_doc(&mut doc); + Ok(doc.into_py(py)) + } } #[pyproto] diff --git a/src/py/mod.rs b/src/py/mod.rs index df834bb..05f61cc 100644 --- a/src/py/mod.rs +++ b/src/py/mod.rs @@ -112,6 +112,7 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// >>> doc = fastobo.load(urlopen(url)) /// >>> doc.header[2] /// OntologyClause('cmo.obo') + /// #[pyfn(m, "load")] fn load(py: Python, fh: &PyAny) -> PyResult { if let Ok(s) = fh.downcast_ref::() { @@ -171,7 +172,6 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// Use ``fastobo.loads`` to deserialize a literal OBO frame into the /// corresponding syntax tree: /// - /// >>> import textwrap /// >>> doc = fastobo.loads(textwrap.dedent( /// ... """ /// ... [Term] @@ -195,9 +195,10 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// load_graph(fh) /// -- /// - /// Load an OBO graph from the given path or file handle. Both JSON and - /// YAML formats are supported. *Actually, since YAML is a superset of - /// JSON, all graphs are in YAML format...* + /// Load an OBO graph from the given path or file handle. + /// + /// Both JSON and YAML formats are supported. *Actually, since YAML is a + /// superset of JSON, all graphs are in YAML format.* /// /// Arguments: /// fh (str or file-handle): the path to an OBO graph file, or a @@ -225,6 +226,13 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { /// >>> doc = fastobo.load_graph(urlopen(url)) /// >>> doc[4] /// 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. + /// #[pyfn(m, "load_graph")] fn load_graph(py: Python, fh: &PyAny) -> PyResult { // Parse the source graph document. @@ -259,12 +267,9 @@ fn fastobo(py: Python, m: &PyModule) -> PyResult<()> { // Convert the graph to an OBO document let graph = doc.graphs.into_iter().next().unwrap(); - let mut doc = obo::OboDoc::from_graph(graph) + let doc = obo::OboDoc::from_graph(graph) .map_err(|e| RuntimeError::py_err(e.to_string()))?; - // Shrink IDs in OBO document - // fastobo::visit::IdCompactor::new().visit_doc(&mut doc); - // Convert the OBO document to a Python handle Ok(OboDoc::from_py(doc, py)) } diff --git a/tests/test_doctests.py b/tests/test_doctests.py index d952027..9731721 100644 --- a/tests/test_doctests.py +++ b/tests/test_doctests.py @@ -8,6 +8,7 @@ import doctest import warnings import pprint +import textwrap import types import fastobo @@ -40,6 +41,7 @@ def load_tests(loader, tests, ignore): globs = { "fastobo": fastobo, "datetime": datetime, + "textwrap": textwrap, "pprint": pprint.pprint, "ms": fastobo.load(os.path.realpath( os.path.join(__file__, "..", "data", "ms.obo") From fdf4293084c285c73ce89164f3f2ffbb81163960 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Mon, 22 Jul 2019 15:38:26 +0000 Subject: [PATCH 16/17] Improve docstrings and prevent `napoleon` to use `rtype` in sphinx docs --- docs/api/index.rst | 2 ++ docs/conf.py | 1 + src/py/doc.rs | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/docs/api/index.rst b/docs/api/index.rst index 58e10bf..37741ed 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -27,6 +27,8 @@ Functions .. autofunction:: fastobo.loads +.. autofunction:: fastobo.load_graph + Data structures ^^^^^^^^^^^^^^^ diff --git a/docs/conf.py b/docs/conf.py index 9887576..710fcb7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -191,6 +191,7 @@ def inspector(app, what, name, obj, options, signature, return_annotation): napoleon_use_admonition_for_examples = True napoleon_use_admonition_for_notes = True napoleon_use_admonition_for_references = True +napoleon_use_rtype = False # -- Options for autodoc extension ------------------------------------------- diff --git a/src/py/doc.rs b/src/py/doc.rs index edea876..d04b27b 100644 --- a/src/py/doc.rs +++ b/src/py/doc.rs @@ -170,6 +170,11 @@ impl OboDoc { /// xref: MassBank:EA281701 /// /// + /// See Also: + /// The `Translation of Identifiers + /// `_ + /// section of the OBO format version 1.4 specification. + /// fn compact_ids(&self) -> PyResult { let py = unsafe { Python::assume_gil_acquired() }; let mut doc = obo::OboDoc::from_py(self.clone_py(py), py); @@ -182,6 +187,10 @@ impl OboDoc { /// /// Create a semantically equivalent OBO document with IRI identifiers. /// + /// The OBO specification describes how to perform an URI decompaction + /// using either ID spaces declared in the document header, builtin ID + /// spaces, or a default rule using the `purl.obolibrary.org` domain. + /// /// Example: /// >>> doc = fastobo.loads(textwrap.dedent( /// ... """ @@ -199,6 +208,11 @@ impl OboDoc { /// xref: http://www.massbank.jp/jsp/FwdRecord.jsp?id=EA281701 /// /// + /// See Also: + /// The `Translation of Identifiers + /// `_ + /// section of the OBO format version 1.4 specification. + /// fn decompact_ids(&self) -> PyResult { let py = unsafe { Python::assume_gil_acquired() }; let mut doc = obo::OboDoc::from_py(self.clone_py(py), py); From 6bae2bd732a827afd4d2d6969018f958c8238dd2 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Mon, 22 Jul 2019 15:53:50 +0000 Subject: [PATCH 17/17] Release v0.2.0 --- CHANGELOG.md | 19 ++++++++++++++++--- Cargo.lock | 6 +++--- Cargo.toml | 2 +- derive/Cargo.toml | 2 +- setup.cfg | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f9984..2ca7d75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -[Unreleased]: https://github.com/fastobo/fastobo-py/compare/v0.1.1...HEAD +[Unreleased]: https://github.com/fastobo/fastobo-py/compare/v0.2.0...HEAD + + +## [0.2.0] - 2019-07-22 + +[0.2.0]: https://github.com/fastobo/fastobo/compare/v0.1.1...v0.2.0 + +### Changed +- Updated to `fastobo` [v0.5.0](https://github.com/fastobo/fastobo/blob/master/CHANGELOG.md). + +### Added +- Support for OBO graph deserialization using `fastobo-graphs`. +- Limited support for instance frames in `fastobo.instance` module. +- Methods `OboDoc.compact_ids` and `OboDoc.decompact_ids` to create semantically + equivalent OBO document with compacted/decompacted identifiers. ## [0.1.1] - 2019-06-28 -[0.1.1]: https://github.com/fastobo/fastobo/compare/v0.1.1...v0.1.0 +[0.1.1]: https://github.com/fastobo/fastobo/compare/v0.1.0...v0.1.1 ### Fixed - PyPI release not being uploaded because of older development release. @@ -23,4 +37,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [0.1.0]: https://github.com/fastobo/fastobo/compare/77dd00c...v0.1.0 Initial release. - diff --git a/Cargo.lock b/Cargo.lock index 7733f69..54716fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,12 +190,12 @@ dependencies = [ [[package]] name = "fastobo-py" -version = "0.1.1" +version = "0.2.0" dependencies = [ "built 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "fastobo-graphs 0.1.0 (git+https://github.com/fastobo/fastobo-graphs)", - "fastobo-py-derive 0.1.1", + "fastobo-py-derive 0.2.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)", @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "fastobo-py-derive" -version = "0.1.1" +version = "0.2.0" dependencies = [ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 2c35a7a..8fa426e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["derive"] [package] name = "fastobo-py" -version = "0.1.1" +version = "0.2.0" authors = ["Martin Larralde "] publish = false build = "src/build.rs" diff --git a/derive/Cargo.toml b/derive/Cargo.toml index d03cfae..c4529f3 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastobo-py-derive" -version = "0.1.1" +version = "0.2.0" authors = ["Martin Larralde "] edition = "2018" publish = false diff --git a/setup.cfg b/setup.cfg index 4053f90..e5cb150 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = fastobo -version = 0.1.1 +version = 0.2.0 author = Martin Larralde author-email = martin.larralde@ens-paris-saclay.fr home-page = https://github.com/fastobo/fastobo-py