How to install a Package from a github branch

4,556 views
Skip to first unread message

Sharmila Gopirajan Sivakumar

unread,
Jan 20, 2014, 8:10:29 AM1/20/14
to julia...@googlegroups.com
Hi,
    I want to install a package from a github branch, specifically, https://github.com/johnmyleswhite/SQLite.jl/tree/jmw .  I tried the following command

Pkg.clone("https://github.com/johnmyleswhite/SQLite.jl.git", "jmw")
INFO: Cloning jmw from https://github.com/johnmyleswhite/SQLite.jl.git
INFO: Computing changes...
INFO: No packages to install, update or remove.

Julia is not able to install the package.  Is it possible to locally checkout the code and install from source? 

Thank you.

Regards,
Sharmila

Stefan Karpinski

unread,
Jan 20, 2014, 11:13:03 AM1/20/14
to Julia Users
That did successfully install the package. However, as per the documentation for Pkg.clone, it did so under the package name "jmw". Did you mean for the second argument to be a branch name? You can checkout a specific branch after cloning the package using the Pkg.checkout command. Also, SQLite is an official, registered package, so installing it via Pkg.clone is a bit unusual. Do you need John's fork for some particular reason?

John Myles White

unread,
Jan 20, 2014, 1:00:41 PM1/20/14
to julia...@googlegroups.com
My fork of SQLite is very different from master. It represents most of my work pushing for Julia to have a DBI module that lets us write generic code for database access.

I’m hoping to finish my work on writing a DBI package plus drivers for SQLite and MySQL very soon. I would hold off on using my fork until there’s an official release.

 — John

Sharmila Gopirajan

unread,
Jan 20, 2014, 1:18:23 PM1/20/14
to julia...@googlegroups.com
Hi Stefan,
            Thank you for responding.  As an extension of my understanding of Pkg.checkout, I assumed that Pkg.clone(url, name) would clone the branch 'name' for the repo at 'url'.  My bad. It still installs only the master branch. Right now there doesn't seem to be support to install a branch or tag through Pkg.clone(). 

I want to use John's fork because it is DBI complaint and supports prepared statements and parameter binding which the official version doesn't.  

 I just now read John Myles White's response too.  While I accept his idea, would it not be useful to have the ability to install from the branch or tag of an unregistered Package?  If you feel that is a valid feature, I would be happy to help add it.

Regards,
Sharmila

Ivar Nesje

unread,
Jan 20, 2014, 1:25:10 PM1/20/14
to julia...@googlegroups.com
Can't you just do

>Pkg.clone("https://gitub.com.....","pkgname")
>Pkg.checkout("pkgname","branch")

Ivar

Sharmila Gopirajan

unread,
Jan 20, 2014, 1:25:21 PM1/20/14
to julia...@googlegroups.com
Hi John,
         Thank you for responding.  I am trying to insert huge blobs of html text into an sqlite database.  I felt the prepared statements and parameter binding would be of huge help.  Since I will not be able to use the fork, Is there another option for escaping strings? For example, the simplest option in python would be the repr() function. Is there a julia equivalent?

Sharmila Gopirajan

unread,
Jan 20, 2014, 1:31:10 PM1/20/14
to julia...@googlegroups.com
Thanks Ivar,
                That works!

John Myles White

unread,
Jan 20, 2014, 1:41:30 PM1/20/14
to julia...@googlegroups.com
What sort of escaping are you trying to do? There’a a print_escaped function, but it sounds like you might be looking for SQL escaping, which I don’t think is currently available.

I’m not sure that the master branch or my fork of SQLite support BLOB columns yet. Maybe master does.

 — John

Stefan Karpinski

unread,
Jan 20, 2014, 2:23:56 PM1/20/14
to Julia Users
This makes me wonder if the API should change. Maybe keyword arguments for both the package name and branch?

John Myles White

unread,
Jan 20, 2014, 2:25:26 PM1/20/14
to julia...@googlegroups.com
Keyword arguments seem like a much better approach.

 — John

Stefan Karpinski

unread,
Jan 20, 2014, 2:34:19 PM1/20/14
to Julia Users

Ivar Nesje

unread,
Jan 20, 2014, 2:44:43 PM1/20/14
to julia...@googlegroups.com
I like the current API, and it is right in line with the API exposed by git command line.

Unfortunately Sharmila Gopirajan Sivakumar showed us that this is not obvious, and keyword arguments are more self documenting. In the end I think keyword arguments makes sense for Pkg.clone(), and Pkg.checkout().
Reply all
Reply to author
Forward
0 new messages