Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add tests for virtualenvwrapper, pyenv-virtuaenv, conda and a fixes #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Jun 7, 2024

Conversation

DonJayamanne
Copy link
Collaborator

@DonJayamanne DonJayamanne commented Jun 6, 2024

A lot of fixes/tweeks as a result of the tests finding issues.

@@ -117,6 +117,10 @@ pub fn get_environments(conda_dir: &Path) -> Vec<PathBuf> {
.collect(),
);
}
// Then read the .condarc in the conda install folder as well.
if let Some(mut conda_rc) = Condarc::from_path(conda_dir) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this earlier

}

/// Find the conda binary on the system
pub fn find_conda_binary(env_vars: &EnvVariables) -> Option<PathBuf> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required (old code)

if let Some(filename) = &env.prefix {
name = filename.to_str().map(|f| f.to_string());
if let Some(prefix) = &env.prefix {
if let Some(filename) = prefix.file_name() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix

.into_values()
.collect::<Vec<_>>();

assert!(
Copy link
Collaborator Author

@DonJayamanne DonJayamanne Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more tests, and fixed issues found while adding this test


assert!(
environments.iter().any(
|env| env.category == PythonEnvironmentCategory::PyenvVirtualEnv
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more tests, and fixed issues found while adding this test

let program_data = env_vars.programdata.clone().unwrap_or_default();
let all_user_profile = env_vars.allusersprofile.clone().unwrap_or_default();
let home_drive = env_vars.homedrive.clone().unwrap_or_default();
let mut known_paths = vec![
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary, duplicate code removed

@DonJayamanne DonJayamanne changed the title Create virtual env wrapper env Add tests for virtualenvwrapper, pyenv-virtuaenv, conda and a fixes Jun 7, 2024
@DonJayamanne DonJayamanne marked this pull request as ready for review June 7, 2024 00:29
@DonJayamanne DonJayamanne enabled auto-merge (squash) June 7, 2024 00:29
@DonJayamanne DonJayamanne merged commit e90258a into main Jun 7, 2024
24 checks passed
@DonJayamanne DonJayamanne deleted the moreTestsVenv branch June 7, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants