We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Latest conda-smithy is prevent poliastro feedstock creation
```
Repository registered at github, now call 'conda smithy register-ci'
Making feedstock for poliastro
/Users/travis/build/conda-forge/staged-recipes/recipes/poliastro has some lint:
  Selectors are suggested to take a "  # [<selector>]" form.
Traceback (most recent call last):
  File ".CI/create_feedstocks.py", line 93, in <module>
    subprocess.check_call(['conda', 'smithy', 'recipe-lint', recipe_dir])
  File "/Users/travis/miniconda/lib/python3.5/subprocess.py", line 584, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['conda', 'smithy', 'recipe-lint', '/Users/travis/build/conda-forge/staged-recipes/recipes/poliastro']' returned non-zero exit status 1
```

I am working on that.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `.CI/create_feedstocks.py`
Content:
```
1 #!/usr/bin/env python
2 """
3 Convert all recipes into feedstocks.
4 
5 This script is to be run in a TravisCI context, with all secret environment variables defined (BINSTAR_TOKEN, GH_TOKEN)
6 Such as:
7 
8     export GH_TOKEN=$(cat ~/.conda-smithy/github.token)
9 
10 """
11 from __future__ import print_function
12 
13 from conda_smithy.github import gh_token
14 from contextlib import contextmanager
15 from github import Github, GithubException
16 import os.path
17 import shutil
18 import subprocess
19 import tempfile
20 
21 
22 # Enable DEBUG to run the diagnostics, without actually creating new feedstocks.
23 DEBUG = False
24 
25 
26 def list_recipes():
27     recipe_directory_name = 'recipes'
28     if os.path.isdir(recipe_directory_name):
29         recipes = os.listdir(recipe_directory_name)
30     else:
31         recipes = []
32 
33     for recipe_dir in recipes:
34         # We don't list the "example" feedstock. It is an example, and is there
35         # to be helpful.
36         if recipe_dir.startswith('example'):
37             continue
38         path = os.path.abspath(os.path.join(recipe_directory_name, recipe_dir))
39         yield path, recipe_dir
40 
41 
42 @contextmanager
43 def tmp_dir(*args, **kwargs):
44     temp_dir = tempfile.mkdtemp(*args, **kwargs)
45     try:
46         yield temp_dir
47     finally:
48         shutil.rmtree(temp_dir)
49 
50 
51 def repo_exists(organization, name):
52     token = gh_token()
53     gh = Github(token)
54     # Use the organization provided.
55     org = gh.get_organization(organization)
56     try:
57         org.get_repo(name)
58         return True
59     except GithubException as e:
60         if e.status == 404:
61             return False
62         raise
63 
64 
65 if __name__ == '__main__':
66     is_merged_pr = (os.environ.get('TRAVIS_BRANCH') == 'master' and os.environ.get('TRAVIS_PULL_REQUEST') == 'false')
67 
68     smithy_conf = os.path.expanduser('~/.conda-smithy')
69     if not os.path.exists(smithy_conf):
70         os.mkdir(smithy_conf)
71 
72     def write_token(name, token):
73         with open(os.path.join(smithy_conf, name + '.token'), 'w') as fh:
74             fh.write(token)
75     if 'APPVEYOR_TOKEN' in os.environ:
76         write_token('appveyor', os.environ['APPVEYOR_TOKEN'])
77     if 'CIRCLE_TOKEN' in os.environ:
78         write_token('circle', os.environ['CIRCLE_TOKEN'])
79     if 'GH_TOKEN' in os.environ:
80         write_token('github', os.environ['GH_TOKEN'])
81 
82     owner_info = ['--organization', 'conda-forge']
83 
84     print('Calculating the recipes which need to be turned into feedstocks.')
85     removed_recipes = []
86     with tmp_dir('__feedstocks') as feedstocks_dir:
87         feedstock_dirs = []
88         for recipe_dir, name in list_recipes():
89             feedstock_dir = os.path.join(feedstocks_dir, name + '-feedstock')
90             os.mkdir(feedstock_dir)
91             print('Making feedstock for {}'.format(name))
92 
93             subprocess.check_call(['conda', 'smithy', 'recipe-lint', recipe_dir])
94 
95             subprocess.check_call(['conda', 'smithy', 'init', recipe_dir,
96                                    '--feedstock-directory', feedstock_dir])
97             if not is_merged_pr:
98                 # We just want to check that conda-smithy is doing its thing without having any metadata issues.
99                 continue
100 
101             feedstock_dirs.append([feedstock_dir, name, recipe_dir])
102 
103             subprocess.check_call(['git', 'remote', 'add', 'upstream_with_token',
104                                    'https://conda-forge-admin:{}@github.com/conda-forge/{}'.format(os.environ['GH_TOKEN'],
105                                                                                                    os.path.basename(feedstock_dir))],
106                                   cwd=feedstock_dir)
107 
108             # Sometimes we already have the feedstock created. We need to deal with that case.
109             if repo_exists('conda-forge', os.path.basename(feedstock_dir)):
110                 subprocess.check_call(['git', 'fetch', 'upstream_with_token'], cwd=feedstock_dir)
111                 subprocess.check_call(['git', 'branch', '-m', 'master', 'old'], cwd=feedstock_dir)
112                 try:
113                     subprocess.check_call(['git', 'checkout', '-b', 'master', 'upstream_with_token/master'], cwd=feedstock_dir)
114                 except subprocess.CalledProcessError:
115                     # Sometimes, we have a repo, but there are no commits on it! Just catch that case.
116                     subprocess.check_call(['git', 'checkout', '-b' 'master'], cwd=feedstock_dir)
117             else:
118                 subprocess.check_call(['conda', 'smithy', 'register-github', feedstock_dir] + owner_info)
119 
120         # Break the previous loop to allow the TravisCI registering to take place only once per function call.
121         # Without this, intermittent failiures to synch the TravisCI repos ensue.
122         for feedstock_dir, name, recipe_dir in feedstock_dirs:
123             subprocess.check_call(['conda', 'smithy', 'register-ci', '--feedstock_directory', feedstock_dir] + owner_info)
124 
125             subprocess.check_call(['conda', 'smithy', 'rerender'], cwd=feedstock_dir)
126             subprocess.check_call(['git', 'commit', '-am', "Re-render the feedstock after CI registration."], cwd=feedstock_dir)
127             # Capture the output, as it may contain the GH_TOKEN.
128             out = subprocess.check_output(['git', 'push', 'upstream_with_token', 'master'], cwd=feedstock_dir,
129                                           stderr=subprocess.STDOUT)
130 
131             # Remove this recipe from the repo.
132             removed_recipes.append(name)
133             if is_merged_pr:
134                 subprocess.check_call(['git', 'rm', '-r', recipe_dir])
135 
136     # Commit any removed packages.
137     subprocess.check_call(['git', 'status'])
138     if removed_recipes:
139         subprocess.check_call(['git', 'checkout', os.environ.get('TRAVIS_BRANCH')])
140         msg = ('Removed recipe{s} ({}) after converting into feedstock{s}. '
141                '[ci skip]'.format(', '.join(removed_recipes),
142                          s=('s' if len(removed_recipes) > 1 else '')))
143         if is_merged_pr:
144             # Capture the output, as it may contain the GH_TOKEN.
145             out = subprocess.check_output(['git', 'remote', 'add', 'upstream_with_token',
146                                            'https://conda-forge-admin:{}@github.com/conda-forge/staged-recipes'.format(os.environ['GH_TOKEN'])],
147                                           stderr=subprocess.STDOUT)
148             subprocess.check_call(['git', 'commit', '-m', msg])
149             # Capture the output, as it may contain the GH_TOKEN.
150             out = subprocess.check_output(['git', 'push', 'upstream_with_token', os.environ.get('TRAVIS_BRANCH')],
151                                           stderr=subprocess.STDOUT)
152         else:
153             print('Would git commit, with the following message: \n   {}'.format(msg))
154
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/.CI/create_feedstocks.py b/.CI/create_feedstocks.py
--- a/.CI/create_feedstocks.py
+++ b/.CI/create_feedstocks.py
@@ -90,8 +90,6 @@
             os.mkdir(feedstock_dir)
             print('Making feedstock for {}'.format(name))
 
-            subprocess.check_call(['conda', 'smithy', 'recipe-lint', recipe_dir])
-
             subprocess.check_call(['conda', 'smithy', 'init', recipe_dir,
                                    '--feedstock-directory', feedstock_dir])
             if not is_merged_pr:

{"golden_diff": "diff --git a/.CI/create_feedstocks.py b/.CI/create_feedstocks.py\n--- a/.CI/create_feedstocks.py\n+++ b/.CI/create_feedstocks.py\n@@ -90,8 +90,6 @@\n             os.mkdir(feedstock_dir)\n             print('Making feedstock for {}'.format(name))\n \n-            subprocess.check_call(['conda', 'smithy', 'recipe-lint', recipe_dir])\n-\n             subprocess.check_call(['conda', 'smithy', 'init', recipe_dir,\n                                    '--feedstock-directory', feedstock_dir])\n             if not is_merged_pr:\n", "issue": "Latest conda-smithy is prevent poliastro feedstock creation\n```\nRepository registered at github, now call 'conda smithy register-ci'\nMaking feedstock for poliastro\n/Users/travis/build/conda-forge/staged-recipes/recipes/poliastro has some lint:\n  Selectors are suggested to take a \"  # [<selector>]\" form.\nTraceback (most recent call last):\n  File \".CI/create_feedstocks.py\", line 93, in <module>\n    subprocess.check_call(['conda', 'smithy', 'recipe-lint', recipe_dir])\n  File \"/Users/travis/miniconda/lib/python3.5/subprocess.py\", line 584, in check_call\n    raise CalledProcessError(retcode, cmd)\nsubprocess.CalledProcessError: Command '['conda', 'smithy', 'recipe-lint', '/Users/travis/build/conda-forge/staged-recipes/recipes/poliastro']' returned non-zero exit status 1\n```\n\nI am working on that.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\"\"\"\nConvert all recipes into feedstocks.\n\nThis script is to be run in a TravisCI context, with all secret environment variables defined (BINSTAR_TOKEN, GH_TOKEN)\nSuch as:\n\n    export GH_TOKEN=$(cat ~/.conda-smithy/github.token)\n\n\"\"\"\nfrom __future__ import print_function\n\nfrom conda_smithy.github import gh_token\nfrom contextlib import contextmanager\nfrom github import Github, GithubException\nimport os.path\nimport shutil\nimport subprocess\nimport tempfile\n\n\n# Enable DEBUG to run the diagnostics, without actually creating new feedstocks.\nDEBUG = False\n\n\ndef list_recipes():\n    recipe_directory_name = 'recipes'\n    if os.path.isdir(recipe_directory_name):\n        recipes = os.listdir(recipe_directory_name)\n    else:\n        recipes = []\n\n    for recipe_dir in recipes:\n        # We don't list the \"example\" feedstock. It is an example, and is there\n        # to be helpful.\n        if recipe_dir.startswith('example'):\n            continue\n        path = os.path.abspath(os.path.join(recipe_directory_name, recipe_dir))\n        yield path, recipe_dir\n\n\n@contextmanager\ndef tmp_dir(*args, **kwargs):\n    temp_dir = tempfile.mkdtemp(*args, **kwargs)\n    try:\n        yield temp_dir\n    finally:\n        shutil.rmtree(temp_dir)\n\n\ndef repo_exists(organization, name):\n    token = gh_token()\n    gh = Github(token)\n    # Use the organization provided.\n    org = gh.get_organization(organization)\n    try:\n        org.get_repo(name)\n        return True\n    except GithubException as e:\n        if e.status == 404:\n            return False\n        raise\n\n\nif __name__ == '__main__':\n    is_merged_pr = (os.environ.get('TRAVIS_BRANCH') == 'master' and os.environ.get('TRAVIS_PULL_REQUEST') == 'false')\n\n    smithy_conf = os.path.expanduser('~/.conda-smithy')\n    if not os.path.exists(smithy_conf):\n        os.mkdir(smithy_conf)\n\n    def write_token(name, token):\n        with open(os.path.join(smithy_conf, name + '.token'), 'w') as fh:\n            fh.write(token)\n    if 'APPVEYOR_TOKEN' in os.environ:\n        write_token('appveyor', os.environ['APPVEYOR_TOKEN'])\n    if 'CIRCLE_TOKEN' in os.environ:\n        write_token('circle', os.environ['CIRCLE_TOKEN'])\n    if 'GH_TOKEN' in os.environ:\n        write_token('github', os.environ['GH_TOKEN'])\n\n    owner_info = ['--organization', 'conda-forge']\n\n    print('Calculating the recipes which need to be turned into feedstocks.')\n    removed_recipes = []\n    with tmp_dir('__feedstocks') as feedstocks_dir:\n        feedstock_dirs = []\n        for recipe_dir, name in list_recipes():\n            feedstock_dir = os.path.join(feedstocks_dir, name + '-feedstock')\n            os.mkdir(feedstock_dir)\n            print('Making feedstock for {}'.format(name))\n\n            subprocess.check_call(['conda', 'smithy', 'recipe-lint', recipe_dir])\n\n            subprocess.check_call(['conda', 'smithy', 'init', recipe_dir,\n                                   '--feedstock-directory', feedstock_dir])\n            if not is_merged_pr:\n                # We just want to check that conda-smithy is doing its thing without having any metadata issues.\n                continue\n\n            feedstock_dirs.append([feedstock_dir, name, recipe_dir])\n\n            subprocess.check_call(['git', 'remote', 'add', 'upstream_with_token',\n                                   'https://conda-forge-admin:{}@github.com/conda-forge/{}'.format(os.environ['GH_TOKEN'],\n                                                                                                   os.path.basename(feedstock_dir))],\n                                  cwd=feedstock_dir)\n\n            # Sometimes we already have the feedstock created. We need to deal with that case.\n            if repo_exists('conda-forge', os.path.basename(feedstock_dir)):\n                subprocess.check_call(['git', 'fetch', 'upstream_with_token'], cwd=feedstock_dir)\n                subprocess.check_call(['git', 'branch', '-m', 'master', 'old'], cwd=feedstock_dir)\n                try:\n                    subprocess.check_call(['git', 'checkout', '-b', 'master', 'upstream_with_token/master'], cwd=feedstock_dir)\n                except subprocess.CalledProcessError:\n                    # Sometimes, we have a repo, but there are no commits on it! Just catch that case.\n                    subprocess.check_call(['git', 'checkout', '-b' 'master'], cwd=feedstock_dir)\n            else:\n                subprocess.check_call(['conda', 'smithy', 'register-github', feedstock_dir] + owner_info)\n\n        # Break the previous loop to allow the TravisCI registering to take place only once per function call.\n        # Without this, intermittent failiures to synch the TravisCI repos ensue.\n        for feedstock_dir, name, recipe_dir in feedstock_dirs:\n            subprocess.check_call(['conda', 'smithy', 'register-ci', '--feedstock_directory', feedstock_dir] + owner_info)\n\n            subprocess.check_call(['conda', 'smithy', 'rerender'], cwd=feedstock_dir)\n            subprocess.check_call(['git', 'commit', '-am', \"Re-render the feedstock after CI registration.\"], cwd=feedstock_dir)\n            # Capture the output, as it may contain the GH_TOKEN.\n            out = subprocess.check_output(['git', 'push', 'upstream_with_token', 'master'], cwd=feedstock_dir,\n                                          stderr=subprocess.STDOUT)\n\n            # Remove this recipe from the repo.\n            removed_recipes.append(name)\n            if is_merged_pr:\n                subprocess.check_call(['git', 'rm', '-r', recipe_dir])\n\n    # Commit any removed packages.\n    subprocess.check_call(['git', 'status'])\n    if removed_recipes:\n        subprocess.check_call(['git', 'checkout', os.environ.get('TRAVIS_BRANCH')])\n        msg = ('Removed recipe{s} ({}) after converting into feedstock{s}. '\n               '[ci skip]'.format(', '.join(removed_recipes),\n                         s=('s' if len(removed_recipes) > 1 else '')))\n        if is_merged_pr:\n            # Capture the output, as it may contain the GH_TOKEN.\n            out = subprocess.check_output(['git', 'remote', 'add', 'upstream_with_token',\n                                           'https://conda-forge-admin:{}@github.com/conda-forge/staged-recipes'.format(os.environ['GH_TOKEN'])],\n                                          stderr=subprocess.STDOUT)\n            subprocess.check_call(['git', 'commit', '-m', msg])\n            # Capture the output, as it may contain the GH_TOKEN.\n            out = subprocess.check_output(['git', 'push', 'upstream_with_token', os.environ.get('TRAVIS_BRANCH')],\n                                          stderr=subprocess.STDOUT)\n        else:\n            print('Would git commit, with the following message: \\n   {}'.format(msg))\n", "path": ".CI/create_feedstocks.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\"\"\"\nConvert all recipes into feedstocks.\n\nThis script is to be run in a TravisCI context, with all secret environment variables defined (BINSTAR_TOKEN, GH_TOKEN)\nSuch as:\n\n    export GH_TOKEN=$(cat ~/.conda-smithy/github.token)\n\n\"\"\"\nfrom __future__ import print_function\n\nfrom conda_smithy.github import gh_token\nfrom contextlib import contextmanager\nfrom github import Github, GithubException\nimport os.path\nimport shutil\nimport subprocess\nimport tempfile\n\n\n# Enable DEBUG to run the diagnostics, without actually creating new feedstocks.\nDEBUG = False\n\n\ndef list_recipes():\n    recipe_directory_name = 'recipes'\n    if os.path.isdir(recipe_directory_name):\n        recipes = os.listdir(recipe_directory_name)\n    else:\n        recipes = []\n\n    for recipe_dir in recipes:\n        # We don't list the \"example\" feedstock. It is an example, and is there\n        # to be helpful.\n        if recipe_dir.startswith('example'):\n            continue\n        path = os.path.abspath(os.path.join(recipe_directory_name, recipe_dir))\n        yield path, recipe_dir\n\n\n@contextmanager\ndef tmp_dir(*args, **kwargs):\n    temp_dir = tempfile.mkdtemp(*args, **kwargs)\n    try:\n        yield temp_dir\n    finally:\n        shutil.rmtree(temp_dir)\n\n\ndef repo_exists(organization, name):\n    token = gh_token()\n    gh = Github(token)\n    # Use the organization provided.\n    org = gh.get_organization(organization)\n    try:\n        org.get_repo(name)\n        return True\n    except GithubException as e:\n        if e.status == 404:\n            return False\n        raise\n\n\nif __name__ == '__main__':\n    is_merged_pr = (os.environ.get('TRAVIS_BRANCH') == 'master' and os.environ.get('TRAVIS_PULL_REQUEST') == 'false')\n\n    smithy_conf = os.path.expanduser('~/.conda-smithy')\n    if not os.path.exists(smithy_conf):\n        os.mkdir(smithy_conf)\n\n    def write_token(name, token):\n        with open(os.path.join(smithy_conf, name + '.token'), 'w') as fh:\n            fh.write(token)\n    if 'APPVEYOR_TOKEN' in os.environ:\n        write_token('appveyor', os.environ['APPVEYOR_TOKEN'])\n    if 'CIRCLE_TOKEN' in os.environ:\n        write_token('circle', os.environ['CIRCLE_TOKEN'])\n    if 'GH_TOKEN' in os.environ:\n        write_token('github', os.environ['GH_TOKEN'])\n\n    owner_info = ['--organization', 'conda-forge']\n\n    print('Calculating the recipes which need to be turned into feedstocks.')\n    removed_recipes = []\n    with tmp_dir('__feedstocks') as feedstocks_dir:\n        feedstock_dirs = []\n        for recipe_dir, name in list_recipes():\n            feedstock_dir = os.path.join(feedstocks_dir, name + '-feedstock')\n            os.mkdir(feedstock_dir)\n            print('Making feedstock for {}'.format(name))\n\n            subprocess.check_call(['conda', 'smithy', 'init', recipe_dir,\n                                   '--feedstock-directory', feedstock_dir])\n            if not is_merged_pr:\n                # We just want to check that conda-smithy is doing its thing without having any metadata issues.\n                continue\n\n            feedstock_dirs.append([feedstock_dir, name, recipe_dir])\n\n            subprocess.check_call(['git', 'remote', 'add', 'upstream_with_token',\n                                   'https://conda-forge-admin:{}@github.com/conda-forge/{}'.format(os.environ['GH_TOKEN'],\n                                                                                                   os.path.basename(feedstock_dir))],\n                                  cwd=feedstock_dir)\n\n            # Sometimes we already have the feedstock created. We need to deal with that case.\n            if repo_exists('conda-forge', os.path.basename(feedstock_dir)):\n                subprocess.check_call(['git', 'fetch', 'upstream_with_token'], cwd=feedstock_dir)\n                subprocess.check_call(['git', 'branch', '-m', 'master', 'old'], cwd=feedstock_dir)\n                try:\n                    subprocess.check_call(['git', 'checkout', '-b', 'master', 'upstream_with_token/master'], cwd=feedstock_dir)\n                except subprocess.CalledProcessError:\n                    # Sometimes, we have a repo, but there are no commits on it! Just catch that case.\n                    subprocess.check_call(['git', 'checkout', '-b' 'master'], cwd=feedstock_dir)\n            else:\n                subprocess.check_call(['conda', 'smithy', 'register-github', feedstock_dir] + owner_info)\n\n        # Break the previous loop to allow the TravisCI registering to take place only once per function call.\n        # Without this, intermittent failiures to synch the TravisCI repos ensue.\n        for feedstock_dir, name, recipe_dir in feedstock_dirs:\n            subprocess.check_call(['conda', 'smithy', 'register-ci', '--feedstock_directory', feedstock_dir] + owner_info)\n\n            subprocess.check_call(['conda', 'smithy', 'rerender'], cwd=feedstock_dir)\n            subprocess.check_call(['git', 'commit', '-am', \"Re-render the feedstock after CI registration.\"], cwd=feedstock_dir)\n            # Capture the output, as it may contain the GH_TOKEN.\n            out = subprocess.check_output(['git', 'push', 'upstream_with_token', 'master'], cwd=feedstock_dir,\n                                          stderr=subprocess.STDOUT)\n\n            # Remove this recipe from the repo.\n            removed_recipes.append(name)\n            if is_merged_pr:\n                subprocess.check_call(['git', 'rm', '-r', recipe_dir])\n\n    # Commit any removed packages.\n    subprocess.check_call(['git', 'status'])\n    if removed_recipes:\n        subprocess.check_call(['git', 'checkout', os.environ.get('TRAVIS_BRANCH')])\n        msg = ('Removed recipe{s} ({}) after converting into feedstock{s}. '\n               '[ci skip]'.format(', '.join(removed_recipes),\n                         s=('s' if len(removed_recipes) > 1 else '')))\n        if is_merged_pr:\n            # Capture the output, as it may contain the GH_TOKEN.\n            out = subprocess.check_output(['git', 'remote', 'add', 'upstream_with_token',\n                                           'https://conda-forge-admin:{}@github.com/conda-forge/staged-recipes'.format(os.environ['GH_TOKEN'])],\n                                          stderr=subprocess.STDOUT)\n            subprocess.check_call(['git', 'commit', '-m', msg])\n            # Capture the output, as it may contain the GH_TOKEN.\n            out = subprocess.check_output(['git', 'push', 'upstream_with_token', os.environ.get('TRAVIS_BRANCH')],\n                                          stderr=subprocess.STDOUT)\n        else:\n            print('Would git commit, with the following message: \\n   {}'.format(msg))\n", "path": ".CI/create_feedstocks.py"}]}