Skip to content

Commit

Permalink
Merge pull request #1 from jakirkham/add-zwatershed_2
Browse files Browse the repository at this point in the history
Add zwatershed (Pt. 2)
  • Loading branch information
Chandan committed Jul 19, 2016
2 parents 3df7c78 + 138bc90 commit 3896d3f
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 136 deletions.
2 changes: 0 additions & 2 deletions .CI/create_feedstocks
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ if [ -n "$GH_TOKEN" ]; then
conda config --set show_channel_urls true
conda config --add channels conda-forge
conda install --yes --quiet conda-smithy
# Temporary workaround b/c conda-build-all is not ready for the latest conda-build.
conda install -n root --yes --quiet conda-build=1.20.1

python .CI/create_feedstocks.py
fi
67 changes: 38 additions & 29 deletions .CI/create_feedstocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,30 @@ def create_team(org, name, description, repo_names):
)
return Team.Team(org._requester, headers, data, completed=True)

def print_rate_limiting_info(gh):
# Compute some info about our GitHub API Rate Limit.
# Note that it doesn't count against our limit to
# get this info. So, we should be doing this regularly
# to better know when it is going to run out. Also,
# this will help us better understand where we are
# spending it and how to better optimize it.

# Get GitHub API Rate Limit usage and total
gh_api_remaining, gh_api_total = gh.rate_limiting

# Compute time until GitHub API Rate Limit reset
gh_api_reset_time = gh.rate_limiting_resettime
gh_api_reset_time = datetime.utcfromtimestamp(gh_api_reset_time)
gh_api_reset_time -= datetime.utcnow()

print("")
print("GitHub API Rate Limit Info:")
print("---------------------------")
print("Currently remaining {remaining} out of {total}.".format(remaining=gh_api_remaining, total=gh_api_total))
print("Will reset in {time}.".format(time=gh_api_reset_time))
print("")



if __name__ == '__main__':
is_merged_pr = (os.environ.get('TRAVIS_BRANCH') == 'master' and os.environ.get('TRAVIS_PULL_REQUEST') == 'false')
Expand All @@ -102,8 +126,14 @@ def write_token(name, token):
write_token('appveyor', os.environ['APPVEYOR_TOKEN'])
if 'CIRCLE_TOKEN' in os.environ:
write_token('circle', os.environ['CIRCLE_TOKEN'])
gh = None
if 'GH_TOKEN' in os.environ:
write_token('github', os.environ['GH_TOKEN'])
gh = Github(os.environ['GH_TOKEN'])

# Get our initial rate limit info.
print_rate_limiting_info(gh)


owner_info = ['--organization', 'conda-forge']

Expand All @@ -125,8 +155,8 @@ def write_token(name, token):
feedstock_dirs.append([feedstock_dir, name, recipe_dir])

subprocess.check_call(['git', 'remote', 'add', 'upstream_with_token',
'https://conda-forge-admin:{}@github.com/conda-forge/{}'.format(os.environ['GH_TOKEN'],
os.path.basename(feedstock_dir))],
'https://conda-forge-manager:{}@github.com/conda-forge/{}'.format(os.environ['GH_TOKEN'],
os.path.basename(feedstock_dir))],
cwd=feedstock_dir)

# Sometimes we already have the feedstock created. We need to deal with that case.
Expand All @@ -141,34 +171,9 @@ def write_token(name, token):
else:
subprocess.check_call(['conda', 'smithy', 'register-github', feedstock_dir] + owner_info)

gh = None
conda_forge = None
teams = None
if 'GH_TOKEN' in os.environ:
gh = Github(os.environ['GH_TOKEN'])

# Compute some info about our GitHub API Rate Limit.
# Note that it doesn't count against our limit to
# get this info. So, we should be doing this regularly
# to better know when it is going to run out. Also,
# this will help us better understand where we are
# spending it and how to better optimize it.

# Get GitHub API Rate Limit usage and total
gh_api_used, gh_api_total = gh.rate_limiting

# Compute time until GitHub API Rate Limit reset
gh_api_reset_time = gh.rate_limiting_resettime
gh_api_reset_time = datetime.utcfromtimestamp(gh_api_reset_time)
gh_api_reset_time -= datetime.utcnow()

print("")
print("GitHub API Rate Limit Info:")
print("---------------------------")
print("Currently used {used} out of {total}.".format(used=gh_api_used, total=gh_api_total))
print("Will reset in {time}.".format(time=gh_api_reset_time))
print("")

if gh:
# Only get the org and teams if there is stuff to add.
if feedstock_dirs:
conda_forge = gh.get_organization('conda-forge')
Expand Down Expand Up @@ -259,11 +264,15 @@ def write_token(name, token):
if is_merged_pr:
# Capture the output, as it may contain the GH_TOKEN.
out = subprocess.check_output(['git', 'remote', 'add', 'upstream_with_token',
'https://conda-forge-admin:{}@github.com/conda-forge/staged-recipes'.format(os.environ['GH_TOKEN'])],
'https://conda-forge-manager:{}@github.com/conda-forge/staged-recipes'.format(os.environ['GH_TOKEN'])],
stderr=subprocess.STDOUT)
subprocess.check_call(['git', 'commit', '-m', msg])
# Capture the output, as it may contain the GH_TOKEN.
out = subprocess.check_output(['git', 'push', 'upstream_with_token', os.environ.get('TRAVIS_BRANCH')],
stderr=subprocess.STDOUT)
else:
print('Would git commit, with the following message: \n {}'.format(msg))

if gh:
# Get our final rate limit info.
print_rate_limiting_info(gh)
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ env:
# Add the BINSTAR_TOKEN environment variable. This has been generated with "" then "travis encrypt BINSTAR_TOKEN=<token_id>"
- secure: "WgworyUp3oy/lyP3Dd+1bxs13rAyjbGqwWLK1XQUUOkHV6uKt5ZHFBbKRtYDnrQLSx9aAu/DDbh47L1nE1XL4C7u+S018GL+w7UBwGHkWHxBkr0TlYeVGCtjCo0QXk//L+JJXfnQ/2voCeqUkypD/O28vUfreVaXBpjnRlAzYmysFoDYl86/+nxKcSRW9+twbKk5xWroyDF+Ed7lCmXvqGWKMcOu14Wp30C2hKi3lfPyV3AzQ/lSQmwDcoCVIMsUE4+AFZAhub3T6C/EWURgfMjoX861iG/9vgJgnLdn3TsVW3WN88b8b+AR3EstnBL4ZJcpS1BwPF1hj9ER5av4vGkn39ahKVhWvUJO04Z+L7Ag8uoSypQsSAjlm7g82nph7EcpjymZ2BW0kqShs4jLwz3iO7I/ipjUYwlgAXInsTRgBjwbdf8YOKJYVnoLZNiv5seRow6BiVPNEmiQ3z9GH2Xt1emVxYdCcMscvyqmTQeZrQKHsseo5BoENh4Rq86CKtP9Orx1tIWrZ1Ujbfx4MpXFBbkzB6wNb+KZ+xPv3uD7DrWdaurZ2Kgm6HBY8YYHyq286halRZ3ngPXHgVW7aRVr5yH/uw8hXGr64cboIXhqt7wgZaHFy1BXAVfyqsNAB3qkisQEQSXmB4R8l7gua+zVNaOwz7LjW0mzcCpQhz8="

# Add the GH_TOKEN environment variable. (This is the "conda-forge.github.io" token for the conda-forge-admin user.)
- secure: "hT3MZHjghHcNSTb0ILwP6aErtiYNN2mf+CKNaFeGBfDv9MjhNAWnph92Kx+hsPRKa3GWLEqUpLQo33ynvesj430Ok1qeQK9BrM2/3YHDxpWkvG+dHTg2+dmKlveYIVG+SUeU+g/vERVwryOYj73tMH/vC53u6PNcaTeuphzI3pKOcoxYmchzVLAJCMEXtI8MPXchFKIwRxkj2DcN1ApJm0ZeBnegvsH5VeCVkbDOEMwOylCFV7JcywN2pIh7aE7cWrm3HTEmC26E2O0k6K0h666Hpgh7Ia9wDViyt3GAopTUcR2+9fyeQ8RK3CJVbDnRPTgt92EKUpuMTvsEVOpdFFyJXcmEqyd89ZGGnvXQHQADIFJJBRyT0qb2I3haytV3u5UiWtBMwuGaURILxvUb33x+KDKTfeS0DtV6O18H+BGkFcj5UUVRICk0wob1B9NTFGlukeQRM5rzrz5uTA/SOVYHEyFca5EsHa0Iq0T8ec3bsNj7/qH9ecvcVJCE1pOGPrgb89pshfe5LB36mwgan1YwkvtHxlBtb/0WT8bwc0fCuO8Q720lprJ6wu3fF4rM4vHGn99fgjcu7LnjXixw9chg1IraUO5LLjJJDJYlbv4+Lu5+2jrt99cQSmpjIhYqNLbBd2UQvbNxj/wDsKun1knjRhkUqClvu8plk8crARc="
# Add the GH_TOKEN environment variable. (This is the "conda-forge.github.io" token for the conda-forge-manager user.)
- secure: "QVcAIw1ezgkfZ70nNQBsr03V9tzXv0Hb+mw759gNo1CBbydYTO5EutWUt/Nks6E12/SkX5I3CmlAHZC74dQXVzQVyU/+hdc0El2N51gkvJ02dua7701ClqOHbkZSPGxE2j/S7ERzJKdtH97N0EGILP9wnadQJs5kpF9MvB1oWOQmDmsGMZ6GGlj2FMfL/TmtNR4ADo8rxr/ylw1kX8anfrXCv7FShdviugpsjSpAQLShKbdeDPdhvrD8W0TlpUhgdgSU2kPXd6gfGKuety1EWh56MgarHg+unntvB8R2W0O07RgOiRa/Mplmeng18dUCJdT1i3rczB2BkeyeFeCihtXqa0KDx7bX4z1X+4YFrBNl/bnDeVijaBtvkK3T0lluVnmVWolRzO9Tc2LozzAUEhDih4QFL6QtxQP2NkRFY2xEcj0JWbBNvDCik7hakiuxBSSbzGr1/3zw2sRh35/6qB6Y7mE6a5Pk+MS1ExS3Z8YUp4Q9l589DeyBCNE6HQHwEdvzEPUW74Lm566lzhsI8D4IuVYZDZLi/HHPzfPav4WWj5jiwlLx9XOkfPgz6ezqLoThkKSp5JmpXxxWzrckOMzFOyUqqD9h7De80uJqM/SW926fCr4RrrExcimblNV0ro9SSHUUvw+ZEFM51P7Z2m6ATBMO7/lVQtpj4XCbs6M="

# Add the CIRCLE_TOKEN environment variable. (This will need re-generating in the near future using the conda-forge-admin user)
- secure: "XL4LyXKdyrKDGLj5LbWyoZij3+p4qsxR8kRZyHaaDhes7QipDGTVgUVylFagsC0sdY8Osi19pY2oZnzDwfkO66lL0cswRUfjIs7XHDv7jMX3aIL1awykkp2YWJvUtqw2yY58nRRcAoWXWuaIKa7gjBm8b2Rnx60GWwudEqzCsNjq29uePYHQyRSwHbK99mliwVz7TLt994S41TJzAp+expRvBO/bvBnDvDK1ZAm0P6v5HSCJJt8or+PmP5Au8LuEIIZbKM2KmQeaWqkYz09f4NWuA/lVqaQucv+eR/46QXWhLyp4pC56xeD/oTfi48u4skjLlRamtLKQ3YspL7fuKYtV+EGKwY/xAUyeLei10kE2OaBr66S+OhUkQYSgkeqdJuvKznImqCF4CGYyoOmdqqDy8lXVi2VcTqzHT8UxdVpc6CPiifczIAii34qdbpcUQRFnYm+5tWBQ8F1swM5ZihIE7t9wl3eoHjNxTFxF65DlNoUkHUfWb08luof83kNQapI9P8oplmrw46MAQFbd54NPbRruExvimCQm3FXbrWi0vLUzNcEn7QIautZJMpW8MKkQZBzlIpkH9P2THZcqvoJLx2uuKaF982vYnrgqgegxzIw10MIUUsTXF3jXdLPh9yo/4ewvK3G9SmJaidUmyoAPJrbej9Y25nMYYzOFDxo="
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Adding your package to conda-forge
----------------------------------

1. Fork this repository.
2. Make a new folder in `recipes` for your package. Look at the example recipe and our [FAQ](https://github.com/conda-forge/staged-recipes/wiki/Frequently-asked-questions) for help.
3. Open a pull request. Building of your package will be tested on Windows, Mac and Linux.
4. When your pull request is merged a new repository, called a feedstock, will be create in the github conda-forge organization, and build/upload of your package will automatically be triggered. Once complete, the package is available on conda-forge.

About
-----

Expand Down
22 changes: 17 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,27 @@ environment:
- TARGET_ARCH: "x86"
CONDA_PY: "27"
PY_CONDITION: "python >=2.7,<3"
CONDA_INSTALL_LOCN: "C:\\Miniconda"
- TARGET_ARCH: "x86"
CONDA_PY: "34"
PY_CONDITION: "python >=3.4,<3.5"
CONDA_INSTALL_LOCN: "C:\\Miniconda3"
- TARGET_ARCH: "x86"
CONDA_PY: "35"
PY_CONDITION: "python >=3.5"
CONDA_INSTALL_LOCN: "C:\\Miniconda35"
- TARGET_ARCH: "x64"
CONDA_PY: "27"
PY_CONDITION: "python >=2.7,<3"
CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"
- TARGET_ARCH: "x64"
CONDA_PY: "34"
PY_CONDITION: "python >=3.4,<3.5"
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
- TARGET_ARCH: "x64"
CONDA_PY: "35"
PY_CONDITION: "python >=3.5"
CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"

artifacts:
# Store built conda packages as artifacts
Expand Down Expand Up @@ -64,11 +70,17 @@ install:
- cmd: rmdir C:\cygwin /s /q

# Use the pre-installed Miniconda for the desired arch
- ps: if($env:TARGET_ARCH -eq 'x86')
{$root = "C:\Miniconda"}
else
{$root = "C:\Miniconda-x64"}
$env:path="$root;$root\Scripts;$root\Library\bin;$($env:path)"
#
# However, it is really old. So, we need to update some
# things before we proceed. That seems to require it being
# on the path. So, we temporarily put conda on the path
# so that we can update it. Then we remove it so that
# we can do a proper activation.
- cmd: set "OLDPATH=%PATH%"
- cmd: set "PATH=%CONDA_INSTALL_LOCN%\\Scripts;%CONDA_INSTALL_LOCN%\\Library\\bin;%PATH%"
- cmd: conda update --yes --quiet conda
- cmd: set "PATH=%OLDPATH%"
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: conda config --add channels conda-forge
- cmd: conda config --set show_channel_urls true
- cmd: conda update --yes --quiet conda
Expand Down
2 changes: 0 additions & 2 deletions recipes/example/bld.bat

This file was deleted.

3 changes: 0 additions & 3 deletions recipes/example/build.sh

This file was deleted.

41 changes: 31 additions & 10 deletions recipes/example/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
{% set version = "1.0" %}
# Jinja variables help maintain the recipe as you'll update the version only here.
{% set version = "3.8.2" %}
{% set sha256 = "d58439c548433adcda98e695be53e526ba940a4b9c44fb9a05d92cd495cdd47f" %}

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

source:
git_url: https://github.com/conda-forge/staged-recipes.git
git_tag: 24507f6c6b2d2e03caee550e13830df15d791751
fn: simplejson-{{ version }}.tar.gz
url: https://pypi.io/packages/source/s/simplejson/simplejson-{{ version }}.tar.gz
# md5 is OK but sha256 is desirable.
sha256: {{ sha256 }}

build:
number: 0
# If the installation is complex, or different between Unix and Windows, use separate bld.bat and build.sh files instead of this key.
script: python setup.py install --single-version-externally-managed --record record.txt

requirements:
build:
- python
# When setuptools is available add the `--single-version-externally-managed --record record.txt` above.
- setuptools
run:
- python

test:
# Some package might need a `test/commands` key to check CLI.
imports:
- example
commands:
- python -c "import example;"
- simplejson
- simplejson.tests

about:
home: https://github.com/conda-forge/staged-recipes
license: BSD
summary: An example package
home: http://github.com/simplejson/simplejson
# Remember to specify the license variants for BSD, Apache, GPL, and LGLP.
# Prefer the short version, e.g: GPL-2.0 instead of GNU General Public License version 2.0
# See https://opensource.org/licenses/alphabetical
license: MIT
summary: 'Simple, fast, extensible JSON encoder/decoder for Python'

# The remaining entries in this section are optional, but recommended
description: |
simplejson is a simple, fast, complete, correct and extensible
JSON <http://json.org> encoder and decoder for Python 2.5+ and
Python 3.3+. It is pure Python code with no dependencies, but includes
an optional C extension for a serious speed boost.
doc_url: http://simplejson.readthedocs.io/
dev_url: https://github.com/simplejson/simplejson

extra:
recipe-maintainers:
# Always check with the people listed below if they are OK becoming maintainers of the recipe. (There will be spam!)
- HomerSimpson
- LukeSkywalker
37 changes: 0 additions & 37 deletions recipes/sphinx-bootstrap-theme/meta.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions recipes/tzlocal/meta.yaml

This file was deleted.

15 changes: 12 additions & 3 deletions recipes/zwatershed/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "zwatershed" %}
{% set version = "0.5" %}
{% set checksum = "df5b36634e38012e0fb3b2545d3bfc26" %}
{% set version = "0.8" %}
{% set checksum = "e48b08909ad95785d9adfee0d1f8d318" %}

package:
name: {{ name }}
Expand All @@ -14,10 +14,19 @@ source:
build:
skip: true # [win or py3k]
number: 0
script: python setup.py install --single-version-externally-managed --record record.txt
script:
# FIXME: This is a hack to make sure the environment is activated.
# The reason this is required is due to the conda-build issue
# mentioned below.
#
# https://github.com/conda/conda-build/issues/910
#
- source activate "${CONDA_DEFAULT_ENV}"
- python setup.py install --single-version-externally-managed --record record.txt

requirements:
build:
- toolchain
- boost 1.61.*
- python
- setuptools >=18.0
Expand Down

0 comments on commit 3896d3f

Please sign in to comment.