Skip to content

R package: use Config/reticulate for Python dependency declaration #722

@MaxGhenis

Description

@MaxGhenis

Summary

The R package currently manages Python dependencies manually in setup_policyengine() via custom reticulate::virtualenv_install() calls. We should also declare the Python dependency formally using the Config/reticulate field in DESCRIPTION, which is reticulate's standard mechanism.

Current state

  • setup_policyengine() manually creates a virtualenv and installs policyengine-taxsim from GitHub
  • policyengine_us_version param allows pinning a transitive dep, but this is a custom pattern
  • No Config/reticulate field in DESCRIPTION

Proposed change

Add to DESCRIPTION:

Config/reticulate:
  list(
    packages = list(
      list(package = "policyengine-taxsim", pip = TRUE)
    )
  )

Limitations to investigate

  • Config/reticulate doesn't natively support git+ URLs — may need to use PyPI once we publish there
  • No standard way to pin transitive dependencies (e.g. policyengine-us==1.555.0) via Config/reticulate — the custom policyengine_us_version param may still be needed for that use case
  • Need to test interaction with the lazy auto-setup in policyengine_calculate_taxes()

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions