Repository: conda-forge/staged-recipes

Issue:
Last three recipes have failed on merge into master
Seems like we've hit an api limit in:

https://travis-ci.org/conda-forge/staged-recipes/builds/196331121

```
GitHub API Rate Limit Info:

---------------------------

Currently remaining 5000 out of 5000.

Will reset in 0:59:59.349455.

Calculating the recipes which need to be turned into feedstocks.

No local changes to save

Current branch master is up to date.

No stash found.

On branch master

Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

GitHub API Rate Limit Info:

---------------------------

Currently remaining 5000 out of 5000.

Will reset in 0:59:58.597998.
```


Discussion:
Actually that says that 5000 are remaining, so maybe we haven't hit the limit. Not sure why master is failing. This is the error:

```
Repository created, please edit conda-forge.yml to configure the upload channels

and afterwards call 'conda smithy register-github'

fatal: Cannot update paths and switch to branch 'master' at the same time.

Did you intend to checkout 'upstream_with_token/master' which can not be resolved as commit?

Switched to a new branch 'master'

CI Summary for conda-forge/jupyter-matplotlib-feedstock (can take ~30s):

 * Travis doesn't know about the repo, synching (takes a few seconds).

Unable to register the repo on Travis

(Is it down? Is the "conda-forge" name spelt correctly? [note: case sensitive])

Fetching package metadata .........

Fetching package metadata .........

Fetching package metadata .........

Fetching package metadata ...........

Fetching package metadata ...........

Re-rendered with conda-smithy 2.0.1.

No changes made. This feedstock is up-to-date.

On branch master

nothing to commit, working directory clean

Traceback (most recent call last):

  File ".CI/create_feedstocks.py", line 203, in <module>

    subprocess.check_call(['git', 'commit', '-am', "Re-render the feedstock after CI registration."], cwd=feedstock_dir)

  File "/Users/travis/miniconda/lib/python2.7/subprocess.py", line 541, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['git', 'commit', '-am', 'Re-render the feedstock after CI registration.']' returned non-zero exit status 1
```
The only solution is to wait  ;-p
Got it. But should the message say "Currently remaining 0 out of 5000"?
I read your message not the error  (only on the phone now). I will take a better look tomorrow. 

Resolving patch:
diff --git a/.CI/create_feedstocks.py b/.CI/create_feedstocks.py
--- a/.CI/create_feedstocks.py
+++ b/.CI/create_feedstocks.py
@@ -47,7 +47,7 @@ def list_recipes():
         if recipe_dir.startswith('example'):
             continue
         path = os.path.abspath(os.path.join(recipe_directory_name, recipe_dir))
-        yield path, recipe_dir
+        yield path, MetaData(path).name()
 
 
 @contextmanager
@@ -159,11 +159,11 @@ def write_token(name, token):
 
             subprocess.check_call(['git', 'remote', 'add', 'upstream_with_token',
                                    'https://conda-forge-manager:{}@github.com/conda-forge/{}'.format(os.environ['GH_TOKEN'],
-                                                                                                     os.path.basename(feedstock_dir))],
+                                                                                                     name)],
                                   cwd=feedstock_dir)
 
             # Sometimes we already have the feedstock created. We need to deal with that case.
-            if repo_exists('conda-forge', os.path.basename(feedstock_dir)):
+            if repo_exists('conda-forge', name):
                 subprocess.check_call(['git', 'fetch', 'upstream_with_token'], cwd=feedstock_dir)
                 subprocess.check_call(['git', 'branch', '-m', 'master', 'old'], cwd=feedstock_dir)
                 try:
@@ -227,7 +227,7 @@ def write_token(name, token):
                 maintainers = set(meta.meta.get('extra', {}).get('recipe-maintainers', []))
                 all_maintainers.update(maintainers)
                 team_name = name.lower()
-                repo_name = 'conda-forge/{}'.format(os.path.basename(feedstock_dir))
+                repo_name = 'conda-forge/{}'.format(name)
 
                 # Try to get team or create it if it doesn't exist.
                 team = teams.get(team_name)


Test patch: