PolicyEngine / PolicyEngine/policyengine-taxsim

R package: use Config/reticulate for Python dependency declaration

Open
#722 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17
Forks
10
Avg merge
15h 55m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with r-package/policyenginetaxsim/R/setup.R and the DESCRIPTION file. Read setup_policyengine() and policyengine_calculate_taxes() to understand the current virtualenv setup and lazy auto-setup, then test how the proposed Config/reticulate declaration interacts with the GitHub dependency and policyengien_us_version. Done means the dependency is declared appropriately and the setup behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, r
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.