Skip to content

Conversation

@rpreen
Copy link
Collaborator

@rpreen rpreen commented Jan 14, 2026

Add a Boolean use_conda option to acro_init() to enable support for conda environments.

If no value for use_conda is passed, it checks for an environment variable ACRO_USE_CONDA (defaults false if unset) - this is primarily for CI usage, but could also be configured by a sysadmin so that the end user doesn't have to set this variable.

Note: this setup assumes pre-installation of Conda (which seems most suited to restricted environments) - reticulate does have an option to install_miniconda() but that would require Internet access so that has been omitted here.

This needs more people to test before merging, but it seems to run locally (and on CI).


Steps:

  1. Manually install miniconda

  2. Accept the miniconda terms

conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
  1. Clone ACRO-R
git clone --branch add_conda https://github.com/AI-SDC/ACRO-R.git
cd ACRO-R/
  1. Set the environment variable - alternatively you could pass use_conda=TRUE in acro_init()
export ACRO_USE_CONDA=true
  1. Run R, install ACRO, and init
R
> install.packages("devtools")
> library("devtools")

> install(".")

> library("acro")
> acro_init()

Obviously if this is pushed to CRAN, cloning, use of devtools and local package installation is not needed.

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ddb5da0) to head (8824f60).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #35   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         4    -1     
  Lines          107       109    +2     
=========================================
+ Hits           107       109    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rpreen rpreen force-pushed the add_conda branch 4 times, most recently from 61d3d76 to 94a7298 Compare January 15, 2026 00:14
@rpreen rpreen force-pushed the add_conda branch 3 times, most recently from cca38df to 56ea6ff Compare January 15, 2026 11:14
@rpreen rpreen linked an issue Jan 15, 2026 that may be closed by this pull request
@rpreen rpreen requested a review from jim-smith January 15, 2026 12:45
@rpreen rpreen marked this pull request as ready for review January 15, 2026 12:46
Copy link
Collaborator

@jim-smith jim-smith Jan 15, 2026

Choose a reason for hiding this comment

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

  1. Do we want to tie this to a specific version of acro ( could understand 'yes, for now')
  2. This seems to use python 12 (maybe becuase that is what is on condo?), and maybe it is how the file was shown to me, but R-CMD-check.yaml seemed ot refer only to 10 or 13
  3. there's an error message saying something like "miniconda is not installed". Should that use parenthesis in case people don't understand the relationship I.e. "...(mini) conda is not installed..."
  4. This does not give people the ability to provide a config file when they call init (line 92). I know it is a slightly different issues, but ...

Copy link
Collaborator Author

@rpreen rpreen Jan 15, 2026

Choose a reason for hiding this comment

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

  1. It is pinned to Python ACRO v0.4.11 - we have always pinned ACRO-R to a specific Python version for stability; it does mean that the CRAN package needs updating each time the Python backend is updated, but it's safer and allows changes to occur upstream without breaking anything here.
  2. The Conda Python is set to Python 3.12 because it is probably the most stable version; and since Conda allows specifying a specific version it reduces the number of moving parts. The CI uses Python 3.12 so we only need to test it - hence fewer CI runners needed. If Conda is not used then the virtual environment will use whatever Python is available on the system (>=3.10) as before.
  3. Changed "miniconda" to just "conda".
  4. Done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

should we have a test for install_conda ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's time consuming to create a single runner that will test both Conda and venv just so the code coverage can be contained. The CI has dedicated runners for Conda now which execute the tests in that environment (except for one specific test that tests installation in a venv that I kept because it was originally there --- I wonder if it's even necessary since if that fails then none of the tests would pass.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

sounds good.
Appreciate your adding the unrelated feature about handling config files
should we add a test to check the custom yaml has been loaded or do that elsewhere?

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.

[Feature] Add support for conda-forge environments

3 participants