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 a "How to convert your Depends dependency on data.table to Imports" section to datatable-importing vignette? #6037

Closed
MichaelChirico opened this issue Mar 29, 2024 · 3 comments · Fixed by #6161
Assignees

Comments

@MichaelChirico
Copy link
Member

MichaelChirico commented Mar 29, 2024

#3076 was long ago but we keep seeing more and more packages with {data.table} in Depends ☹️

I started filing some PRs helping authors change to Imports, but it's hardly scalable:

Better might be a how-to guide in our docs somewhere. I'm only torn on whether this is better as an addition to the existing vignette, or a new Wiki page that can be more easily edited. Thoughts?

@Anirban166
Copy link
Member

I think it would be valuable to have notes for that in both places. This fits in the subject matter of the importing vignette, and as you mentioned, a Wiki page would benefit from easy and instant updates by everyone (although I presume it may be less discoverable than a vignette).

@tdhock
Copy link
Member

tdhock commented Mar 30, 2024

other packages are allowed to use Depends, if they want.
I don't think it is our respsonsibility to police Depends vs Imports usage. Do we gain something (less issues filed by users, etc?) by doing this policing?

@MichaelChirico
Copy link
Member Author

#3076 cites the advantage to us being cleaning up this ugly code:

tryCatch("data.table" %chin% get(".Depends",paste("package",nsname,sep=":"),inherits=FALSE),error=function(e)FALSE) # both ns$.Depends and get(.Depends,ns) are not sufficient

but more broadly speaking, as an important package in the R ecosystem we can play a role in spreading awareness of best practices.

AFAICT 'Depends' is a relic of >10 years ago when that was the only way to do dependencies, but R can't remove it for back-compatibility.

I can also say that R at Google had an infrastructure issue where all Imports were converted to Depends and it caused absolute havoc. It took years to fix. From the experience of working on that I came away detesting Depends.

Anyway, while it's not a great use of dev time to go around fixing 90 other packages, we can offer a simple DIY guide like this and continued encouragement to drop Depends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants