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

Add required packages to DESCRIPTION #12

Closed
nevrome opened this issue Mar 3, 2019 · 8 comments
Closed

Add required packages to DESCRIPTION #12

nevrome opened this issue Mar 3, 2019 · 8 comments

Comments

@nevrome
Copy link

nevrome commented Mar 3, 2019

I really like automagic: It's my go-to package when I get random scripts from colleagues and want to get everything running fast. So thank you for your work here!

I wonder if you would consider adding a function that automatically adds/updates required dependencies in the DESCRIPTION file of an R package in ongoing development. I find myself sometimes working on package code and loosing track of the dependencies I use. Then it's useful to have a function that updates the DESCRIPTION accordingly.

I wrote some code for this purpose in rrtools (https://github.com/benmarwick/rrtools/blob/master/R/manage_dependencies.R), but I think it does not really belong there. It would fit better into a management package like automagic where the search for packages is already implemented.

What do you think? Could this feature become part of automagic?

@cole-brokamp
Copy link
Owner

Thanks for the kind words! That's funny you should bring this up, because I have been thinking about it a lot lately. I'm also wanting to move to DESCRIPTION files, rather than the deps.yaml used here. Its probably easier to conform to the R standard then to reinvent the wheel.

However, rather than deprecate the deps.yaml file functions for automagic, I've been working on another package (still not public on GH) that will scan the code for dependencies and add to the DESCRIPTION file. I eventually want to move the code that scans for packages from here to the newer package and leave automagic as is with the deps.yaml file to maintain backwards compatibility.

I'll ping you when its ready for you to take a look. I would love it if you could contribute and/or tell me more about your use cases over there. Stay tuned...

@nevrome
Copy link
Author

nevrome commented Mar 5, 2019

That's excellent news! Thank you very much - I'm looking forward to the result!

Let me just update to issues over at rrtools: 1 2

@gadenbuie
Copy link

What about a deps.yaml to DESCRIPTION translator function? I could see that living inside automagic rather than a separate package. I'm a big fan of deps.yaml but I also feel there's some coalescing of agreement in the greater R community around using DESCRIPTION as a standard container for package and project metadata.

@cole-brokamp
Copy link
Owner

I agree 100%, @gadenbuie. I've definitely had the same thoughts. In addition, we could add an option to automagic::automagic() to use a DESCRIPTION file instead of a deps.yaml file, but keep the default set to deps.yaml. I was envisioning a make_desc_file() function for those that want to use the DESCRIPTION file. Any ideas on a function name for the translator function? deps_to_desc()??

@nevrome
Copy link
Author

nevrome commented Mar 8, 2019

I would love to have these functions in automagic!

One important aspect though: In my personal experience more often than not the DESCRIPTION file already exists and I only want to update it with the new dependencies. So I would prefer a update_desc_file() function like the one in rrtools (see my first post). make_desc_file() could be a wrapper around usethis::use_description() and automagic::update_desc_file().

@gadenbuie
Copy link

Good point @nevrome -- I think the workflow would be to make or update a DESCRIPTION file, or to translate a DESCRIPTION file to deps.yaml. {usethis} uses {desc} behind the scenes, so it would be a good option for setting up and interacting with the DESCRIPTION file.

@cole-brokamp
Copy link
Owner

Agreed that its important to update a DESCRIPTION, rather than create one. I'm going to move some stuff I've been working on that has to do with this in a new branch and push it up as soon as I get the chance so you all can take a look.

@nevrome
Copy link
Author

nevrome commented Jun 27, 2019

@cole-brokamp Did you have some time to work on this issue? If you share your prepared code we could take a look at it together.

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

No branches or pull requests

3 participants