-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of the gsl feedstock.
- Loading branch information
Travis-CI on github.com/conda-forge/staged-recipes
committed
Mar 9, 2016
0 parents
commit 4c30eba
Showing
11 changed files
with
423 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pyc | ||
|
||
build_artefacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
# This file was generated automatically from conda-smithy. To update this configuration, | ||
# update the conda-forge.yaml and/or the recipe/meta.yaml. | ||
|
||
language: objective-c | ||
|
||
|
||
|
||
|
||
install: | ||
- | | ||
MINICONDA_URL="http://repo.continuum.io/miniconda" | ||
MINICONDA_FILE="Miniconda3-3.7.3-MacOSX-x86_64.sh" | ||
wget "${MINICONDA_URL}/${MINICONDA_FILE}" | ||
bash $MINICONDA_FILE -b | ||
export PATH=/Users/travis/miniconda3/bin:$PATH | ||
conda update --yes conda | ||
conda install --yes conda-build jinja2 anaconda-client | ||
conda config --add channels conda-forge | ||
script: | ||
- conda build ./recipe | ||
|
||
after_success: | ||
|
||
- ./ci_support/upload_or_check_non_existence.py ./recipe conda-forge --channel=main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BSD 3-clause license | ||
Copyright (c) conda-forge | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
About gsl | ||
========= | ||
|
||
Home: http://www.gnu.org/software/gsl/ | ||
|
||
Package license: GPL-3.0 | ||
|
||
Feedstock license: BSD | ||
|
||
Summary: GNU Scientific Library | ||
|
||
|
||
|
||
Installing gsl | ||
============== | ||
|
||
Installing gsl from the conda-forge channel can be achieved by adding conda-forge to your channels with: | ||
|
||
``` | ||
conda config --add channels conda-forge | ||
``` | ||
|
||
Once the conda-forge channel has been enabled, gsl can be installed with: | ||
|
||
``` | ||
conda install gsl | ||
``` | ||
|
||
It is possible to list all of the versions of gsl available on your platform with: | ||
|
||
``` | ||
conda search gsl --channel conda-forge | ||
``` | ||
|
||
|
||
About conda-forge | ||
================= | ||
|
||
conda-forge is a community-led conda channel of installable packages. | ||
In order to provide high-quality builds, the process has been automated into the | ||
conda-forge GitHub organization. The conda-forge organization contains one repository | ||
for each of the installable packages. Such a repository is known as a *feedstock*. | ||
|
||
A feedstock is made up of a conda recipe (the instructions on what and how to build | ||
the package) and the necessary configurations for automatic building using freely | ||
available continuous integration services. Thanks to the awesome service provided by | ||
[CircleCI](https://circleci.com/), [AppVeyor](http://www.appveyor.com/) | ||
and [TravisCI](https://travis-ci.org/) it is possible to build and upload installable | ||
packages to the [conda-forge](https://anaconda.org/conda-forge) | ||
[Anaconda-Cloud](http://docs.anaconda.org/) channel for Linux, Windows and OSX respectively. | ||
|
||
To manage the continuous integration and simplify feedstock maintenance | ||
[conda-smithy](http://github.com/conda-forge/conda-smithy) has been developed. | ||
Using the ``conda-forge.yml`` within this repository, it is possible to regenerate all of | ||
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy regenerate``. | ||
|
||
|
||
Terminology | ||
=========== | ||
|
||
**feedstock** - the conda recipe (raw material), supporting scripts and CI configuration. | ||
|
||
**conda-smithy** - the tool which helps orchestrate the feedstock. | ||
Its primary use is in the construction of the CI ``.yml`` files | ||
and simplify the management of *many* feedstocks. | ||
|
||
**conda-forge** - the place where the feedstock and smithy live and work to | ||
produce the finished article (built conda distributions) | ||
|
||
Current build status | ||
==================== | ||
Linux: [![Circle CI](https://circleci.com/gh/conda-forge/gsl-feedstock.svg?style=svg)](https://circleci.com/gh/conda-forge/gsl-feedstock) | ||
OSX: [![TravisCI](https://travis-ci.org/conda-forge/gsl-feedstock.svg?branch=master)](https://travis-ci.org/conda-forge/gsl-feedstock) | ||
Windows: [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/conda-forge/gsl-feedstock?svg=True)](https://ci.appveyor.com/project/conda-forge/gsl-feedstock/branch/master) | ||
|
||
|
||
Updating gsl-feedstock | ||
====================== | ||
|
||
If you would like to improve the gsl recipe, please take the normal | ||
route of forking this repository and submitting a PR. Upon submission, your changes will | ||
be run on the appropriate platforms to give the reviewer an opportunity to confirm that the | ||
changes result in a successful build. Once merged, the recipe will be re-built and uploaded | ||
automatically to the conda-forge channel, whereupon they will be available for everybody to | ||
install and use. | ||
|
||
In order to produce a uniquely identifiable distribution: | ||
* If the version of a package **is not** being increased, please add or increase | ||
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string). | ||
* If the version of a package **is** being increased, please remember to return | ||
the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string) | ||
back to 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
# This file was automatically generated by conda-smithy. To update a component of this | ||
# file, make changes to conda-forge.yaml and/or recipe/meta.yaml, and run | ||
# "conda-smithy regenerate". | ||
|
||
environment: | ||
|
||
CONDA_INSTALL_LOCN: "C:\\conda" | ||
|
||
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the | ||
# /E:ON and /V:ON options are not enabled in the batch script intepreter | ||
# See: http://stackoverflow.com/a/13751649/163740 | ||
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd" | ||
|
||
# We set a default Python version for the miniconda that is to be installed. This can be | ||
# overridden in the matrix definition where appropriate. | ||
CONDA_PY: "27" | ||
|
||
BINSTAR_TOKEN: | ||
# Generated with "binstar auth --create --name appveyor -o conda-forge" and encrypted on ci.appveyor.com/tools/encrypt. | ||
secure: wtylLGtp/ID3G3DFT2uxuLFXuijFqmxI6phj60izpNC3pxd585bR6k2oonf5iGGb | ||
|
||
matrix: | ||
- TARGET_ARCH: x86 | ||
- TARGET_ARCH: x64 | ||
|
||
|
||
# We always use a 64-bit machine, but can build x86 distributions | ||
# with the TARGET_ARCH variable. | ||
platform: | ||
- x64 | ||
|
||
install: | ||
# Cywing's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) | ||
- cmd: rmdir C:\cygwin /s /q | ||
- appveyor DownloadFile "https://raw.githubusercontent.com/pelson/Obvious-CI/master/bootstrap-obvious-ci-and-miniconda.py" | ||
- cmd: python bootstrap-obvious-ci-and-miniconda.py %CONDA_INSTALL_LOCN% %TARGET_ARCH% %CONDA_PY:~0,1% --without-obvci | ||
- cmd: set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH% | ||
- cmd: set PYTHONUNBUFFERED=1 | ||
|
||
- cmd: conda install -c http://conda.binstar.org/pelson/channel/development --yes --quiet obvious-ci | ||
- cmd: conda config --add channels http://conda.binstar.org/conda-forge | ||
- cmd: conda info | ||
- cmd: conda install -n root --quiet --yes conda-build anaconda-client jinja2 setuptools | ||
|
||
# Skip .NET project specific build phase. | ||
build: off | ||
|
||
test_script: | ||
- "%CMD_IN_ENV% conda build recipe --quiet" | ||
deploy_script: | ||
|
||
- 'python ci_support\upload_or_check_non_existence.py .\recipe conda-forge --channel=main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
# NOTE: This script has been automatically generated by github.com/conda-forge/conda-smithy/... | ||
|
||
FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) | ||
RECIPE_ROOT=$FEEDSTOCK_ROOT/recipe | ||
|
||
docker info | ||
|
||
config=$(cat <<CONDARC | ||
channels: | ||
- conda-forge | ||
- defaults # As we need conda-build | ||
conda-build: | ||
root-dir: /feedstock_root/build_artefacts | ||
show_channel_urls: True | ||
CONDARC | ||
) | ||
|
||
cat << EOF | docker run -i \ | ||
-v ${RECIPE_ROOT}:/recipe_root \ | ||
-v ${FEEDSTOCK_ROOT}:/feedstock_root \ | ||
-a stdin -a stdout -a stderr \ | ||
pelson/obvious-ci:latest_x64 \ | ||
bash || exit $? | ||
export BINSTAR_TOKEN=${BINSTAR_TOKEN} | ||
export PYTHONUNBUFFERED=1 | ||
echo "$config" > ~/.condarc | ||
# A lock sometimes occurs with incomplete builds. The lock file is stored in build_artefacts. | ||
conda clean --lock | ||
conda info | ||
# Embarking on 1 case(s). | ||
set -x | ||
set +x | ||
conda build /recipe_root --quiet || exit 1 | ||
/feedstock_root/ci_support/upload_or_check_non_existence.py /recipe_root conda-forge --channel=main || exit 1 | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
|
||
import argparse | ||
import hashlib | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
from binstar_client.utils import get_binstar | ||
import binstar_client.errors | ||
import conda.config | ||
from conda_build.metadata import MetaData | ||
from conda_build.build import bldpkg_path | ||
|
||
|
||
def built_distribution_already_exists(cli, meta, owner): | ||
""" | ||
Checks to see whether the built recipe (aka distribution) already | ||
exists on the owner/user's binstar account. | ||
""" | ||
distro_name = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) | ||
fname = bldpkg_path(meta) | ||
try: | ||
dist_info = cli.distribution(owner, meta.name(), meta.version(), | ||
distro_name) | ||
except binstar_client.errors.NotFound: | ||
dist_info = {} | ||
|
||
exists = bool(dist_info) | ||
# Unfortunately, we cannot check the md5 quality of the built distribution, as | ||
# this will depend on fstat information such as modification date (because | ||
# distributions are tar files). Therefore we can only assume that the distribution | ||
# just built, and the one on anaconda.org are the same. | ||
# if exists: | ||
# md5_on_binstar = dist_info.get('md5') | ||
# with open(fname, 'rb') as fh: | ||
# md5_of_build = hashlib.md5(fh.read()).hexdigest() | ||
# | ||
# if md5_on_binstar != md5_of_build: | ||
# raise ValueError('This build ({}), and the build already on binstar ' | ||
# '({}) are different.'.format(md5_of_build, md5_on_binstar)) | ||
return exists | ||
|
||
|
||
def upload(cli, meta, owner, channels): | ||
try: | ||
with open('binstar.token', 'w') as fh: | ||
fh.write(cli.token) | ||
subprocess.check_call(['anaconda', '--quiet', '-t', 'binstar.token', | ||
'upload', bldpkg_path(meta), | ||
'--user={}'.format(owner), | ||
'--channel={}'.format(channels)], | ||
env=os.environ) | ||
finally: | ||
os.remove('binstar.token') | ||
|
||
|
||
def distribution_exists_on_channel(binstar_cli, meta, owner, channel='main'): | ||
""" | ||
Determine whether a distribution exists on a specific channel. | ||
Note from @pelson: As far as I can see, there is no easy way to do this on binstar. | ||
""" | ||
fname = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) | ||
distributions_on_channel = [dist['basename'] for dist in | ||
binstar_cli.show_channel(owner=owner, channel=channel)['files']] | ||
return fname in distributions_on_channel | ||
|
||
|
||
def add_distribution_to_channel(binstar_cli, meta, owner, channel='main'): | ||
""" | ||
Add a(n already existing) distribution on binstar to another channel. | ||
Note - the addition is done based on name and version - no build strings etc. | ||
so if you have a foo-0.1-np18 and foo-0.1-np19 *both* will be added to the channel. | ||
""" | ||
package_fname = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) | ||
binstar_cli.add_channel(channel, owner, meta.name(), meta.version()) | ||
|
||
|
||
def main(): | ||
token = os.environ.get('BINSTAR_TOKEN') | ||
|
||
description = ('Upload or check consistency of a built version of a ' | ||
'conda recipe with binstar. Note: The existence of the ' | ||
'BINSTAR_TOKEN environment variable determines ' | ||
'whether the upload should actually take place.') | ||
parser = argparse.ArgumentParser(description=description) | ||
parser.add_argument('recipe_dir', help='the conda recipe directory') | ||
parser.add_argument('owner', help='the binstar owner/user') | ||
parser.add_argument('--channel', help='the binstar channel', default='main') | ||
args = parser.parse_args() | ||
recipe_dir, owner, channel = args.recipe_dir, args.owner, args.channel | ||
|
||
cli = get_binstar(argparse.Namespace(token=token, site=None)) | ||
meta = MetaData(recipe_dir) | ||
if meta.skip(): | ||
print("No upload to take place - this configuration was skipped in build/skip.") | ||
return | ||
exists = built_distribution_already_exists(cli, meta, owner) | ||
if token: | ||
on_channel = distribution_exists_on_channel(cli, meta, owner, channel) | ||
if not exists: | ||
upload(cli, meta, owner, channel) | ||
print('Uploaded {}'.format(bldpkg_path(meta))) | ||
elif not on_channel: | ||
print('Adding distribution {} to {}\'s {} channel' | ||
''.format(bldpkg_path(meta), owner, channel)) | ||
add_distribution_to_channel(cli, meta, owner, channel) | ||
else: | ||
print('Distribution {} already \nexists on {}\'s {} channel.' | ||
''.format(bldpkg_path(meta), owner, channel)) | ||
else: | ||
print("No BINSTAR_TOKEN present, so no upload is taking place. " | ||
"The distribution just built {} already available on {}'s " | ||
"{} channel.".format('is' if exists else 'is not', | ||
owner, channel)) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
machine: | ||
services: | ||
- docker | ||
|
||
dependencies: | ||
# Note, we used to use the naive caching of docker images, but found that it was quicker | ||
# just to pull each time. #rollondockercaching | ||
override: | ||
- docker pull pelson/obvious-ci:latest_x64 | ||
# - docker pull pelson/conda32_obvious_ci | ||
|
||
test: | ||
override: | ||
# Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. | ||
- ./ci_support/run_docker_build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
Oops, something went wrong.