@@ -429,9 +429,9 @@ pub enum RequirementSource {
429429 /// The absolute path to the distribution which we use for installing.
430430 install_path : Box < Path > ,
431431 /// For a source tree (a directory), whether to install as an editable.
432- editable : bool ,
432+ editable : Option < bool > ,
433433 /// For a source tree (a directory), whether the project should be built and installed.
434- r#virtual : bool ,
434+ r#virtual : Option < bool > ,
435435 /// The PEP 508 style URL in the format
436436 /// `file:///<path>#subdirectory=<subdirectory>`.
437437 url : VerbatimUrl ,
@@ -545,7 +545,13 @@ impl RequirementSource {
545545
546546 /// Returns `true` if the source is editable.
547547 pub fn is_editable ( & self ) -> bool {
548- matches ! ( self , Self :: Directory { editable: true , .. } )
548+ matches ! (
549+ self ,
550+ Self :: Directory {
551+ editable: Some ( true ) ,
552+ ..
553+ }
554+ )
549555 }
550556
551557 /// Returns `true` if the source is empty.
@@ -792,11 +798,11 @@ impl From<RequirementSource> for RequirementSourceWire {
792798 r#virtual,
793799 url : _,
794800 } => {
795- if editable {
801+ if editable. unwrap_or ( false ) {
796802 Self :: Editable {
797803 editable : PortablePathBuf :: from ( install_path) ,
798804 }
799- } else if r#virtual {
805+ } else if r#virtual. unwrap_or ( false ) {
800806 Self :: Virtual {
801807 r#virtual : PortablePathBuf :: from ( install_path) ,
802808 }
@@ -908,8 +914,8 @@ impl TryFrom<RequirementSourceWire> for RequirementSource {
908914 ) ) ?;
909915 Ok ( Self :: Directory {
910916 install_path : directory,
911- editable : false ,
912- r#virtual : false ,
917+ editable : Some ( false ) ,
918+ r#virtual : Some ( false ) ,
913919 url,
914920 } )
915921 }
@@ -920,8 +926,8 @@ impl TryFrom<RequirementSourceWire> for RequirementSource {
920926 ) ) ?;
921927 Ok ( Self :: Directory {
922928 install_path : editable,
923- editable : true ,
924- r#virtual : false ,
929+ editable : Some ( true ) ,
930+ r#virtual : Some ( false ) ,
925931 url,
926932 } )
927933 }
@@ -932,8 +938,8 @@ impl TryFrom<RequirementSourceWire> for RequirementSource {
932938 ) ) ?;
933939 Ok ( Self :: Directory {
934940 install_path : r#virtual,
935- editable : false ,
936- r#virtual : true ,
941+ editable : Some ( false ) ,
942+ r#virtual : Some ( true ) ,
937943 url,
938944 } )
939945 }
@@ -980,8 +986,8 @@ mod tests {
980986 marker : MarkerTree :: TRUE ,
981987 source : RequirementSource :: Directory {
982988 install_path : PathBuf :: from ( path) . into_boxed_path ( ) ,
983- editable : false ,
984- r#virtual : false ,
989+ editable : Some ( false ) ,
990+ r#virtual : Some ( false ) ,
985991 url : VerbatimUrl :: from_absolute_path ( path) . unwrap ( ) ,
986992 } ,
987993 origin : None ,
0 commit comments