Skip to content

Commit

Permalink
Initial feedstock commit with conda-smithy 2.4.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis-CI on github.com/conda-forge/staged-recipes committed Oct 31, 2017
0 parents commit 62ebdf4
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2

jobs:
build:
working_directory: ~/test
machine: true
steps:
- checkout
- run:
name: Fast finish outdated PRs and merge PRs
command: |
./ci_support/fast_finish_ci_pr_build.sh
./ci_support/checkout_merge_commit.sh
- run:
command: docker pull condaforge/linux-anvil
- run:
# Run, test and (if we have a BINSTAR_TOKEN) upload the distributions.
command: ./ci_support/run_docker_build.sh

workflows:
version: 2
build_and_test:
jobs:
- build
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto

*.patch binary
*.diff binary
meta.yaml text eol=lf
build.sh text eol=lf
bld.bat text eol=crlf
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc

build_artefacts
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
BSD 3-clause license
Copyright (c) 2015-2017, 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.
106 changes: 106 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
About imbalanced-learn
======================

Home: https://github.com/scikit-learn-contrib/imbalanced-learn

Package license: MIT

Feedstock license: BSD 3-Clause

Summary: Python module to balance data set using under- and over-sampling

imbalanced-learn is a python package offering a number of re-sampling
techniques commonly used in datasets showing strong between-class imbalance.
It is compatible with scikit-learn and is part of scikit-learn-contrib
projects.


Current build status
====================

All platforms: [![Circle CI](https://circleci.com/gh/conda-forge/imbalanced-learn-feedstock.svg?style=shield)](https://circleci.com/gh/conda-forge/imbalanced-learn-feedstock)

Current release info
====================
Version: [![Anaconda-Server Badge](https://anaconda.org/conda-forge/imbalanced-learn/badges/version.svg)](https://anaconda.org/conda-forge/imbalanced-learn)
Downloads: [![Anaconda-Server Badge](https://anaconda.org/conda-forge/imbalanced-learn/badges/downloads.svg)](https://anaconda.org/conda-forge/imbalanced-learn)

Installing imbalanced-learn
===========================

Installing `imbalanced-learn` 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, `imbalanced-learn` can be installed with:

```
conda install imbalanced-learn
```

It is possible to list all of the versions of `imbalanced-learn` available on your platform with:

```
conda search imbalanced-learn --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 re-render all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``.

For more information please check the [conda-forge documentation](https://conda-forge.org/docs/).

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)


Updating imbalanced-learn-feedstock
===================================

If you would like to improve the imbalanced-learn recipe or build a new
package version, please fork this repository and submit 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 the built conda packages will be available for
everybody to install and use from the `conda-forge` channel.
Note that all branches in the conda-forge/imbalanced-learn-feedstock are
immediately built and any created packages are uploaded, so PRs should be based
on branches in forks and branches in the main repository should only be used to
build distinct package versions.

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.
27 changes: 27 additions & 0 deletions ci_support/checkout_merge_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash


# Update PR refs for testing.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head"
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Retrieve the refs.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git fetch -u origin ${FETCH_REFS}
fi

# Checkout the PR merge ref.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Check for merge conflicts.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
fi
4 changes: 4 additions & 0 deletions ci_support/fast_finish_ci_pr_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

curl https://raw.githubusercontent.com/conda-forge/conda-forge-build-setup-feedstock/master/recipe/ff_ci_pr_build.py | \
python - -v --ci "circle" "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" "${CIRCLE_BUILD_NUM}" "${CIRCLE_PR_NUMBER}"
70 changes: 70 additions & 0 deletions ci_support/run_docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash

# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here
# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent
# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also
# benefit from the improvement.

FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;)
RECIPE_ROOT=$FEEDSTOCK_ROOT/recipe

docker info

config=$(cat <<CONDARC
channels:
- conda-forge
- defaults
conda-build:
root-dir: /feedstock_root/build_artefacts
show_channel_urls: true
CONDARC
)

# In order for the conda-build process in the container to write to the mounted
# volumes, we need to run with the same id as the host machine, which is
# normally the owner of the mounted volumes, or at least has write permission
HOST_USER_ID=$(id -u)
# Check if docker-machine is being used (normally on OSX) and get the uid from
# the VM
if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then
HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u)
fi

rm -f "$FEEDSTOCK_ROOT/build_artefacts/conda-forge-build-done"

cat << EOF | docker run -i \
-v "${RECIPE_ROOT}":/recipe_root \
-v "${FEEDSTOCK_ROOT}":/feedstock_root \
-e HOST_USER_ID="${HOST_USER_ID}" \
-a stdin -a stdout -a stderr \
condaforge/linux-anvil \
bash || exit 1
set -e
set +x
export BINSTAR_TOKEN=${BINSTAR_TOKEN}
set -x
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 install --yes --quiet conda-forge-build-setup
source run_conda_forge_build_setup
conda build /recipe_root --quiet || exit 1
upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1
touch /feedstock_root/build_artefacts/conda-forge-build-done
EOF

# double-check that the build got to the end
# see https://github.com/conda-forge/conda-smithy/pull/337
# for a possible fix
set -x
test -f "$FEEDSTOCK_ROOT/build_artefacts/conda-forge-build-done" || exit 1
1 change: 1 addition & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
53 changes: 53 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% set name = "imbalanced-learn" %}
{% set version = "0.3.1" %}
{% set sha256 = "5dfd6773b5f5e067ebcc6b032907ce721227a2f2eb0b684f3b169c65a10b5257" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
fn: {{ name }}-{{ version }}.tar.gz
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: {{ sha256 }}

build:
noarch: python
number: 0
script: python setup.py install --single-version-externally-managed --record record.txt

requirements:
build:
- python
- setuptools
- numpy >=1.9
- scipy
- scikit-learn 0.19.*

run:
- python
- numpy >=1.9
- scipy
- scikit-learn 0.19.*

test:
imports:
- imblearn

about:
home: https://github.com/scikit-learn-contrib/imbalanced-learn
license: MIT
license_family: MIT
license_file: LICENSE
summary: 'Python module to balance data set using under- and over-sampling'
description: |
imbalanced-learn is a python package offering a number of re-sampling
techniques commonly used in datasets showing strong between-class imbalance.
It is compatible with scikit-learn and is part of scikit-learn-contrib
projects.
doc_url: http://contrib.scikit-learn.org/imbalanced-learn
dev_url: https://github.com/scikit-learn-contrib/imbalanced-learn

extra:
recipe-maintainers:
- glemaitre

0 comments on commit 62ebdf4

Please sign in to comment.