We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Migrate to Cython 0.22
The bandaid applied in #276 is falling off. I've tagged this for 1.0 but we could do it sooner.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 # Two environmental variables influence this script.
4 #
5 # GDAL_CONFIG: the path to a gdal-config program that points to GDAL headers,
6 # libraries, and data files.
7 #
8 # PACKAGE_DATA: if defined, GDAL and PROJ4 data files will be copied into the
9 # source or binary distribution. This is essential when creating self-contained
10 # binary wheels.
11 
12 import logging
13 import os
14 import pprint
15 import shutil
16 import subprocess
17 import sys
18 
19 from setuptools import setup
20 from setuptools.extension import Extension
21 
22 logging.basicConfig()
23 log = logging.getLogger()
24 
25 # python -W all setup.py ...
26 if 'all' in sys.warnoptions:
27     log.level = logging.DEBUG
28 
29 def check_output(cmd):
30     # since subprocess.check_output doesn't exist in 2.6
31     # we wrap it here.
32     try:
33         out = subprocess.check_output(cmd)
34         return out.decode('utf')
35     except AttributeError:
36         # For some reasone check_output doesn't exist
37         # So fall back on Popen
38         p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
39         out, err = p.communicate()
40         return out
41 
42 def copy_data_tree(datadir, destdir):
43     try:
44         shutil.rmtree(destdir)
45     except OSError:
46         pass
47     shutil.copytree(datadir, destdir)
48 
49 # Parse the version from the rasterio module.
50 with open('rasterio/__init__.py') as f:
51     for line in f:
52         if line.find("__version__") >= 0:
53             version = line.split("=")[1].strip()
54             version = version.strip('"')
55             version = version.strip("'")
56             continue
57 
58 with open('VERSION.txt', 'w') as f:
59     f.write(version)
60 
61 # Use Cython if available.
62 try:
63     from Cython.Build import cythonize
64 except ImportError:
65     cythonize = None
66 
67 # By default we'll try to get options via gdal-config. On systems without,
68 # options will need to be set in setup.cfg or on the setup command line.
69 include_dirs = []
70 library_dirs = []
71 libraries = []
72 extra_link_args = []
73 gdal_output = [None]*3
74 
75 try:
76     import numpy
77     include_dirs.append(numpy.get_include())
78 except ImportError:
79     log.critical("Numpy and its headers are required to run setup(). Exiting.")
80     sys.exit(1)
81 
82 try:
83     gdal_config = os.environ.get('GDAL_CONFIG', 'gdal-config')
84     for i, flag in enumerate(("--cflags", "--libs", "--datadir")):
85         gdal_output[i] = check_output([gdal_config, flag]).strip()
86 
87     for item in gdal_output[0].split():
88         if item.startswith("-I"):
89             include_dirs.extend(item[2:].split(":"))
90     for item in gdal_output[1].split():
91         if item.startswith("-L"):
92             library_dirs.extend(item[2:].split(":"))
93         elif item.startswith("-l"):
94             libraries.append(item[2:])
95         else:
96             # e.g. -framework GDAL
97             extra_link_args.append(item)
98 
99 except Exception as e:
100     if os.name == "nt":
101         log.info(("Building on Windows requires extra options to setup.py to locate needed GDAL files.\n"
102                  "More information is available in the README."))
103     else:
104         log.warning("Failed to get options via gdal-config: %s", str(e))
105 
106 
107 # Conditionally copy the GDAL data. To be used in conjunction with
108 # the bdist_wheel command to make self-contained binary wheels.
109 if os.environ.get('PACKAGE_DATA'):
110     destdir = 'rasterio/gdal_data'
111     if gdal_output[2]:
112         log.info("Copying gdal data from %s" % gdal_output[2])
113         copy_data_tree(gdal_output[2], destdir)
114     else:
115         # check to see if GDAL_DATA is defined
116         gdal_data = os.environ.get('GDAL_DATA', None)
117         if gdal_data:
118             log.info("Copying gdal_data from %s" % gdal_data)
119             copy_data_tree(gdal_data, destdir)
120 
121     # Conditionally copy PROJ.4 data.
122     projdatadir = os.environ.get('PROJ_LIB', '/usr/local/share/proj')
123     if os.path.exists(projdatadir):
124         log.info("Copying proj_data from %s" % projdatadir)
125         copy_data_tree(projdatadir, 'rasterio/proj_data')
126 
127 ext_options = dict(
128     include_dirs=include_dirs,
129     library_dirs=library_dirs,
130     libraries=libraries,
131     extra_link_args=extra_link_args)
132 
133 log.debug('ext_options:\n%s', pprint.pformat(ext_options))
134 
135 # When building from a repo, Cython is required.
136 if os.path.exists("MANIFEST.in") and "clean" not in sys.argv:
137     log.info("MANIFEST.in found, presume a repo, cythonizing...")
138     if not cythonize:
139         log.critical(
140             "Cython.Build.cythonize not found. "
141             "Cython is required to build from a repo.")
142         sys.exit(1)
143     ext_modules = cythonize([
144         Extension(
145             'rasterio._base', ['rasterio/_base.pyx'], **ext_options),
146         Extension(
147             'rasterio._io', ['rasterio/_io.pyx'], **ext_options),
148         Extension(
149             'rasterio._copy', ['rasterio/_copy.pyx'], **ext_options),
150         Extension(
151             'rasterio._features', ['rasterio/_features.pyx'], **ext_options),
152         Extension(
153             'rasterio._drivers', ['rasterio/_drivers.pyx'], **ext_options),
154         Extension(
155             'rasterio._warp', ['rasterio/_warp.pyx'], **ext_options),
156         Extension(
157             'rasterio._fill', ['rasterio/_fill.pyx', 'rasterio/rasterfill.cpp'], **ext_options),
158         Extension(
159             'rasterio._err', ['rasterio/_err.pyx'], **ext_options),
160         Extension(
161             'rasterio._example', ['rasterio/_example.pyx'], **ext_options),
162         ], quiet=True)
163 
164 # If there's no manifest template, as in an sdist, we just specify .c files.
165 else:
166     ext_modules = [
167         Extension(
168             'rasterio._base', ['rasterio/_base.c'], **ext_options),
169         Extension(
170             'rasterio._io', ['rasterio/_io.c'], **ext_options),
171         Extension(
172             'rasterio._copy', ['rasterio/_copy.c'], **ext_options),
173         Extension(
174             'rasterio._features', ['rasterio/_features.c'], **ext_options),
175         Extension(
176             'rasterio._drivers', ['rasterio/_drivers.c'], **ext_options),
177         Extension(
178             'rasterio._warp', ['rasterio/_warp.cpp'], **ext_options),
179         Extension(
180             'rasterio._fill', ['rasterio/_fill.cpp', 'rasterio/rasterfill.cpp'], **ext_options),
181         Extension(
182             'rasterio._err', ['rasterio/_err.c'], **ext_options),
183         Extension(
184             'rasterio._example', ['rasterio/_example.c'], **ext_options),
185             ]
186 
187 with open('README.rst') as f:
188     readme = f.read()
189 
190 # Runtime requirements.
191 inst_reqs = [
192     'affine>=1.0',
193     'cligj',
194     'Numpy>=1.7',
195     'snuggs>=1.3.1']
196 
197 if sys.version_info < (3, 4):
198     inst_reqs.append('enum34')
199 
200 setup_args = dict(
201     name='rasterio',
202     version=version,
203     description="Fast and direct raster I/O for use with Numpy and SciPy",
204     long_description=readme,
205     classifiers=[
206         'Development Status :: 4 - Beta',
207         'Intended Audience :: Developers',
208         'Intended Audience :: Information Technology',
209         'Intended Audience :: Science/Research',
210         'License :: OSI Approved :: BSD License',
211         'Programming Language :: C',
212         'Programming Language :: Python :: 2.6',
213         'Programming Language :: Python :: 2.7',
214         'Programming Language :: Python :: 3.3',
215         'Programming Language :: Python :: 3.4',
216         'Topic :: Multimedia :: Graphics :: Graphics Conversion',
217         'Topic :: Scientific/Engineering :: GIS'],
218     keywords='raster gdal',
219     author='Sean Gillies',
220     author_email='sean@mapbox.com',
221     url='https://github.com/mapbox/rasterio',
222     license='BSD',
223     package_dir={'': '.'},
224     packages=['rasterio', 'rasterio.rio'],
225     entry_points='''
226         [console_scripts]
227         rio=rasterio.rio.main:cli
228         
229         [rasterio.rio_commands]
230         bounds=rasterio.rio.rio:bounds
231         calc=rasterio.rio.calc:calc
232         edit-info=rasterio.rio.info:edit
233         env=rasterio.rio.info:env
234         info=rasterio.rio.info:info
235         insp=rasterio.rio.rio:insp
236         mask=rasterio.rio.features:mask
237         merge=rasterio.rio.merge:merge
238         rasterize=rasterio.rio.features:rasterize
239         sample=rasterio.rio.sample:sample
240         shapes=rasterio.rio.features:shapes
241         stack=rasterio.rio.bands:stack
242         transform=rasterio.rio.rio:transform
243     ''',
244     include_package_data=True,
245     ext_modules=ext_modules,
246     zip_safe=False,
247     install_requires=inst_reqs)
248 
249 if os.environ.get('PACKAGE_DATA'):
250     setup_args['package_data'] = {'rasterio': ['gdal_data/*', 'proj_data/*']}
251 
252 setup(**setup_args)
253
```
--- 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/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -125,6 +125,7 @@
         copy_data_tree(projdatadir, 'rasterio/proj_data')
 
 ext_options = dict(
+    extra_compile_args=['-Wno-unused-parameter', '-Wno-unused-function'],
     include_dirs=include_dirs,
     library_dirs=library_dirs,
     libraries=libraries,

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -125,6 +125,7 @@\n         copy_data_tree(projdatadir, 'rasterio/proj_data')\n \n ext_options = dict(\n+    extra_compile_args=['-Wno-unused-parameter', '-Wno-unused-function'],\n     include_dirs=include_dirs,\n     library_dirs=library_dirs,\n     libraries=libraries,\n", "issue": "Migrate to Cython 0.22\nThe bandaid applied in #276 is falling off. I've tagged this for 1.0 but we could do it sooner.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\n# Two environmental variables influence this script.\n#\n# GDAL_CONFIG: the path to a gdal-config program that points to GDAL headers,\n# libraries, and data files.\n#\n# PACKAGE_DATA: if defined, GDAL and PROJ4 data files will be copied into the\n# source or binary distribution. This is essential when creating self-contained\n# binary wheels.\n\nimport logging\nimport os\nimport pprint\nimport shutil\nimport subprocess\nimport sys\n\nfrom setuptools import setup\nfrom setuptools.extension import Extension\n\nlogging.basicConfig()\nlog = logging.getLogger()\n\n# python -W all setup.py ...\nif 'all' in sys.warnoptions:\n    log.level = logging.DEBUG\n\ndef check_output(cmd):\n    # since subprocess.check_output doesn't exist in 2.6\n    # we wrap it here.\n    try:\n        out = subprocess.check_output(cmd)\n        return out.decode('utf')\n    except AttributeError:\n        # For some reasone check_output doesn't exist\n        # So fall back on Popen\n        p = subprocess.Popen(cmd, stdout=subprocess.PIPE)\n        out, err = p.communicate()\n        return out\n\ndef copy_data_tree(datadir, destdir):\n    try:\n        shutil.rmtree(destdir)\n    except OSError:\n        pass\n    shutil.copytree(datadir, destdir)\n\n# Parse the version from the rasterio module.\nwith open('rasterio/__init__.py') as f:\n    for line in f:\n        if line.find(\"__version__\") >= 0:\n            version = line.split(\"=\")[1].strip()\n            version = version.strip('\"')\n            version = version.strip(\"'\")\n            continue\n\nwith open('VERSION.txt', 'w') as f:\n    f.write(version)\n\n# Use Cython if available.\ntry:\n    from Cython.Build import cythonize\nexcept ImportError:\n    cythonize = None\n\n# By default we'll try to get options via gdal-config. On systems without,\n# options will need to be set in setup.cfg or on the setup command line.\ninclude_dirs = []\nlibrary_dirs = []\nlibraries = []\nextra_link_args = []\ngdal_output = [None]*3\n\ntry:\n    import numpy\n    include_dirs.append(numpy.get_include())\nexcept ImportError:\n    log.critical(\"Numpy and its headers are required to run setup(). Exiting.\")\n    sys.exit(1)\n\ntry:\n    gdal_config = os.environ.get('GDAL_CONFIG', 'gdal-config')\n    for i, flag in enumerate((\"--cflags\", \"--libs\", \"--datadir\")):\n        gdal_output[i] = check_output([gdal_config, flag]).strip()\n\n    for item in gdal_output[0].split():\n        if item.startswith(\"-I\"):\n            include_dirs.extend(item[2:].split(\":\"))\n    for item in gdal_output[1].split():\n        if item.startswith(\"-L\"):\n            library_dirs.extend(item[2:].split(\":\"))\n        elif item.startswith(\"-l\"):\n            libraries.append(item[2:])\n        else:\n            # e.g. -framework GDAL\n            extra_link_args.append(item)\n\nexcept Exception as e:\n    if os.name == \"nt\":\n        log.info((\"Building on Windows requires extra options to setup.py to locate needed GDAL files.\\n\"\n                 \"More information is available in the README.\"))\n    else:\n        log.warning(\"Failed to get options via gdal-config: %s\", str(e))\n\n\n# Conditionally copy the GDAL data. To be used in conjunction with\n# the bdist_wheel command to make self-contained binary wheels.\nif os.environ.get('PACKAGE_DATA'):\n    destdir = 'rasterio/gdal_data'\n    if gdal_output[2]:\n        log.info(\"Copying gdal data from %s\" % gdal_output[2])\n        copy_data_tree(gdal_output[2], destdir)\n    else:\n        # check to see if GDAL_DATA is defined\n        gdal_data = os.environ.get('GDAL_DATA', None)\n        if gdal_data:\n            log.info(\"Copying gdal_data from %s\" % gdal_data)\n            copy_data_tree(gdal_data, destdir)\n\n    # Conditionally copy PROJ.4 data.\n    projdatadir = os.environ.get('PROJ_LIB', '/usr/local/share/proj')\n    if os.path.exists(projdatadir):\n        log.info(\"Copying proj_data from %s\" % projdatadir)\n        copy_data_tree(projdatadir, 'rasterio/proj_data')\n\next_options = dict(\n    include_dirs=include_dirs,\n    library_dirs=library_dirs,\n    libraries=libraries,\n    extra_link_args=extra_link_args)\n\nlog.debug('ext_options:\\n%s', pprint.pformat(ext_options))\n\n# When building from a repo, Cython is required.\nif os.path.exists(\"MANIFEST.in\") and \"clean\" not in sys.argv:\n    log.info(\"MANIFEST.in found, presume a repo, cythonizing...\")\n    if not cythonize:\n        log.critical(\n            \"Cython.Build.cythonize not found. \"\n            \"Cython is required to build from a repo.\")\n        sys.exit(1)\n    ext_modules = cythonize([\n        Extension(\n            'rasterio._base', ['rasterio/_base.pyx'], **ext_options),\n        Extension(\n            'rasterio._io', ['rasterio/_io.pyx'], **ext_options),\n        Extension(\n            'rasterio._copy', ['rasterio/_copy.pyx'], **ext_options),\n        Extension(\n            'rasterio._features', ['rasterio/_features.pyx'], **ext_options),\n        Extension(\n            'rasterio._drivers', ['rasterio/_drivers.pyx'], **ext_options),\n        Extension(\n            'rasterio._warp', ['rasterio/_warp.pyx'], **ext_options),\n        Extension(\n            'rasterio._fill', ['rasterio/_fill.pyx', 'rasterio/rasterfill.cpp'], **ext_options),\n        Extension(\n            'rasterio._err', ['rasterio/_err.pyx'], **ext_options),\n        Extension(\n            'rasterio._example', ['rasterio/_example.pyx'], **ext_options),\n        ], quiet=True)\n\n# If there's no manifest template, as in an sdist, we just specify .c files.\nelse:\n    ext_modules = [\n        Extension(\n            'rasterio._base', ['rasterio/_base.c'], **ext_options),\n        Extension(\n            'rasterio._io', ['rasterio/_io.c'], **ext_options),\n        Extension(\n            'rasterio._copy', ['rasterio/_copy.c'], **ext_options),\n        Extension(\n            'rasterio._features', ['rasterio/_features.c'], **ext_options),\n        Extension(\n            'rasterio._drivers', ['rasterio/_drivers.c'], **ext_options),\n        Extension(\n            'rasterio._warp', ['rasterio/_warp.cpp'], **ext_options),\n        Extension(\n            'rasterio._fill', ['rasterio/_fill.cpp', 'rasterio/rasterfill.cpp'], **ext_options),\n        Extension(\n            'rasterio._err', ['rasterio/_err.c'], **ext_options),\n        Extension(\n            'rasterio._example', ['rasterio/_example.c'], **ext_options),\n            ]\n\nwith open('README.rst') as f:\n    readme = f.read()\n\n# Runtime requirements.\ninst_reqs = [\n    'affine>=1.0',\n    'cligj',\n    'Numpy>=1.7',\n    'snuggs>=1.3.1']\n\nif sys.version_info < (3, 4):\n    inst_reqs.append('enum34')\n\nsetup_args = dict(\n    name='rasterio',\n    version=version,\n    description=\"Fast and direct raster I/O for use with Numpy and SciPy\",\n    long_description=readme,\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Information Technology',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: BSD License',\n        'Programming Language :: C',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Topic :: Multimedia :: Graphics :: Graphics Conversion',\n        'Topic :: Scientific/Engineering :: GIS'],\n    keywords='raster gdal',\n    author='Sean Gillies',\n    author_email='sean@mapbox.com',\n    url='https://github.com/mapbox/rasterio',\n    license='BSD',\n    package_dir={'': '.'},\n    packages=['rasterio', 'rasterio.rio'],\n    entry_points='''\n        [console_scripts]\n        rio=rasterio.rio.main:cli\n        \n        [rasterio.rio_commands]\n        bounds=rasterio.rio.rio:bounds\n        calc=rasterio.rio.calc:calc\n        edit-info=rasterio.rio.info:edit\n        env=rasterio.rio.info:env\n        info=rasterio.rio.info:info\n        insp=rasterio.rio.rio:insp\n        mask=rasterio.rio.features:mask\n        merge=rasterio.rio.merge:merge\n        rasterize=rasterio.rio.features:rasterize\n        sample=rasterio.rio.sample:sample\n        shapes=rasterio.rio.features:shapes\n        stack=rasterio.rio.bands:stack\n        transform=rasterio.rio.rio:transform\n    ''',\n    include_package_data=True,\n    ext_modules=ext_modules,\n    zip_safe=False,\n    install_requires=inst_reqs)\n\nif os.environ.get('PACKAGE_DATA'):\n    setup_args['package_data'] = {'rasterio': ['gdal_data/*', 'proj_data/*']}\n\nsetup(**setup_args)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n# Two environmental variables influence this script.\n#\n# GDAL_CONFIG: the path to a gdal-config program that points to GDAL headers,\n# libraries, and data files.\n#\n# PACKAGE_DATA: if defined, GDAL and PROJ4 data files will be copied into the\n# source or binary distribution. This is essential when creating self-contained\n# binary wheels.\n\nimport logging\nimport os\nimport pprint\nimport shutil\nimport subprocess\nimport sys\n\nfrom setuptools import setup\nfrom setuptools.extension import Extension\n\nlogging.basicConfig()\nlog = logging.getLogger()\n\n# python -W all setup.py ...\nif 'all' in sys.warnoptions:\n    log.level = logging.DEBUG\n\ndef check_output(cmd):\n    # since subprocess.check_output doesn't exist in 2.6\n    # we wrap it here.\n    try:\n        out = subprocess.check_output(cmd)\n        return out.decode('utf')\n    except AttributeError:\n        # For some reasone check_output doesn't exist\n        # So fall back on Popen\n        p = subprocess.Popen(cmd, stdout=subprocess.PIPE)\n        out, err = p.communicate()\n        return out\n\ndef copy_data_tree(datadir, destdir):\n    try:\n        shutil.rmtree(destdir)\n    except OSError:\n        pass\n    shutil.copytree(datadir, destdir)\n\n# Parse the version from the rasterio module.\nwith open('rasterio/__init__.py') as f:\n    for line in f:\n        if line.find(\"__version__\") >= 0:\n            version = line.split(\"=\")[1].strip()\n            version = version.strip('\"')\n            version = version.strip(\"'\")\n            continue\n\nwith open('VERSION.txt', 'w') as f:\n    f.write(version)\n\n# Use Cython if available.\ntry:\n    from Cython.Build import cythonize\nexcept ImportError:\n    cythonize = None\n\n# By default we'll try to get options via gdal-config. On systems without,\n# options will need to be set in setup.cfg or on the setup command line.\ninclude_dirs = []\nlibrary_dirs = []\nlibraries = []\nextra_link_args = []\ngdal_output = [None]*3\n\ntry:\n    import numpy\n    include_dirs.append(numpy.get_include())\nexcept ImportError:\n    log.critical(\"Numpy and its headers are required to run setup(). Exiting.\")\n    sys.exit(1)\n\ntry:\n    gdal_config = os.environ.get('GDAL_CONFIG', 'gdal-config')\n    for i, flag in enumerate((\"--cflags\", \"--libs\", \"--datadir\")):\n        gdal_output[i] = check_output([gdal_config, flag]).strip()\n\n    for item in gdal_output[0].split():\n        if item.startswith(\"-I\"):\n            include_dirs.extend(item[2:].split(\":\"))\n    for item in gdal_output[1].split():\n        if item.startswith(\"-L\"):\n            library_dirs.extend(item[2:].split(\":\"))\n        elif item.startswith(\"-l\"):\n            libraries.append(item[2:])\n        else:\n            # e.g. -framework GDAL\n            extra_link_args.append(item)\n\nexcept Exception as e:\n    if os.name == \"nt\":\n        log.info((\"Building on Windows requires extra options to setup.py to locate needed GDAL files.\\n\"\n                 \"More information is available in the README.\"))\n    else:\n        log.warning(\"Failed to get options via gdal-config: %s\", str(e))\n\n\n# Conditionally copy the GDAL data. To be used in conjunction with\n# the bdist_wheel command to make self-contained binary wheels.\nif os.environ.get('PACKAGE_DATA'):\n    destdir = 'rasterio/gdal_data'\n    if gdal_output[2]:\n        log.info(\"Copying gdal data from %s\" % gdal_output[2])\n        copy_data_tree(gdal_output[2], destdir)\n    else:\n        # check to see if GDAL_DATA is defined\n        gdal_data = os.environ.get('GDAL_DATA', None)\n        if gdal_data:\n            log.info(\"Copying gdal_data from %s\" % gdal_data)\n            copy_data_tree(gdal_data, destdir)\n\n    # Conditionally copy PROJ.4 data.\n    projdatadir = os.environ.get('PROJ_LIB', '/usr/local/share/proj')\n    if os.path.exists(projdatadir):\n        log.info(\"Copying proj_data from %s\" % projdatadir)\n        copy_data_tree(projdatadir, 'rasterio/proj_data')\n\next_options = dict(\n    extra_compile_args=['-Wno-unused-parameter', '-Wno-unused-function'],\n    include_dirs=include_dirs,\n    library_dirs=library_dirs,\n    libraries=libraries,\n    extra_link_args=extra_link_args)\n\nlog.debug('ext_options:\\n%s', pprint.pformat(ext_options))\n\n# When building from a repo, Cython is required.\nif os.path.exists(\"MANIFEST.in\") and \"clean\" not in sys.argv:\n    log.info(\"MANIFEST.in found, presume a repo, cythonizing...\")\n    if not cythonize:\n        log.critical(\n            \"Cython.Build.cythonize not found. \"\n            \"Cython is required to build from a repo.\")\n        sys.exit(1)\n    ext_modules = cythonize([\n        Extension(\n            'rasterio._base', ['rasterio/_base.pyx'], **ext_options),\n        Extension(\n            'rasterio._io', ['rasterio/_io.pyx'], **ext_options),\n        Extension(\n            'rasterio._copy', ['rasterio/_copy.pyx'], **ext_options),\n        Extension(\n            'rasterio._features', ['rasterio/_features.pyx'], **ext_options),\n        Extension(\n            'rasterio._drivers', ['rasterio/_drivers.pyx'], **ext_options),\n        Extension(\n            'rasterio._warp', ['rasterio/_warp.pyx'], **ext_options),\n        Extension(\n            'rasterio._fill', ['rasterio/_fill.pyx', 'rasterio/rasterfill.cpp'], **ext_options),\n        Extension(\n            'rasterio._err', ['rasterio/_err.pyx'], **ext_options),\n        Extension(\n            'rasterio._example', ['rasterio/_example.pyx'], **ext_options),\n        ], quiet=True)\n\n# If there's no manifest template, as in an sdist, we just specify .c files.\nelse:\n    ext_modules = [\n        Extension(\n            'rasterio._base', ['rasterio/_base.c'], **ext_options),\n        Extension(\n            'rasterio._io', ['rasterio/_io.c'], **ext_options),\n        Extension(\n            'rasterio._copy', ['rasterio/_copy.c'], **ext_options),\n        Extension(\n            'rasterio._features', ['rasterio/_features.c'], **ext_options),\n        Extension(\n            'rasterio._drivers', ['rasterio/_drivers.c'], **ext_options),\n        Extension(\n            'rasterio._warp', ['rasterio/_warp.cpp'], **ext_options),\n        Extension(\n            'rasterio._fill', ['rasterio/_fill.cpp', 'rasterio/rasterfill.cpp'], **ext_options),\n        Extension(\n            'rasterio._err', ['rasterio/_err.c'], **ext_options),\n        Extension(\n            'rasterio._example', ['rasterio/_example.c'], **ext_options),\n            ]\n\nwith open('README.rst') as f:\n    readme = f.read()\n\n# Runtime requirements.\ninst_reqs = [\n    'affine>=1.0',\n    'cligj',\n    'Numpy>=1.7',\n    'snuggs>=1.3.1']\n\nif sys.version_info < (3, 4):\n    inst_reqs.append('enum34')\n\nsetup_args = dict(\n    name='rasterio',\n    version=version,\n    description=\"Fast and direct raster I/O for use with Numpy and SciPy\",\n    long_description=readme,\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Information Technology',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: BSD License',\n        'Programming Language :: C',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Topic :: Multimedia :: Graphics :: Graphics Conversion',\n        'Topic :: Scientific/Engineering :: GIS'],\n    keywords='raster gdal',\n    author='Sean Gillies',\n    author_email='sean@mapbox.com',\n    url='https://github.com/mapbox/rasterio',\n    license='BSD',\n    package_dir={'': '.'},\n    packages=['rasterio', 'rasterio.rio'],\n    entry_points='''\n        [console_scripts]\n        rio=rasterio.rio.main:cli\n        \n        [rasterio.rio_commands]\n        bounds=rasterio.rio.rio:bounds\n        calc=rasterio.rio.calc:calc\n        edit-info=rasterio.rio.info:edit\n        env=rasterio.rio.info:env\n        info=rasterio.rio.info:info\n        insp=rasterio.rio.rio:insp\n        mask=rasterio.rio.features:mask\n        merge=rasterio.rio.merge:merge\n        rasterize=rasterio.rio.features:rasterize\n        sample=rasterio.rio.sample:sample\n        shapes=rasterio.rio.features:shapes\n        stack=rasterio.rio.bands:stack\n        transform=rasterio.rio.rio:transform\n    ''',\n    include_package_data=True,\n    ext_modules=ext_modules,\n    zip_safe=False,\n    install_requires=inst_reqs)\n\nif os.environ.get('PACKAGE_DATA'):\n    setup_args['package_data'] = {'rasterio': ['gdal_data/*', 'proj_data/*']}\n\nsetup(**setup_args)\n", "path": "setup.py"}]}