Skip to content

Commit

Permalink
move BinDeps support to a separate package (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored Jul 25, 2018
1 parent bbbf11b commit 9de07b7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 123 deletions.
72 changes: 12 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,15 @@
[![Build Status -- OS X and Linux](https://travis-ci.org/JuliaPy/Conda.jl.svg?branch=master)](https://travis-ci.org/JuliaPy/Conda.jl)
[![Build status -- Windows](https://ci.appveyor.com/api/projects/status/edlxohso05re3v40/branch/master?svg=true)](https://ci.appveyor.com/project/StevenGJohnson/conda-jl)

This package allows one to use [conda](http://conda.pydata.org/) as a binary
provider for Julia. While other binary providers like
[Homebrew.jl](https://github.com/JuliaLang/Homebrew.jl),
[AptGet](https://en.wikipedia.org/wiki/Advanced_Packaging_Tool#apt-get) or
[WinRPM.jl](https://github.com/JuliaLang/WinRPM.jl) are platform-specific,
Conda.jl is a cross-platform alternative. It can also be used without
administrator rights, in contrast to the current Linux-based providers.

As such, `Conda.jl` primary audience is Julia packages developers who have a
dependency on some native library.
This package allows one to use [conda](http://conda.pydata.org/) as a cross-platform binary provider for Julia for other Julia packages,
especially to install binaries that have complicated dependencies
like Python.

`conda` is a package manager which started as the binary package manager for the
Anaconda Python distribution, but it also provides arbitrary packages. Instead
of the full Anaconda distribution, `Conda.jl` uses the miniconda Python
environment, which only includes `conda` and its dependencies.

`Conda.jl` is **NOT** an alternative Julia package manager, nor a way to manage
Python installations. It will not use any pre-existing Anaconda or Python
installation on your machine.

## Basic functionality

You can install this package by running `Pkg.add("Conda")` at the Julia prompt.
Expand All @@ -37,7 +26,7 @@ Basic package managing utilities are provided in the Conda module:
- `Conda.channels(env)`: get the current list of channels;
- `Conda.rm_channel(channel, env)`: remove a channel from the list of channels;

Parameter `env` is optional and defaults to `ROOTENV`. See below for more info.
The parameter `env` is optional and defaults to `ROOTENV`. See below for more info.

### Conda environments

Expand Down Expand Up @@ -68,48 +57,12 @@ environment.)
## BinDeps integration: using Conda.jl as a package author

Conda.jl can be used as a `Provider` for
[BinDeps](https://github.com/JuliaLang/BinDeps.jl) with the `Conda.Manager`
type. You first need to write a [conda
recipe](http://conda.pydata.org/docs/building/recipe.html), and upload the
corresponding build to [binstar](https://binstar.org/). Then, add Conda in your
REQUIRE file, and add the following to your `deps/build.jl` file:

```julia
using BinDeps
@BinDeps.setup
netcdf = library_dependency("netcdf", aliases = ["libnetcdf","libnetcdf4"])

...

using Conda
provides(Conda.Manager, "libnetcdf", netcdf)
```

If your dependency is available in another channel than the default one, you
should register that channel.

```julia
using Conda
Conda.add_channel("my_channel")
provides(Conda.Manager, "libnetcdf", netcdf)
```

If the binary dependency is only available for some OS, give this information to
BinDeps:

```julia
provides(Conda.Manager, "libnetcdf", netcdf, os=:Linux)
```

To tell BinDeps to install the package to an environment different from the
root environment, use `EnvManager`.

```julia
provides(Conda.EnvManager{:my_env}, "libnetcdf", netcdf)
```
[BinDeps](https://github.com/JuliaLang/BinDeps.jl) with the
[CondaBinDeps](https://github.com/JuliaPackaging/CondaBinDeps.jl)
package.

## Using an already existing Conda installation
To use an already existing Conda installation, first create an environment for
## Using a pre-existing Conda installation
To use a pre-existing Conda installation, first create an environment for
`Conda.jl` and then set the `CONDA_JL_HOME` environment variable to the full
path of the environment.
You have to rebuild `Conda.jl` and many of the packages that use it after this.
Expand Down Expand Up @@ -137,13 +90,12 @@ variable on [TravisCI](https://docs.travis-ci.com/user/environment-variables/) a

## Bugs and suggestions

Conda have been tested on Linux, OS X, and Windows. It should work on all these
platforms.
Conda has been tested on Linux, OS X, and Windows.

Please report any bug or suggestion as an
[issue](https://github.com/Luthaf/Conda.jl/issues)
[github issue](https://github.com/JuliaPy/Conda.jl/issues)

## Licence
## License

The Conda.jl package is licensed under the MIT Expat license, and is copyrighted
by Guillaume Fraux and contributors.
1 change: 0 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
julia 0.6
BinDeps
Compat 0.62.0
JSON
VersionParsing
19 changes: 1 addition & 18 deletions src/Conda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ __precompile__()

"""
The Conda module provides access to the [conda](http://conda.pydata.org/) packages
manager. Its main purpose is to be used as a BinDeps provider, to install binary
dependencies of other Julia packages.
manager to install binary dependencies of other Julia packages.
The main functions in Conda are:
Expand All @@ -14,20 +13,6 @@ The main functions in Conda are:
- `Conda.add_channel(channel)`: add a channel to the list of channels;
- `Conda.channels()`: get the current list of channels;
- `Conda.rm_channel(channel)`: remove a channel from the list of channels;
To use Conda as a binary provider for BinDeps, the `Conda.Manager` type is proposed. A
small example looks like this:
```julia
# Declare dependency
using BinDeps
@BinDeps.setup
netcdf = library_dependency("netcdf", aliases = ["libnetcdf","libnetcdf4"])
using Conda
# Use alternative conda channel.
Conda.add_channel("my_channel")
provides(Conda.Manager, "libnetcdf", netcdf)
```
"""
module Conda
Expand Down Expand Up @@ -295,6 +280,4 @@ function rm_channel(channel::AbstractString, env::Environment=ROOTENV)
runconda(`config --remove channels $channel --force`, env)
end

include("bindeps_conda.jl")

end
43 changes: 0 additions & 43 deletions src/bindeps_conda.jl

This file was deleted.

2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Conda, BinDeps, Compat, VersionParsing
using Conda, Compat, VersionParsing
using Compat.Test

Conda.update()
Expand Down

0 comments on commit 9de07b7

Please sign in to comment.