The ODM2 Conda Channel – April 29th



The ODM2 Conda Channel – April 29th

0 0


ODM2_conda_channel_presentation

ODM2 conda channel presentation

On Github ocefpaf / ODM2_conda_channel_presentation

The ODM2 Conda Channel

April 29th

Who am I?

What is a Conda Channel?

  • Is similar to a Linux repository (or app store)
  • The service is hosted for free at Continuum's Anaconda Cloud
  • We can upload pre-compiled binaries using the conda package manager

What is a conda?

  • From their own webpage:
  • "Package Everything!"
  • "And share your repositories with clients or colleagues."

Why use conda?

  • Version dependency solving (e.g.: geoalchemy-odm2 fork)
  • Reproducible environments are easy to create
  • One recipe for multiple platforms (no apt-get, yum, brew, etc)

The ODM2 Channel

  • 10 packages compiled for Python 2 and 3 (when possible)
  • Available platforms are Linux-64, Windows-32/64, and OS X
  • You can install with conda install -c ODM2 odm2api

How to use the channel?

conda config --add channels ODM2

curl -L http://bit.ly/ODM2-env -o environment.yml

conda env create environment.yml

That is it!

ODM2 environment file

name: ODM2
channels:
    - ODM2
dependencies:
    - python=2.7
    - odm2api
    - wofpy
    - jupyter
    - matplotlib

How is the channel populated?

Issues

https://github.com/ODM2/ODM2PythonAPI/issues/63

PRs

https://github.com/ODM2/conda-recipes-ODM2/pull/32

How to contribute?

  • Report problems
  • Request packages or new releases
  • Send PRs adding/fixing packages

Submitting a recipe

Creating a recipe

{% set version = "1.0" %}

package:
  name: example
  version: {{ version }}

source:
  fn: example-{{ version }}.tar.gz
  url: https://pypi.python.org/example-{{ version }}.tar.gz
  md5: 842b44f8c95517ed5b792081a2370da1
  patches:
    - some.patch

build:
  number: 0
  script: script: python -m pip install --no-deps .

requirements:
  build:
    - python
    - pip
  run:
    - python

test:
  imports:
    - example
  commands:
    - example --version

about:
  home: https://example.com/examples/
  license: BSD 3-Clause
  summary: An example package

extra:
  recipe-maintainers:
    - GitHubHandle

The truth about creating recipes

  • conda skeleton pypi psycopg2
  • Search, download, copy, and paste
  • Fetch directly from known and trusted sources

Getting recipes from conda-forge

# Placeholder meta, the canonical one comes from source.txt

package:
   name: shapely

build:
   script: exit 1
gh-repo: conda-forge/shapely-feedstock
git-tag: master
contents: recipe/*

Maintaining recipes

{% set version = "1.0" %}

package:
  name: example
  version: {{ version }}

source:
  fn: example-{{ version }}.tar.gz
  url: https://pypi.python.org/example-{{ version }}.tar.gz
  md5: 842b44f8c95517ed5b792081a2370da1
  patches:
    - some.patch

build:
  number: 0
  .
  .
  .

Maintenance example

https://github.com/ODM2/conda-recipes-ODM2/pull/32/files

The conda-recipes-ODM2 repository

Let's try to answer: - What's needed in the repo to be ready for packaging - The multi-OS support - The role of the Continuous Integration (CI)

https://github.com/ODM2/conda-recipes-ODM2

Questions?

http://xkcd.com/1629/

The ODM2 Conda Channel April 29th