@@ -35,7 +35,6 @@ General Information
35
35
Dependencies
36
36
------------
37
37
38
- Run ``make check `` to test if all required dependencies are installed on your system.
39
38
OS-specific installation instructions are found either online at
40
39
http://invest.readthedocs.io/en/latest/installing.html or locally at ``doc/api-docs/installing.rst ``.
41
40
@@ -57,30 +56,50 @@ Or on Windows, use the following instead from a CMD prompt::
57
56
> make env
58
57
> .\env\bin\activate
59
58
60
- This makefile target is included for convenience ... you may of course choose to
61
- manage your own virtual environment. ``requirements.txt ``,
62
- ``requirements-dev.txt `` and ``requirements-docs.txt `` list the python
63
- dependencies needed.
59
+ This makefile target is included for convenience. It uses ``conda `` and installs packages from ``conda-forge ``.
60
+ It also uses the `-p ` flag with `conda create `, creating a `./env ` folder containing the environment.
64
61
65
- Using a different environment name
66
- """"""""""""""""""""""""""""""""""
67
- If you prefer a different name for your environment, you may pass the environment name as
62
+ Using a different environment folder name
63
+ """""""""""""""""""""""""""""""""""""""""
64
+ If you prefer a different path for your environment, you may pass the environment path as
68
65
a parameter to make::
69
66
70
67
$ make ENV=myEnv env
71
68
72
- You could then activate the environment created at ``myEnv ``.
69
+ You could then activate the environment created at ``./ myEnv ``.
73
70
74
71
75
72
Using a different environment management tool
76
73
"""""""""""""""""""""""""""""""""""""""""""""
77
- The InVEST Makefile uses ``virtualenv `` to set up an environment, but this is
78
- not the only `environment management tool out there
79
- <https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments> `_.
80
- You may elect to manage your virtual environment a different way, independent
81
- of ``make env ``. The only requirement for the build process is that the required
82
- tools are available on your PATH and the required python packages can be imported.
74
+ You may of course choose to manage your own virtual environment without using the Makefile.
75
+
76
+ We suggest using ``conda `` or ``mamba `` and ``conda-forge ``.
77
+
78
+ ``requirements.txt ``, ``requirements-dev.txt `` and ``requirements-docs.txt `` list the python
79
+ dependencies needed.
80
+
81
+ Installing ``natcap.invest `` from local source code
82
+ """""""""""""""""""""""""""""""""""""""""""""""""""
83
+ From an activated virtual environment, it's safest to uninstall any existing installation
84
+ and then install `natcap.invest `::
85
+
86
+ $ pip uninstall natcap.invest
87
+ $ make install
88
+
89
+ In practice, it can be convenient to use an "editable install" instead to avoid needing
90
+ to uninstall & re-install after making changes to source code::
91
+
92
+ $ pip install -e .
93
+
94
+ Note that with an editable install any changes to non-Python (Cython, C++) files will
95
+ require compilation using one of the above installation methods.
96
+
97
+ *The Workbench is not part of the * ``natcap.invest `` *Python package. See *
98
+ ``workbench/readme.md `` *for developer details. *
83
99
100
+ A successful ``natcap.invest `` installation will include the InVEST CLI::
101
+
102
+ $ invest list
84
103
85
104
Building InVEST Distributions
86
105
-----------------------------
@@ -145,6 +164,13 @@ To build the user's guide::
145
164
This will build HTML and PDF documentation, writing them to ``dist/userguide ``
146
165
and ``dist/InVEST_*_Documentation.pdf ``, respectively.
147
166
167
+ The User's Guide is maintained in a separate git repository. InVEST will build
168
+ the User's Guide with the commit defined in the ``Makefile ``::
169
+
170
+ GIT_UG_REPO := https://github.com/natcap/invest.users-guide
171
+ GIT_UG_REPO_PATH := doc/users-guide
172
+ GIT_UG_REPO_REV := f203ec069f9f03560c9a85b268e67ebb6b994953
173
+
148
174
149
175
API Documentation
150
176
+++++++++++++++++
@@ -168,22 +194,12 @@ build zip archives of the sample data::
168
194
169
195
This will write the data zipfiles to ``dist/data ``. ``git `` command is needed.
170
196
171
- Single archive of sample data
172
- +++++++++++++++++++++++++++++
173
-
174
- For trainings, it is especially convenient to distribute all sample data as a
175
- single zip archive. As an added bonus, this single zip archive can be provided
176
- to the InVEST installer for Windows as either the 'Advanced' input on the front
177
- page of the installer, or by a CLI flag, thus preventing the installer from
178
- downloading datasets from the internet. See
179
- ``installer/windows/invest_installer.nsi `` for more details. To build a single
180
- archive of all InVEST sample data::
181
-
182
- $ make sampledata_single
183
-
184
- This will write the single sampledata archive to
185
- ``dist/InVEST_*_sample_data.zip ``.
197
+ Sample data is tracked in a ``git-lfs `` repo and will be packaged based on the commit
198
+ defined in the ``Makefile ``::
186
199
200
+ GIT_SAMPLE_DATA_REPO := https://bitbucket.org/natcap/invest-sample-data.git
201
+ GIT_SAMPLE_DATA_REPO_PATH := $(DATA_DIR)/invest-sample-data
202
+ GIT_SAMPLE_DATA_REPO_REV := 0f8b41557753dad3670ba8220f41650b51435a93
187
203
188
204
Tests
189
205
-----
@@ -197,6 +213,16 @@ To run tests on the suite of Ecosystem Service models in InVEST::
197
213
198
214
$ make test
199
215
216
+ Tests depend on test data that is tracked in a ``git-lfs `` repo defined in the ``Makefile ``::
217
+
218
+ GIT_TEST_DATA_REPO := https://bitbucket.org/natcap/invest-test-data.git
219
+ GIT_TEST_DATA_REPO_PATH := $(DATA_DIR)/invest-test-data
220
+ GIT_TEST_DATA_REPO_REV := 324abde73e1d770ad75921466ecafd1ec6297752
221
+
222
+ Test data (and Sample Data) can be retrieved using::
223
+
224
+ $ make fetch
225
+
200
226
201
227
Changing how GNU make runs tests
202
228
++++++++++++++++++++++++++++++++
0 commit comments