-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create a capsule from a DESCRIPTION file #28
Comments
I'm resistant to using DESCRIPTION files for R projects. I also get chills everytime I look at the number of json/yaml files I need to get a JS project off the ground! For projects, DESCRIPTION creates a second place to declare dependencies that can conflict with the I like the idea of If you're looking for something like If you're looking for a way to specify loose version constraints (e.g. > x_version), you might enjoy If there's a compelling case for DESCRIPTION, I'm happy to hear it though. I feel like I'd be more likely to accept automatically generated DESCRIPTION files, since they can't get out of sync. But I'd have to understand what the payoff is. |
The best argument for DESCRIPTION I could think of for projects was: It's a place to specify non-R dependencies. But as you point out with the JS example, those likely have their own format that plug into other dependency management machinery. So I don't know if it's that useful for this. |
I get the resistance to I think the benefits of using
In light of the above, the The Speaking of
At this point, it seems like your usage of I'm obviously biased, but I'm convinced that you're on to something with capsule and that supporting this workflow would make capsule more broadly accessible to more people and in more scenarios. I also think you're overthinking (or at least over-extrapolating from) my |
To reply directly to some of your points...
The
They consolidate and surface information, and helpfully in a human/machine readable format. The information contained by DESCRIPTION is much closer to human intention (I only use SHAs when I absolutely mean it).
Yeah but with a DESCRIPTION file they don't even have to since the DESCRIPTION file is a critical component used by tons of R tooling, e.g. usethis.
Yeah, I don't like the inferred dependency approach other than to check that you haven't noticed a direct dependency.
This is a good point but in the projects I'm thinking about, you wouldn't want to use
This is what |
Okay! You've convinced me this is worth exploring further. In particular, the idea that it's an overarching thing that might sit above many versions of This one surprised me though:
Just because one of the reasons I created I suspect we might be talking about some kind of optional part of the project - e.g. like machinery for generating a documentation website or something? You don't need it to get the outputs, but it might help you context switch back to the project? Do you have an example of a dev dependency for a project? I'm still not clear on the DESCRIPTION workflow. Is it:
Help understanding this would be appreciated. |
Awesome 😃
Totally! But there is still a middle ground:
It's really helpful to be able to include those team dependencies (point 2) in some way that helps people install them. I've found that putting them in Suggests is a good place. These are the packages that would appear in on-boarding docs, instead of saying "you'll want to install usethis, teamPackage1 and teamPackage2" they can be suggested dependencies. A more concrete example would be a project containing reports and a package that provides the report template. If you're working on the project you'll want that report template package because it makes life a whole lot easier, but you don't want the final product to depend on that reporting package. Suggests gives a place to say "if you're working in here, you'll want this package" and also a method for installing all the things, without actually requiring it in the prod environment.
Yeah that's basically it! The whole CI bot thing adds an additional player but it's still a fairly similar workflow to the current capsule setup. The point of the CI bot is that as a team we've agreed that the target environment is the one where the bot lives and so the bot's lockfile has precedence over the lockfiles created by humans A or B. I imagine you end up in a similar situation if you didn't have the bot involved but A and B were on different operating systems, etc. If no bot is involved and if humans A and B are using close-enough machines, you can just take out the steps involving the bot from your workflow. But if you know you have a specific target environment and somebody (or a bot) who can generate a lockfile in that env, you'd probably just resolve lockfile conflicts by accepting whatever version is generated in that target env. It would look something like this:
The key realization for me is that the lockfile isn't a universal guarantee of reproducibility, even though it kind of tries to be. Really it's a description of the packages installed in a target environment. Lockfiles work best when they're tied to where they're expected to run. So you could replace "CI bot" with any process that creates a trustworthy lockfile for the target environment. For example, recently I worked on a project locally, but then called |
Thanks for the clarification!
Yes I hear this, I've learned this lesson the hard way myself. My team's solution was to move development to the cloud, such that we're full-time developing on a prod-like environment.
This is a cool idea. I have been thinking about some kind of integration of capsule with docker for a little bit now. But I was thinking from the perspective of some kind of 'lockfile rescue' function where you try recreate the capsule on a container image from around the time the lockfile was created. There's still a bit more sketching to do on the workflow I think. Having lockfiles created locally that you don't want feels kind of lame. |
I'd love to see an alternative
capsule::create()
workflow that uses theDESCRIPTION
file to set up the capsule rather than an R script withlibrary()
calls.This is typically handled via
renv::install()
and in my experience it works really well as a light-weight and user-friendly entry point for dependency declaration. Basically,DESCRIPTION
is torenv.lock
aspackage.json
is topackage.lock.json
.The text was updated successfully, but these errors were encountered: