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
Summary
The R package currently manages Python dependencies manually in
setup_policyengine()via customreticulate::virtualenv_install()calls. We should also declare the Python dependency formally using theConfig/reticulatefield inDESCRIPTION, which is reticulate's standard mechanism.Current state
setup_policyengine()manually creates a virtualenv and installspolicyengine-taxsimfrom GitHubpolicyengine_us_versionparam allows pinning a transitive dep, but this is a custom patternConfig/reticulatefield inDESCRIPTIONProposed change
Add to
DESCRIPTION:Limitations to investigate
Config/reticulatedoesn't natively supportgit+URLs — may need to use PyPI once we publish therepolicyengine-us==1.555.0) viaConfig/reticulate— the custompolicyengine_us_versionparam may still be needed for that use casepolicyengine_calculate_taxes()References
r-package/policyenginetaxsim/R/setup.R