Skip to content
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

add positron.r.interpreters.exclude setting to exclude R installation paths #6472

Merged
merged 6 commits into from
Feb 26, 2025

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Feb 25, 2025

Summary

  • addresses R: configure inclusion/exclusion of runtimes #6205
  • adds a new setting positron.r.interpreters.exclude which allows the user to specify R installation binary paths or directories containing R installations that should be excluded from the UI in Positron

Settings UI

image

Settings JSON

    "positron.r.interpreters.exclude": [
        "/opt/local"
    ]

R Language Pack Output

...
2025-02-25 10:11:26.178 [info] User-specified R binaries:
[
  "/opt/local/R/4.3-arm64/Resources/bin/R"
]
...
2025-02-25 10:11:26.178 [info] Candidate R binary at /opt/local/R/4.3-arm64/Resources/bin/R
2025-02-25 10:11:26.178 [info] User-specified R installation paths to exclude:
[
  "/opt/local"
]
2025-02-25 10:11:26.178 [info] User has excluded R installation at /opt/local/R/4.3-arm64/Resources/bin/R
2025-02-25 10:11:26.178 [info] R installation discovered: {
  "usable": false,
  "supported": true,
  "reasonDiscovered": [
    "User-specified location",
    "Found in a conventional location for R binaries installed on a server"
  ],
  "reasonRejected": "Installation path was excluded via settings",
  "binpath": "/opt/local/R/4.3-arm64/Resources/bin/R",
  "homepath": "/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.3.3",
    "major": 4,
    "minor": 3,
    "patch": 3,
    "prerelease": [],
    "build": [],
    "version": "4.3.3"
  },
  "version": "4.3.3",
  "arch": "arm64",
  "current": false,
  "orthogonal": true
}
...
2025-02-25 10:11:26.178 [info] Filtering out /opt/local/R/4.3-arm64/Resources/bin/R, reason: Installation path was excluded via settings.
2025-02-25 10:11:26.178 [warning] Some discovered R installations are unusable by Positron.
2025-02-25 10:11:26.178 [warning] Learn more about R discovery at https://positron.posit.co/r-installations

Release Notes

New Features

Bug Fixes

  • N/A

QA Notes

  • please test with and without the positron.r.customBinaries and positron.r.customRootFolders settings which allow "includes" to be specified
  • Positron will need to be restarted upon changing the settings so that discovery can re-run with the settings applied
  • excluding interpreters via positron.r.interpreters.exclude will take precedence over includes with positron.r.customBinaries or positron.r.customRootFolders
  • Relative paths specified in the options are ignored

Copy link

github-actions bot commented Feb 25, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

@sharon-wang sharon-wang changed the title add positron.r.customExcludes setting to exclude R installation paths add positron.r.interpreters.exclude setting to exclude R installation paths Feb 26, 2025
jennybc
jennybc previously approved these changes Feb 26, 2025
Copy link
Member

@jennybc jennybc left a comment

Choose a reason for hiding this comment

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

LGTM

I didn't delve deeply into the implementation, since it looks like the path utilities are ported from elsewhere. Mostly just some comments on naming and describing things.

Copy link
Contributor

@melissa-barca melissa-barca left a comment

Choose a reason for hiding this comment

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

LGTM!

@sharon-wang
Copy link
Member Author

sharon-wang commented Feb 26, 2025

MacOS CI issues will be resolved in #6496.

@sharon-wang sharon-wang merged commit 2a5c332 into main Feb 26, 2025
18 of 28 checks passed
@sharon-wang sharon-wang deleted the feature/exclude-r-installations branch February 26, 2025 21:58
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2025
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 this pull request may close these issues.

3 participants