Skip to content

Commit

Permalink
Update windows install instructions (#2039)
Browse files Browse the repository at this point in the history
* Update readme

* Note that running tests locally requires installing in editable mode

* Update corresponding section in installation notes

* clarify note about --no-use-pep517
  • Loading branch information
underchemist committed Nov 16, 2020
1 parent d27877c commit 1837a77
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ package layout.

To run the entire suite and the code coverage report:

Note: rasterio must be installed in editable mode in order to run tests.

.. code-block:: console
$ py.test --cov rasterio --cov-report term-missing
Expand Down
19 changes: 16 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,25 @@ cannot rely on gdal-config, which is only present on UNIX systems, to discover
the locations of header files and libraries that rasterio needs to compile its
C extensions. On Windows, these paths need to be provided by the user. You
will need to find the include files and the library files for gdal and use
setup.py as follows.
setup.py as follows. You will also need to specify the installed gdal version
through the GDAL_VERSION environment variable.

.. code-block:: console
$ python setup.py build_ext -I<path to gdal include files> -lgdal_i -L<path to gdal library>
$ python setup.py install
$ python setup.py build_ext -I<path to gdal include files> -lgdal_i -L<path to gdal library> install
With pip

.. code-block:: console
$ pip install --no-use-pep517 --global-option -I<path to gdal include files> -lgdal_i -L<path to gdal library> .
Note: :code:`--no-use-pep517` is required as pip currently hasn't implemented a
way for optional arguments to be passed to the build backend when using PEP 517.
See `here <https://github.com/pypa/pip/issues/5771>`__. for more details.

Alternatively environment variables (e.g. INCLUDE and LINK) used by MSVC compiler can be used to point
to include directories and library files.

We have had success compiling code using the same version of Microsoft's
Visual Studio used to compile the targeted version of Python (more info on
Expand Down
16 changes: 14 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,20 @@ setup.py as follows.

.. code-block:: console
$ python setup.py build_ext -I<path to gdal include files> -lgdal_i -L<path to gdal library>
$ python setup.py install
$ python setup.py build_ext -I<path to gdal include files> -lgdal_i -L<path to gdal library> install
With pip

.. code-block:: console
$ pip install --no-use-pep517 --global-option -I<path to gdal include files> -lgdal_i -L<path to gdal library> .
Note: :code:`--no-use-pep517` is required as pip currently hasn't implemented a
way for optional arguments to be passed to the build backend when using PEP 517.
See `here <https://github.com/pypa/pip/issues/5771>`__. for more details.

Alternatively environment variables (e.g. INCLUDE and LINK) used by MSVC compiler can be used to point
to include directories and library files.

We have had success compiling code using the same version of Microsoft's
Visual Studio used to compile the targeted version of Python (more info on
Expand Down

0 comments on commit 1837a77

Please sign in to comment.