Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ryp2 dependency #110

Merged
merged 6 commits into from
May 17, 2024
Merged

Updated ryp2 dependency #110

merged 6 commits into from
May 17, 2024

Conversation

rickecon
Copy link
Member

@rickecon rickecon commented May 14, 2024

This PR:

  • Updates the dependency rpy2>=3.5.12 in environment.yml and setup.py. This is meant to fix the error below in installing OG-USA in another repository.
  • Moves the rpy2 package download out of the conda-forge channel in the environment.yml file into the pip download section.
  • Updates the rpy2 API commands in psid_data_setup.py.
  • Adds wheel package to environment.yml dependencies. It was already in setup.py.
  • Adds installation of R in build_and_test.yml

cc: @jdebacker

@rickecon
Copy link
Member Author

The error I was getting was in the OG-Lifespan repository in the GH Action that ran the CI tests. In the "Setup Miniconda" job of the CI test, the following error arose, which seemed to be related to rpy2. When scanning the rpy2 repository Issues, I found this one "problem installing on mac" that suggested updated the package.

Updating 'lifespan-dev' env from conda env update...
  /Users/runner/miniconda3/condabin/mamba env update --name lifespan-dev --file /Users/runner/work/OG-Lifespan/OG-Lifespan/setup-miniconda-patched-environment.yml
  Channels:
   - conda-forge
   - defaults
  Platform: osx-arm64
  Collecting package metadata (repodata.json): ...working... done
  Solving environment: ...working... done
  
  Downloading and Extracting Packages: ...working... done
  Preparing transaction: ...working... done
  Verifying transaction: ...working... done
  Executing transaction: ...working... done
  Installing pip dependencies: ...working... ::warning::Pip subprocess error:%0A  error: subprocess-exited-with-error%0A  %0A  × Getting requirements to build wheel did not run successfully.%0A  │ exit code: 1%0A  ╰─> [6 lines of output]%0A      Unable to determine R home: [Errno 2] No such file or directory: 'R'%0A      cffi mode is CFFI_MODE.ANY%0A      Looking for R home with: R RHOME%0A      Unable to determine R home: [Errno 2] No such file or directory: 'R'%0A      R home found: None%0A      Error: rpy2 in API mode cannot be built without R in the PATH or R_HOME defined. Correct this or force ABI mode-only by defining the environment variable RPY2_CFFI_MODE=ABI%0A      [end of output]%0A  %0A  note: This error originates from a subprocess, and is likely not a problem with pip.%0Aerror: subprocess-exited-with-error%0A%0A× Getting requirements to build wheel did not run successfully.%0A│ exit code: 1%0A╰─> See above for output.%0A%0Anote: This error originates from a subprocess, and is likely not a problem with pip.%0A%0A
  Pip subprocess error:
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> [6 lines of output]
        Unable to determine R home: [Errno 2] No such file or directory: 'R'
        cffi mode is CFFI_MODE.ANY
        Looking for R home with: R RHOME
        Unable to determine R home: [Errno 2] No such file or directory: 'R'
        R home found: None
        Error: rpy2 in API mode cannot be built without R in the PATH or R_HOME defined. Correct this or force ABI mode-only by defining the environment variable RPY2_CFFI_MODE=ABI
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  
  Warning: 
  CondaEnvException: Pip failed
  
  
  
  CondaEnvException: Pip failed
  
  Ran pip subprocess with arguments:
  ['/Users/runner/miniconda3/envs/lifespan-dev/bin/python', '-m', 'pip', 'install', '-U', '-r', '/Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt', '--exists-action=b']
  Pip subprocess output:
  Collecting ogcore (from -r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading ogcore-0.11.6-py3-none-any.whl.metadata (11 kB)
  Collecting ogusa (from -r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 2))
    Downloading ogusa-0.1.6-py3-none-any.whl.metadata (7.8 kB)
  Collecting plotly-express (from -r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 3))
    Downloading plotly_express-0.4.1-py2.py3-none-any.whl.metadata (1.7 kB)
  Requirement already satisfied: numpy in /Users/runner/miniconda3/envs/lifespan-dev/lib/python3.10/site-packages (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1)) (1.26.4)
  Collecting scipy>=1.7.1 (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading scipy-1.13.0-cp310-cp310-macosx_12_0_arm64.whl.metadata (60 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 kB 17.2 MB/s eta 0:00:00
  Requirement already satisfied: pandas>=1.2.5 in /Users/runner/miniconda3/envs/lifespan-dev/lib/python3.10/site-packages (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1)) (2.2.2)
  Requirement already satisfied: matplotlib in /Users/runner/miniconda3/envs/lifespan-dev/lib/python3.10/site-packages (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1)) (3.8.4)
  Collecting dask>=2.30.0 (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading dask-2024.5.0-py3-none-any.whl.metadata (3.8 kB)
  Collecting distributed>=2.30.1 (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading distributed-2024.5.0-py3-none-any.whl.metadata (3.4 kB)
  Collecting paramtools>=0.15.0 (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading paramtools-0.18.1-py3-none-any.whl.metadata (11 kB)
  Collecting requests (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
  Requirement already satisfied: pip in /Users/runner/miniconda3/envs/lifespan-dev/lib/python3.10/site-packages (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1)) (24.0)
  Collecting pygam (from ogcore->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 1))
    Downloading pygam-0.9.1-py3-none-any.whl.metadata (7.1 kB)
  Collecting psutil (from ogusa->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 2))
    Downloading psutil-5.9.8-cp38-abi3-macosx_11_0_arm64.whl.metadata (21 kB)
  Collecting taxcalc>=3.0.0 (from ogusa->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 2))
    Downloading taxcalc-3.6.0-py3-none-any.whl.metadata (3.2 kB)
  Collecting rpy2<=3.5.11 (from ogusa->-r /Users/runner/work/OG-Lifespan/OG-Lifespan/condaenv.tnhlxve6.requirements.txt (line 2))
    Downloading rpy2-3.5.11.tar.gz (216 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 216.6/216.6 kB 38.4 MB/s eta 0:00:00
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
  
  failed

Error: The process '/Users/runner/miniconda3/condabin/mamba' failed with exit code 1

@codecov-commenter
Copy link

codecov-commenter commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.49%. Comparing base (3135391) to head (478911e).

Current head 478911e differs from pull request most recent head 63e927b

Please upload reports for the commit 63e927b to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #110      +/-   ##
==========================================
+ Coverage   75.35%   75.49%   +0.14%     
==========================================
  Files          11       11              
  Lines         852      857       +5     
==========================================
+ Hits          642      647       +5     
  Misses        210      210              
Flag Coverage Δ
unittests 75.49% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
ogusa/psid_data_setup.py 100.00% <100.00%> (ø)

@rickecon
Copy link
Member Author

@jdebacker. All the tests are passing now locally on my Mac machine. I looked at the rpy2 package testing CI results and the source GH action .yml file pythonpackage.yml. For the CI testing, they have to install R first. So I am going to add that to our build_and_test.yml for the MacOS runs.

@rickecon
Copy link
Member Author

@jdebacker. This PR is ready for your review.

@jdebacker
Copy link
Member

Looks great - thanks @rickecon!

@jdebacker jdebacker merged commit 60f204f into PSLmodels:master May 17, 2024
6 checks passed
@rickecon rickecon deleted the rpy2 branch May 17, 2024 15:03
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.

3 participants