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

[WIP]cran support #423

Merged
merged 31 commits into from
Jan 21, 2023
Merged

[WIP]cran support #423

merged 31 commits into from
Jan 21, 2023

Conversation

marcelotrevisani
Copy link
Member

@marcelotrevisani marcelotrevisani commented Jan 17, 2023

Initial CRAN support based on @ForgottenProgramme PR (#349)

@marcelotrevisani
Copy link
Member Author

marcelotrevisani commented Jan 17, 2023

simple example for future 1.26.1

{% set name = "future" %}
{% set version = "1.26.1" %}

package:
  name: r-{{ name }}
  version: '{{ version }}'

source:
  url: https://cran.r-project.org/src/contrib/Archive/future/future_{{ version }}.tar.gz
  sha256: a35c0bdae86265ebe86119231802b6fbf7b1d533b57cb423d8483fbe779390d5

build:
  number: 0
  script: R CMD INSTALL --build .
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  host:
    - r-base
    - r-digest
    - r-globals >=0.15.0
    - r-listenv >=0.8.0
    - r-parallel
    - r-parallelly >=1.30.0
    - r-tools
    - r-utils
  run:
    - r-base
    - r-digest
    - r-globals >=0.15.0
    - r-listenv >=0.8.0
    - r-parallel
    - r-parallelly >=1.30.0
    - r-tools
    - r-utils

test:
  commands:
    - $R -e "library('future')"  # [not win]
    - "\"%R%\" -e \"library('future')\""  # [win]

about:
  home: https://future.futureverse.org, https://github.com/HenrikBengtsson/future
  summary: The purpose of this package is to provide a lightweight and unified Future API for sequential and parallel processing of R expression via futures.  The simplest way to evaluate an expression in parallel is to use `x %<-% { expression }` with `plan(multisession)`. This package implements sequential, multicore, multisession, and cluster futures.  With these, R expressions can be evaluated on the local machine, in parallel a set of local machines, or distributed on a mix of local and remote machines. Extensions to this package implement additional backends for processing futures via compute
    cluster schedulers, etc. Because of its unified API, there is no need to modify any code in order switch from sequential on the local machine to, say, distributed processing on a remote compute cluster. Another strength of this package is that global variables and functions are automatically identified and exported as needed, making it straightforward to tweak existing code to make use of futures.
  license: LGPL-2.1-or-later

@ocefpaf
Copy link
Contributor

ocefpaf commented Jan 17, 2023

@mbargull, and anyone from the bioconda team, we would your input here.

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2023

Codecov Report

Merging #423 (eaea455) into main (9c3242e) will increase coverage by 0.38%.
The diff coverage is 92.35%.

@@            Coverage Diff             @@
##             main     #423      +/-   ##
==========================================
+ Coverage   91.30%   91.68%   +0.38%     
==========================================
  Files          17       17              
  Lines        1576     1925     +349     
==========================================
+ Hits         1439     1765     +326     
- Misses        137      160      +23     
Flag Coverage Δ
unittests 91.68% <92.35%> (+0.38%) ⬆️

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

Impacted Files Coverage Δ
setup.py 0.00% <0.00%> (ø)
grayskull/base/github.py 72.83% <72.83%> (ø)
grayskull/license/discovery.py 93.81% <72.97%> (-3.33%) ⬇️
grayskull/strategy/abstract_strategy.py 83.33% <83.33%> (ø)
grayskull/strategy/cran.py 90.05% <90.05%> (ø)
grayskull/__main__.py 92.68% <91.76%> (-5.47%) ⬇️
grayskull/base/factory.py 90.69% <92.30%> (+0.69%) ⬆️
grayskull/strategy/py_base.py 95.43% <95.43%> (ø)
grayskull/strategy/pypi.py 97.39% <97.39%> (ø)
grayskull/utils.py 98.12% <97.58%> (-1.88%) ⬇️
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marcelotrevisani marcelotrevisani merged commit 79a7443 into main Jan 21, 2023
@marcelotrevisani marcelotrevisani deleted the fb-cran branch January 21, 2023 22:11
@marcelotrevisani marcelotrevisani mentioned this pull request Jan 21, 2023
13 tasks
@isuruf
Copy link

isuruf commented Jan 25, 2023

Why use a less featureful version of conda skeleton cran here? This has multiple issues

  • No license_file entry
  • R_ARGS variable is not used
  • cross-r-base is not added for non compiler recipes
  • noarch: generic is not used
  • DISABLE_AUTOBREW is not added

@isuruf
Copy link

isuruf commented Jan 25, 2023

Also, this PR vendors conda-build code and fails to distribute the license

@marcelotrevisani
Copy link
Member Author

Why use a less featureful version of conda skeleton cran here? This has multiple issues

  • No license_file entry
  • R_ARGS variable is not used
  • cross-r-base is not added for non compiler recipes
  • noarch: generic is not used
  • DISABLE_AUTOBREW is not added

That is just initial support for R, and things can be improved later on. Everything needs a start :)
Part of this work was not done by me, I am happy to add the licence or strip the code off if you point me out which part is a copy from conda-build.
Grayskull in the first versions didn't have all the features for python recipes as well, but it was improved over time.
Your points of missing a few bits are understandable and can be addressed later.

@ocefpaf
Copy link
Contributor

ocefpaf commented Jan 25, 2023

Why use a less featureful version of conda skeleton cran here? This has multiple issues

Just to be clear. Every Software starts with less features and increase in complexity with time. The question here is why grayskull instead of conda-build. I guess that b/c the main reason is why we did this for Python recipes. The slow pace of conda-build development and the difficulty to get PRs accepted drove us to create a new recipe generator.

@marcelotrevisani
Copy link
Member Author

if you are keen to help to improve that part related to R, we are more than welcome to accept contributions or to open separated issues for it. Thanks!

@isuruf
Copy link

isuruf commented Jan 25, 2023

Every Software starts with less features and increase in complexity with time.

Not all of the features I mentioned are necessary, but generating recipes that have incomplete licensing information is asking for trouble.

The question here is why grayskull instead of conda-build. I guess that b/c the main reason is why we did this for Python recipes. The slow pace of conda-build development and the difficulty to get PRs accepted drove us to create a new recipe generator.

I don't question that. Moving skeletons out of conda-build is good.

From a look at the code here most of the code here is an almost identical copy of the conda-build code. https://github.com/conda-incubator/grayskull/blob/d17444d66ebf50fdb5d97948c7ecfc654b0f68fa/grayskull/strategy/cran.py#L61-L252
And then https://github.com/conda-incubator/grayskull/blob/d17444d66ebf50fdb5d97948c7ecfc654b0f68fa/grayskull/strategy/cran.py#L255-L346 seems like a stripped down version of the conda-build code.

I'm just curious why this is a stripped down version and not all features were not copied.

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.

6 participants