File tree Expand file tree Collapse file tree 5 files changed +19
-9
lines changed
Expand file tree Collapse file tree 5 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,9 @@ keyring = "0.8.0"
2626log = " 0.4"
2727openssl = " 0.10.26"
2828rand = " 0.7.2"
29- serde = " 1.0.104"
30- serde_derive = " 1.0.104"
29+ serde = { version = " 1.0.104" , features = [" derive" ] }
3130serde_json = " 1.0.44"
32- pyo3 = " 0.8.5"
31+ pyo3 = { version = " 0.8.5" , optional = true }
3332toml = " 0.5.5"
3433escaper = " 0.1.0"
3534
@@ -40,3 +39,6 @@ features = ["sqlite"]
4039[dependencies .reqwest ]
4140version = " 0.10.3"
4241features = [" blocking" , " gzip" , " json" ]
42+
43+ [features ]
44+ pym = [" pyo3" ]
Original file line number Diff line number Diff line change @@ -132,9 +132,12 @@ impl Command for ListCommand {
132132
133133 // filtering...
134134 // pym scripts
135- if m. is_present ( "plan" ) {
136- let ids = crate :: pym:: exec ( m. value_of ( "plan" ) . unwrap_or ( "" ) ) ?;
137- crate :: helper:: squash ( & mut ps, ids) ?;
135+ #[ cfg( feature = "pym" ) ]
136+ {
137+ if m. is_present ( "plan" ) {
138+ let ids = crate :: pym:: exec ( m. value_of ( "plan" ) . unwrap_or ( "" ) ) ?;
139+ crate :: helper:: squash ( & mut ps, ids) ?;
140+ }
138141 }
139142
140143 // filter tag
Original file line number Diff line number Diff line change @@ -78,9 +78,12 @@ impl Command for PickCommand {
7878
7979 // filtering...
8080 // pym scripts
81- if m. is_present ( "plan" ) {
82- let ids = crate :: pym:: exec ( m. value_of ( "plan" ) . unwrap_or ( "" ) ) ?;
83- crate :: helper:: squash ( & mut problems, ids) ?;
81+ #[ cfg( feature = "pym" ) ]
82+ {
83+ if m. is_present ( "plan" ) {
84+ let ids = crate :: pym:: exec ( m. value_of ( "plan" ) . unwrap_or ( "" ) ) ?;
85+ crate :: helper:: squash ( & mut problems, ids) ?;
86+ }
8487 }
8588
8689 // tag filter
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ impl std::convert::From<openssl::error::ErrorStack> for Error {
124124}
125125
126126// pyo3
127+ #[ cfg( feature = "pym" ) ]
127128impl std:: convert:: From < pyo3:: PyErr > for Error {
128129 fn from ( _: pyo3:: PyErr ) -> Self {
129130 Error :: ScriptError ( "Python script went Error" . to_string ( ) )
Original file line number Diff line number Diff line change @@ -252,6 +252,7 @@ pub mod err;
252252pub mod flag;
253253pub mod helper;
254254pub mod plugins;
255+ #[ cfg( feature = "pym" ) ]
255256pub mod pym;
256257
257258// re-exports
You can’t perform that action at this time.
0 commit comments