Skip to content

Commit

Permalink
Merge branch 'main' into feature/list-command
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko authored Jan 20, 2024
2 parents 9f9267a + 17bb62f commit 3eeab50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ _Unreleased_
out the dependencies. Today the only option is the `--installed-deps` option on
the `show` command which spits out dependencies in the format of the lockfile. #543

- The installer will no longer attempt to symlink targets which are not valid
executables on the platform. This works around some issues with Packages that
would prevent to install such as `changedetection.io`. #542

<!-- released start -->

## 0.17.0
Expand Down
16 changes: 15 additions & 1 deletion rye/src/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ use crate::platform::get_app_dir;
use crate::pyproject::{normalize_package_name, ExpandedSources};
use crate::sources::PythonVersionRequest;
use crate::sync::create_virtualenv;
use crate::utils::{get_short_executable_name, get_venv_python_bin, symlink_file, CommandOutput};
use crate::utils::{
get_short_executable_name, get_venv_python_bin, is_executable, symlink_file, CommandOutput,
};

const FIND_SCRIPT_SCRIPT: &str = r#"
import os
Expand Down Expand Up @@ -253,6 +255,18 @@ fn install_scripts(
let mut rv = Vec::new();
for file in files {
if let Ok(rest) = file.strip_prefix(target_venv_bin_path) {
// In some cases we are given paths here which point to sub-folders of the
// script/bin folder. For instance in some cases it has been shown that
// __pycache__/something.pyc shows up there. These are obviously not good
// targets to link as they would never show up via PATH discovery. Skip
// over these.
//
// Also do not try to link things which are not considered executables on
// this operating system.
if !rest.parent().map_or(true, |x| x == Path::new("")) || !is_executable(file) {
continue;
}

let shim_target = shim_dir.join(rest);

// on windows we want to fall back to hardlinks. That might be problematic in
Expand Down

0 comments on commit 3eeab50

Please sign in to comment.