We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Pin rasterio >= 1.0.2
There are some issues with rasterio that are fixed with 1.0.2 (See: https://github.com/opendatacube/datacube-core/pull/531#pullrequestreview-143845097).

Files to change:
- setup.py
- requirements.txt
- rtd-environment.yml (this also needs the conda-forge/label/dev channel removed with the change)

--- 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 import versioneer
4 from setuptools import setup, find_packages
5 import os
6 
7 tests_require = [
8     'compliance-checker',
9     'hypothesis',
10     'mock',
11     'objgraph',
12     'pycodestyle',
13     'pylint',
14     'pytest',
15     'pytest-cov',
16     'pytest-timeout',
17 ]
18 
19 extras_require = {
20     'performance': ['ciso8601', 'bottleneck'],
21     'interactive': ['matplotlib', 'fiona'],
22     'distributed': ['distributed', 'dask[distributed]'],
23     'doc': ['Sphinx', 'setuptools'],
24     'replicas': ['paramiko', 'sshtunnel', 'tqdm'],
25     'celery': ['celery>=4', 'redis'],
26     's3': ['boto3', 'SharedArray', 'pathos', 'zstandard'],
27     'test': tests_require,
28 }
29 # An 'all' option, following ipython naming conventions.
30 extras_require['all'] = sorted(set(sum(extras_require.values(), [])))
31 
32 extra_plugins = dict(read=[], write=[], index=[])
33 
34 if os.name != 'nt':
35     extra_plugins['read'].extend([
36         's3aio = datacube.drivers.s3.driver:reader_driver_init [s3]',
37         's3aio_test = datacube.drivers.s3.driver:reader_test_driver_init [s3]',
38     ])
39     extra_plugins['write'].extend([
40         's3aio = datacube.drivers.s3.driver:writer_driver_init [s3]',
41         's3aio_test = datacube.drivers.s3.driver:writer_test_driver_init [s3]',
42     ])
43 
44     extra_plugins['index'].extend([
45         's3aio_index = datacube.drivers.s3aio_index:index_driver_init [s3]',
46     ])
47 
48 setup(
49     name='datacube',
50     version=versioneer.get_version(),
51     cmdclass=versioneer.get_cmdclass(),
52     python_requires='>=3.5.2',
53 
54     url='https://github.com/opendatacube/datacube-core',
55     author='Open Data Cube',
56     maintainer='Open Data Cube',
57     maintainer_email='',
58     description='An analysis environment for satellite and other earth observation data',
59     long_description=open('README.rst').read(),
60     license='Apache License 2.0',
61     classifiers=[
62         "Development Status :: 4 - Beta",
63         "Intended Audience :: Developers",
64         "Intended Audience :: Science/Research",
65         "License :: OSI Approved :: Apache Software License",
66         "Natural Language :: English",
67         "Operating System :: MacOS :: MacOS X",
68         "Operating System :: POSIX",
69         "Operating System :: POSIX :: BSD",
70         "Operating System :: POSIX :: Linux",
71         "Operating System :: Microsoft :: Windows",
72         "Programming Language :: Python",
73         "Programming Language :: Python :: 3",
74         "Programming Language :: Python :: 3.5",
75         "Programming Language :: Python :: 3.6",
76         "Topic :: Scientific/Engineering :: GIS",
77         "Topic :: Scientific/Engineering :: Information Analysis",
78     ],
79 
80     packages=find_packages(
81         exclude=('tests', 'tests.*',
82                  'integration_tests', 'integration_tests.*')
83     ),
84     package_data={
85         '': ['*.yaml', '*/*.yaml'],
86     },
87     scripts=[
88         'datacube_apps/scripts/pbs_helpers.sh'
89     ],
90     setup_requires=[
91         'pytest-runner'
92     ],
93     install_requires=[
94         'affine',
95         'cachetools',
96         'click>=5.0',
97         'cloudpickle>=0.4',
98         'dask[array]',
99         'gdal>=1.9',
100         'jsonschema',
101         'netcdf4',
102         'numpy',
103         'psycopg2',
104         'pypeg2',
105         'python-dateutil',
106         'pyyaml',
107         'rasterio~=1.0',
108         'singledispatch',
109         'sqlalchemy',
110         'toolz',
111         'xarray>=0.9',  # >0.9 fixes most problems with `crs` attributes being lost
112     ],
113     extras_require=extras_require,
114     tests_require=tests_require,
115 
116     entry_points={
117         'console_scripts': [
118             'datacube = datacube.scripts.cli_app:cli',
119             'datacube-search = datacube.scripts.search_tool:cli',
120             'datacube-stacker = datacube_apps.stacker:main',
121             'datacube-worker = datacube.execution.worker:main',
122             'datacube-fixer = datacube_apps.stacker:fixer_main',
123             'datacube-ncml = datacube_apps.ncml:ncml_app',
124             'pixeldrill = datacube_apps.pixeldrill:main [interactive]',
125             'movie_generator = datacube_apps.movie_generator:main',
126             'datacube-simple-replica = datacube_apps.simple_replica:replicate [replicas]'
127         ],
128         'datacube.plugins.io.read': [
129             'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',
130             *extra_plugins['read'],
131         ],
132         'datacube.plugins.io.write': [
133             'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',
134             *extra_plugins['write'],
135         ],
136         'datacube.plugins.index': [
137             'default = datacube.index.index:index_driver_init',
138             *extra_plugins['index'],
139         ],
140     },
141 )
142
```
--- 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
@@ -104,7 +104,7 @@
         'pypeg2',
         'python-dateutil',
         'pyyaml',
-        'rasterio~=1.0',
+        'rasterio>=1.0.2',  # Multi-band re-project fixed in that version
         'singledispatch',
         'sqlalchemy',
         'toolz',

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -104,7 +104,7 @@\n         'pypeg2',\n         'python-dateutil',\n         'pyyaml',\n-        'rasterio~=1.0',\n+        'rasterio>=1.0.2',  # Multi-band re-project fixed in that version\n         'singledispatch',\n         'sqlalchemy',\n         'toolz',\n", "issue": "Pin rasterio >= 1.0.2\nThere are some issues with rasterio that are fixed with 1.0.2 (See: https://github.com/opendatacube/datacube-core/pull/531#pullrequestreview-143845097).\r\n\r\nFiles to change:\r\n- setup.py\r\n- requirements.txt\r\n- rtd-environment.yml (this also needs the conda-forge/label/dev channel removed with the change)\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport versioneer\nfrom setuptools import setup, find_packages\nimport os\n\ntests_require = [\n    'compliance-checker',\n    'hypothesis',\n    'mock',\n    'objgraph',\n    'pycodestyle',\n    'pylint',\n    'pytest',\n    'pytest-cov',\n    'pytest-timeout',\n]\n\nextras_require = {\n    'performance': ['ciso8601', 'bottleneck'],\n    'interactive': ['matplotlib', 'fiona'],\n    'distributed': ['distributed', 'dask[distributed]'],\n    'doc': ['Sphinx', 'setuptools'],\n    'replicas': ['paramiko', 'sshtunnel', 'tqdm'],\n    'celery': ['celery>=4', 'redis'],\n    's3': ['boto3', 'SharedArray', 'pathos', 'zstandard'],\n    'test': tests_require,\n}\n# An 'all' option, following ipython naming conventions.\nextras_require['all'] = sorted(set(sum(extras_require.values(), [])))\n\nextra_plugins = dict(read=[], write=[], index=[])\n\nif os.name != 'nt':\n    extra_plugins['read'].extend([\n        's3aio = datacube.drivers.s3.driver:reader_driver_init [s3]',\n        's3aio_test = datacube.drivers.s3.driver:reader_test_driver_init [s3]',\n    ])\n    extra_plugins['write'].extend([\n        's3aio = datacube.drivers.s3.driver:writer_driver_init [s3]',\n        's3aio_test = datacube.drivers.s3.driver:writer_test_driver_init [s3]',\n    ])\n\n    extra_plugins['index'].extend([\n        's3aio_index = datacube.drivers.s3aio_index:index_driver_init [s3]',\n    ])\n\nsetup(\n    name='datacube',\n    version=versioneer.get_version(),\n    cmdclass=versioneer.get_cmdclass(),\n    python_requires='>=3.5.2',\n\n    url='https://github.com/opendatacube/datacube-core',\n    author='Open Data Cube',\n    maintainer='Open Data Cube',\n    maintainer_email='',\n    description='An analysis environment for satellite and other earth observation data',\n    long_description=open('README.rst').read(),\n    license='Apache License 2.0',\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Natural Language :: English\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Topic :: Scientific/Engineering :: GIS\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n    ],\n\n    packages=find_packages(\n        exclude=('tests', 'tests.*',\n                 'integration_tests', 'integration_tests.*')\n    ),\n    package_data={\n        '': ['*.yaml', '*/*.yaml'],\n    },\n    scripts=[\n        'datacube_apps/scripts/pbs_helpers.sh'\n    ],\n    setup_requires=[\n        'pytest-runner'\n    ],\n    install_requires=[\n        'affine',\n        'cachetools',\n        'click>=5.0',\n        'cloudpickle>=0.4',\n        'dask[array]',\n        'gdal>=1.9',\n        'jsonschema',\n        'netcdf4',\n        'numpy',\n        'psycopg2',\n        'pypeg2',\n        'python-dateutil',\n        'pyyaml',\n        'rasterio~=1.0',\n        'singledispatch',\n        'sqlalchemy',\n        'toolz',\n        'xarray>=0.9',  # >0.9 fixes most problems with `crs` attributes being lost\n    ],\n    extras_require=extras_require,\n    tests_require=tests_require,\n\n    entry_points={\n        'console_scripts': [\n            'datacube = datacube.scripts.cli_app:cli',\n            'datacube-search = datacube.scripts.search_tool:cli',\n            'datacube-stacker = datacube_apps.stacker:main',\n            'datacube-worker = datacube.execution.worker:main',\n            'datacube-fixer = datacube_apps.stacker:fixer_main',\n            'datacube-ncml = datacube_apps.ncml:ncml_app',\n            'pixeldrill = datacube_apps.pixeldrill:main [interactive]',\n            'movie_generator = datacube_apps.movie_generator:main',\n            'datacube-simple-replica = datacube_apps.simple_replica:replicate [replicas]'\n        ],\n        'datacube.plugins.io.read': [\n            'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',\n            *extra_plugins['read'],\n        ],\n        'datacube.plugins.io.write': [\n            'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',\n            *extra_plugins['write'],\n        ],\n        'datacube.plugins.index': [\n            'default = datacube.index.index:index_driver_init',\n            *extra_plugins['index'],\n        ],\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nimport versioneer\nfrom setuptools import setup, find_packages\nimport os\n\ntests_require = [\n    'compliance-checker',\n    'hypothesis',\n    'mock',\n    'objgraph',\n    'pycodestyle',\n    'pylint',\n    'pytest',\n    'pytest-cov',\n    'pytest-timeout',\n]\n\nextras_require = {\n    'performance': ['ciso8601', 'bottleneck'],\n    'interactive': ['matplotlib', 'fiona'],\n    'distributed': ['distributed', 'dask[distributed]'],\n    'doc': ['Sphinx', 'setuptools'],\n    'replicas': ['paramiko', 'sshtunnel', 'tqdm'],\n    'celery': ['celery>=4', 'redis'],\n    's3': ['boto3', 'SharedArray', 'pathos', 'zstandard'],\n    'test': tests_require,\n}\n# An 'all' option, following ipython naming conventions.\nextras_require['all'] = sorted(set(sum(extras_require.values(), [])))\n\nextra_plugins = dict(read=[], write=[], index=[])\n\nif os.name != 'nt':\n    extra_plugins['read'].extend([\n        's3aio = datacube.drivers.s3.driver:reader_driver_init [s3]',\n        's3aio_test = datacube.drivers.s3.driver:reader_test_driver_init [s3]',\n    ])\n    extra_plugins['write'].extend([\n        's3aio = datacube.drivers.s3.driver:writer_driver_init [s3]',\n        's3aio_test = datacube.drivers.s3.driver:writer_test_driver_init [s3]',\n    ])\n\n    extra_plugins['index'].extend([\n        's3aio_index = datacube.drivers.s3aio_index:index_driver_init [s3]',\n    ])\n\nsetup(\n    name='datacube',\n    version=versioneer.get_version(),\n    cmdclass=versioneer.get_cmdclass(),\n    python_requires='>=3.5.2',\n\n    url='https://github.com/opendatacube/datacube-core',\n    author='Open Data Cube',\n    maintainer='Open Data Cube',\n    maintainer_email='',\n    description='An analysis environment for satellite and other earth observation data',\n    long_description=open('README.rst').read(),\n    license='Apache License 2.0',\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Natural Language :: English\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Topic :: Scientific/Engineering :: GIS\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n    ],\n\n    packages=find_packages(\n        exclude=('tests', 'tests.*',\n                 'integration_tests', 'integration_tests.*')\n    ),\n    package_data={\n        '': ['*.yaml', '*/*.yaml'],\n    },\n    scripts=[\n        'datacube_apps/scripts/pbs_helpers.sh'\n    ],\n    setup_requires=[\n        'pytest-runner'\n    ],\n    install_requires=[\n        'affine',\n        'cachetools',\n        'click>=5.0',\n        'cloudpickle>=0.4',\n        'dask[array]',\n        'gdal>=1.9',\n        'jsonschema',\n        'netcdf4',\n        'numpy',\n        'psycopg2',\n        'pypeg2',\n        'python-dateutil',\n        'pyyaml',\n        'rasterio>=1.0.2',  # Multi-band re-project fixed in that version\n        'singledispatch',\n        'sqlalchemy',\n        'toolz',\n        'xarray>=0.9',  # >0.9 fixes most problems with `crs` attributes being lost\n    ],\n    extras_require=extras_require,\n    tests_require=tests_require,\n\n    entry_points={\n        'console_scripts': [\n            'datacube = datacube.scripts.cli_app:cli',\n            'datacube-search = datacube.scripts.search_tool:cli',\n            'datacube-stacker = datacube_apps.stacker:main',\n            'datacube-worker = datacube.execution.worker:main',\n            'datacube-fixer = datacube_apps.stacker:fixer_main',\n            'datacube-ncml = datacube_apps.ncml:ncml_app',\n            'pixeldrill = datacube_apps.pixeldrill:main [interactive]',\n            'movie_generator = datacube_apps.movie_generator:main',\n            'datacube-simple-replica = datacube_apps.simple_replica:replicate [replicas]'\n        ],\n        'datacube.plugins.io.read': [\n            'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',\n            *extra_plugins['read'],\n        ],\n        'datacube.plugins.io.write': [\n            'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',\n            *extra_plugins['write'],\n        ],\n        'datacube.plugins.index': [\n            'default = datacube.index.index:index_driver_init',\n            *extra_plugins['index'],\n        ],\n    },\n)\n", "path": "setup.py"}]}