Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

dmenv tidy does not work from inside a virtualenv #110

Closed
dmerejkowsky opened this issue Oct 29, 2019 · 0 comments · Fixed by #114
Closed

dmenv tidy does not work from inside a virtualenv #110

dmerejkowsky opened this issue Oct 29, 2019 · 0 comments · Fixed by #114

Comments

@dmerejkowsky
Copy link
Owner

Here's what happens:

$ dmenv install
$ source $(dmenv show:venv_path)/bin/activate
$ dmenv tidy
Cleaning virtualenv ...
Recreate virtualenv ...
Error: /path/to/venv/python does not exist

The problem is that we read PythonInfo only once, and that info becomes obsolete between the clean and the virtualenv recreation...

impl Project {
    pub new(python_info: PythonInfo) -> Self {
      // ...
    } 
    
pub fn tidy(&self) -> Result<(), Error> {
        self.clean_venv()?;
        // Data in self.python_info is now out of date!
        self.create_venv()?;
   }
}
dmerejkowsky added a commit that referenced this issue Nov 6, 2019
Goal: get rid of the Project struct altogether and fix #110 properly.

First step:

 * Extract a Context struct to hold paths, venv_runner and python_info


This commit does that for the `install` and `process_scripts` methods
dmerejkowsky added a commit that referenced this issue Nov 6, 2019
Goal: get rid of the Project struct altogether and fix #110 properly.

This commit implements the first step by extracting a Context struct to hold
paths, venv_runner and python_info
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant