Code Monkey home page Code Monkey logo

instantiatefromurl.jl's Introduction

InstantiateFromURL

A way to bind dependency information to Julia assets without the need to pass around TOML files

Will download, unpack, and activate a tarball of the resources in pwd/.projects

Based on Valentin Churavy's idea in JuliaLang/IJulia.jl#673 (comment)

Overview

GitHub repositories are expected to include a Project.toml and Manifest.toml file in the root directory, and all other files are ignored. For ex: QuantEcon/QuantEconLecturePackages

All of the following are valid calls:

  • activate_github("QuantEcon/QuantEconLecturePackages"), which saves to .projects/QuantEconLecturePackages-master
  • activate_github("QuantEcon/QuantEconLecturePackages", tag = "master"), which gives us the same thing.
  • activate_github("QuantEcon/QuantEconLecturePackages", tag = "v0.9.5"), which saves that version to .projects/QuantEconLecturePackages-v0.9.5
  • activate_github("QuantEcon/QuantEconLecturePackages", sha = "0c2985"), which saves that commit to .projects/QuantEconLecturePackages-0c2985

You can also call any of the above with ; force = true, which will force a re-download of the source resources.

You can also include an add_default_environment = true in your calls, which will Pkg.add() (at once) the packages grabbed to your default (~/.julia/environments/v1.0) environment. This way, packages/versions you install via InstantiateFromURL are immediately available, and can avoid teaching people about environments.

There's also a non-exported copy_env(reponame, oldprefix, newprefix) which will let you:

activate_github("QuantEcon/QuantEconLecturePackages")
copy_env("QuantEcon/QuantEconLecturePackages", "master", "mymaster")
activate_github("QuantEcon/QuantEconLecturePackages", tag = "mymaster") # Protected from future updates. 

No GitHub API calls are consumed, so rate-limiting is not an issue

instantiatefromurl.jl's People

Contributors

chiyahn avatar jlperla avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.