parameters: (self)
docstring: This method makes some assumptions about the state of the project and
          its cargo dependendies:
          1. Crates from cargo dependencies can be extracted from Cargo.toml files
             using _extract_crates function. It is using a heuristic so check its
             code to understand how it is done.
          2. The extracted cargo dependencies crates can be found in the
             dependency's install dir using _resolve_crate_to_path function
             which again is using a heuristic.
  
          Notice that many things might go wrong here. E.g. if someone depends
          on another getdeps crate by writing in their Cargo.toml file:
  
              my-rename-of-crate = { package = "crate", git = "..." }
  
          they can count themselves lucky because the code will raise an
          Exception. There migh be more cases where the code will silently pass
          producing bad results.
docstring_summary: This method makes some assumptions about the state of the project and
          its cargo dependendies:
          1. Crates from cargo dependencies can be extracted from Cargo.toml files
             using _extract_crates function. It is using a heuristic so check its
             code to understand how it is done.
          2. The extracted cargo dependencies crates can be found in the
             dependency's install dir using _resolve_crate_to_path function
             which again is using a heuristic.
docstring_tokens: This method makes some assumptions about the state of the project and its cargo dependendies : 1 . Crates from cargo dependencies can be extracted from Cargo . toml files using _extract_crates function . It is using a heuristic so check its code to understand how it is done . 2 . The extracted cargo dependencies crates can be found in the dependency s install dir using _resolve_crate_to_path function which again is using a heuristic .
function: def _patchup_workspace(self):
          """
          This method makes some assumptions about the state of the project and
          its cargo dependendies:
          1. Crates from cargo dependencies can be extracted from Cargo.toml files
             using _extract_crates function. It is using a heuristic so check its
             code to understand how it is done.
          2. The extracted cargo dependencies crates can be found in the
             dependency's install dir using _resolve_crate_to_path function
             which again is using a heuristic.
  
          Notice that many things might go wrong here. E.g. if someone depends
          on another getdeps crate by writing in their Cargo.toml file:
  
              my-rename-of-crate = { package = "crate", git = "..." }
  
          they can count themselves lucky because the code will raise an
          Exception. There migh be more cases where the code will silently pass
          producing bad results.
          """
          workspace_dir = self.workspace_dir()
          config = self._resolve_config()
          if config:
              with open(os.path.join(workspace_dir, "Cargo.toml"), "r+") as f:
                  manifest_content = f.read()
                  if "[package]" not in manifest_content:
                      # A fake manifest has to be crated to change the virtual
                      # manifest into a non-virtual. The virtual manifests are limited
                      # in many ways and the inability to define patches on them is
                      # one. Check https://github.com/rust-lang/cargo/issues/4934 to
                      # see if it is resolved.
                      f.write(
                          """
      [package]
      name = "fake_manifest_of_{}"
      version = "0.0.0"
      [lib]
      path = "/dev/null"
      """.format(
                              self.manifest.name
                          )
                      )
                  else:
                      f.write("\n")
                  f.write(config)
function_tokens: def _patchup_workspace ( self ) : workspace_dir = self . workspace_dir ( ) config = self . _resolve_config ( ) if config : with open ( os . path . join ( workspace_dir , "Cargo.toml" ) , "r+" ) as f : manifest_content = f . read ( ) if "[package]" not in manifest_content : # A fake manifest has to be crated to change the virtual # manifest into a non-virtual. The virtual manifests are limited # in many ways and the inability to define patches on them is # one. Check https://github.com/rust-lang/cargo/issues/4934 to # see if it is resolved. f . write ( """
      [package]
      name = "fake_manifest_of_{}"
      version = "0.0.0"
      [lib]
      path = "/dev/null"
      """ . format ( self . manifest . name ) ) else : f . write ( "\n" ) f . write ( config )