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

Problem: Specifying library versions?? #54

Closed
ghost opened this issue Jun 16, 2013 · 6 comments
Closed

Problem: Specifying library versions?? #54

ghost opened this issue Jun 16, 2013 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 16, 2013

A lot of problems can be practically solved by referring to third party libraries. The twitter api is an example of this.

We can specify versions within each recipe, but I wonder if we shouldn't just mention the library versions in the description and where people can grab the latest release.

Thoughts?

@avescodes
Copy link
Member

This is definitely something we're going to need to figure out. I don't have a great answer right now, but thank you for raising this concern.

One of the things we want to achieve for sample code is ease of copy-paste. A possible solution I'd considered is a book-wide project.clj that includes all of the relevant dependencies. Does this sound reasonable, or is there a more favorable alternative?

@ghost
Copy link
Author

ghost commented Jun 17, 2013

A book-wide project.clj worries me. I'm not sure how maintainable something like that would be for authors. I think a better alternative would be to use lein-sub, with applications ready for testing.

Chapters would likely have libraries in common, but I wouldn't count on it. For completeness, each recipe could begin with

== Problem
Collect tweets and such.
== Libraries
twitter-api 0.7.8
== Solution
(ns hello-twitter
      (:require [twitter-api :as twi]))

or

== Problem
Collect tweets and such.
== Solution
(ns hello-twitter
      (:require [twitter-api :as twi])) ;; 0.7.8

@avescodes
Copy link
Member

Speaking with @levand it seems like per-recipe project.clj is the norm at the moment. We definitely should rig up lein-sub though.

As for messaging, you're right, there are a few alternatives. One proposal is to mention how to run code samples in the introduction and only call out specific versions in recipes where it is important (think the JLine issue from #40.) Reasonably styled it wouldn't be impossible to include a library and version number in such recipes printed format, though. What do you think is the most reasonable approach?

@ghost
Copy link
Author

ghost commented Jun 19, 2013

A per recipe project.clj is compatible with the lein-sub way of doing things, so that is good news!

I'm in favor of mentioning the library versions in the text since it will help users find recipes that are most current, and isn't actually that much of a hassle.

@avescodes
Copy link
Member

I think we can include the library version and/or a brief reminder about the project.clj dependency cleanly. I'll make an issue to create instructions in CONTRIBUTING.md and a few examples.

@avescodes
Copy link
Member

I'm going to close this card since we have an actionable decision in the form of #70. I'll be able to spend more time Friday ensuring a number of this repo Issues are corrected.

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

1 participant