Skip to content

Commit 3e629d2

Browse files
authored
add extras_require complete and test options (#566)
* add extras_require complete and test options * update extras * remove jupyter * update doc notes * replace conda with pip in readthedocs.yml * fix doc/docs typo * add all, replace complete with optional
1 parent d051264 commit 3e629d2

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

docs/sphinx/source/installation.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ non-editable way, use one of the following commands to install pvlib-python::
7373
# best option if you know what you are doing
7474
pip install pvlib
7575

76+
# get pvlib and optional dependencies from the Python Package Index
77+
# another option if you know what you are doing
78+
pip install pvlib[optional]
79+
7680
If your system complains that you don't have access privileges or asks
7781
for a password then you're probably trying to install pvlib into your
7882
system's Python distribution. This is usually a bad idea and you should
@@ -163,9 +167,9 @@ referred to as *conda environments*, but they're the same for our purposes.
163167
#. **Create** a new conda environment for pvlib and pre-install
164168
the required packages into the environment:
165169
``conda create --name pvlibdev python pandas scipy``
166-
#. **Activate** the new conda environment: ``source activate pvlibdev``
170+
#. **Activate** the new conda environment: ``conda activate pvlibdev``
167171
#. **Install** additional packages into your development environment:
168-
``conda install jupyter ipython matplotlib seaborn pytest nose flake8``
172+
``conda install jupyter ipython matplotlib pytest nose flake8``
169173

170174
The `conda documentation <https://conda.io/docs/index.html>`_ has more
171175
information on how to use conda virtual environments. You can also add
@@ -181,10 +185,12 @@ Good news -- installing the source code is the easiest part!
181185
With your conda/virtual environment still active...
182186

183187
#. **Install** pvlib-python in "development mode" by running
184-
``pip install -e /path/to/your/pvlib-python``.
185-
You remember this path from the clone step, right? It's probably
186-
something like ``C:\Users\%USER%\Documents\GitHub\pvlib-python``
187-
(Windows) or ``/Users/%USER%/Documents/pvlib-python`` (Mac).
188+
``pip install -e .`` from within the directory you previously cloned.
189+
Consider installing pvlib using ``pip install -e .[all]`` so that
190+
you can run the unit tests and build the documentation.
191+
Your clone directory is probably similar to
192+
``C:\Users\%USER%\Documents\GitHub\pvlib-python``(Windows) or
193+
``/Users/%USER%/Documents/pvlib-python`` (Mac).
188194
#. **Test** your installation by running ``python -c 'import pvlib'``.
189195
You're good to go if it returns without an exception.
190196

@@ -229,6 +235,11 @@ include:
229235

230236
The Anaconda distribution includes most of the above packages.
231237

238+
Alternatively, users may install all optional dependencies using
239+
240+
pip install pvlib[optional]
241+
242+
232243
.. _nrelspa:
233244

234245
NREL SPA algorithm

docs/sphinx/source/whatsnew/v0.6.0.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,13 @@ Enhancements
117117
* Add irradiance.clearness_index_zenith_independent function. (:issue:`396`)
118118
* Add checking for consistency between module_parameters and dc_model. (:issue:`417`)
119119
* Add DC model methods ``'desoto'`` and ``'pvsyst'`` to ModelChain (:issue:`487`)
120-
* Add the CEC module model in `pvsystem.calcparams_cec` and `ModelChain.cec`. (:issue:`463`)
120+
* Add the CEC module model in `pvsystem.calcparams_cec` and `ModelChain.cec`. (:issue:`463`)
121121
* Add DC model methods desoto and pvsyst to ModelChain (:issue:`487`)
122+
* pvlib now ships with a pvlib[optional] installation option to automatically
123+
install packages needed to support additional pvlib features:
124+
``pip install pvlib[optional]``. Additional installation options include
125+
`doc` (requirements for minimal documentation build), `test` (requirements
126+
for testing), and `all` (optional + doc + test). (:issue:`553`, :issue:`483`)
122127
* Set default alpha to 1.14 in :func:`~pvlib.atmosphere.angstrom_aod_at_lambda` (:issue:`563`)
123128

124129

readthedocs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
conda:
2-
file: docs/environment.yml
31
python:
4-
version: 2
5-
setup_py_install: true
2+
version: 3
3+
use_system_site_packages: true
4+
pip_install: true
5+
extra_requirements:
6+
- all

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@
4242
'pytz',
4343
'six',
4444
]
45-
TESTS_REQUIRE = ['pytest', 'nose']
45+
TESTS_REQUIRE = ['pytest', 'pytest-cov', 'pytest-mock', 'nose']
46+
EXTRAS_REQUIRE = {
47+
'optional': ['scipy', 'tables', 'numba', 'siphon', 'netcdf4', 'ephem'],
48+
'doc': ['sphinx', 'ipython', 'sphinx_rtd_theme', 'numpydoc',
49+
'matplotlib'],
50+
'test': TESTS_REQUIRE
51+
}
52+
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))
4653

4754
CLASSIFIERS = [
4855
'Development Status :: 4 - Beta',
@@ -94,6 +101,7 @@
94101
cmdclass=versioneer.get_cmdclass(),
95102
packages=PACKAGES,
96103
install_requires=INSTALL_REQUIRES,
104+
extras_require=EXTRAS_REQUIRE,
97105
tests_require=TESTS_REQUIRE,
98106
ext_modules=extensions,
99107
description=DESCRIPTION,

0 commit comments

Comments
 (0)