Skip to content

Add CI smoke test for Python/reticulate setup - #130

Open
tkswanson with Copilot wants to merge 5 commits into
masterfrom
copilot/create-lightweight-test-file
Open

Add CI smoke test for Python/reticulate setup#130
tkswanson with Copilot wants to merge 5 commits into
masterfrom
copilot/create-lightweight-test-file

Conversation

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This adds a lightweight testthat smoke test to validate the CI Python setup before the broader suite runs. It verifies that Python 3.12, the animl_env virtual environment, animl-py, and the package’s reticulate wiring are all available as expected.

  • New CI smoke test

    • Adds tests/testthat/test-python_setup.R
    • Skips cleanly when Python is not available at all
    • Fails when CI has Python but the expected animl environment is misconfigured
  • Environment checks

    • Confirms animl_env exists via reticulate::virtualenv_exists("animl_env")
    • Verifies the active interpreter reports Python 3.12
  • animl-py import validation

    • Confirms the animl Python module is available to reticulate
    • Imports animl directly and checks that the imported module is also present in animl:::.animl_internal$animl_py
  • Reticulate integration check

    • Verifies the interpreter seen by reticulate::py_config() matches sys.executable
    • Ensures the package is using the configured Python environment rather than a different interpreter
test_that("CI Python setup is available for animl", {
  expect_true(reticulate::virtualenv_exists("animl_env"))
  expect_equal(
    reticulate::py_eval(
      "'{}.{}'.format(__import__('sys').version_info[0], __import__('sys').version_info[1])"
    ),
    "3.12"
  )
  expect_true(reticulate::py_module_available("animl"))
})

Copilot AI changed the title [WIP] Add lightweight test for Python environment validation Add CI smoke test for Python/reticulate setup Jul 31, 2026
Copilot AI requested a review from tkswanson July 31, 2026 17:45
@tkswanson
tkswanson marked this pull request as ready for review July 31, 2026 20:08
@tkswanson
tkswanson force-pushed the copilot/create-lightweight-test-file branch from 9b862cb to 9c41f52 Compare July 31, 2026 20:11
@tkswanson
tkswanson force-pushed the copilot/create-lightweight-test-file branch from 9c41f52 to 301b142 Compare July 31, 2026 20:31
Removed the '--no-tests' argument from rcmdcheck to begin testing
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