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.customExcludes setting to exclude R installation paths #6472

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sharon-wang
Copy link
Member

Summary

  • addresses R: configure inclusion/exclusion of runtimes #6205
  • adds a new setting positron.r.customExcludes 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.customExcludes": [
        "/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.customExcludes will take precedence over includes with positron.r.customBinaries or positron.r.customRootFolders
  • Relative paths specified in the options are ignored

Copy link

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

readme  valid tags

@@ -203,6 +203,15 @@
"default": [],
"markdownDescription": "%r.configuration.customBinaries.markdownDescription%"
},
"positron.r.customExcludes": {
Copy link
Member Author

@sharon-wang sharon-wang Feb 25, 2025

Choose a reason for hiding this comment

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

Instead of positron.r.interpreters.exclude, which would be more consistent with the python settings, I opted for more alignment with the existing R settings positron.r.customRootFolders and positron.r.customBinaries. However, I'm not sure if positron.r.customExcludes is descriptive enough.

There will be another setting to override the list of interpreters (#6206)...similarly positron.r.customOverrides doesn't feel descriptive enough.

If anyone has opinions about this, happy to change the setting name!

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer keeping the naming in line with python, "custom" seems to imply the presence of standard excludes which doesn't really make sense?

@@ -203,6 +203,15 @@
"default": [],
"markdownDescription": "%r.configuration.customBinaries.markdownDescription%"
},
"positron.r.customExcludes": {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer keeping the naming in line with python, "custom" seems to imply the presence of standard excludes which doesn't really make sense?

Comment on lines +25 to +27
/**
* Adapted from the function of the same name in extensions/positron-python/src/client/pythonEnvironments/common/externalDependencies.ts.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth making a similar comment in the python file so that if someone has to change something there, they consider changing it here as well.

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