holoviz-dev / pyctdev

Python packaging Common Tasks for Developers
BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

`develop_install` installs the `tests` group by default #81

Closed maximlt closed 2 years ago

maximlt commented 2 years ago

Just realized that after using develop_install for a while now in a few projects. See as a proof the output of a command that failed when trying to build the docs of holoviews:

  doit develop_install -c pyviz/label/dev -c conda-forge -o doc

Notice flake8, pytest and the likes, who shouldn't really be there!

Command error: 'conda install -y  -c pyviz/label/dev -c conda-forge "param >=1.9.3,<2.0" "numpy >=1.0" "pyviz_comms >=0.7.4" "panel >=0.9.5" "colorcet" "pandas >=0.20.0" "pytest" "pytest-cov" "mock" "flake8" "coveralls" "path.py" "matplotlib >=3" "nbsmoke >=0.2.0" "nbconvert" "twine" "rfc3986" "keyring" "ipython >=5.4.0" "notebook" "matplotlib >=3" "bokeh >=1.1.0" "networkx" "pillow" "xarray >=0.10.4" "plotly >=4.0" "dash >=1.16" "streamz >=0.5.0" "datashader >=0.11.1" "ffmpeg" "cftime" "netcdf4" "dask" "scipy" "shapely" "scikit-image" "pyarrow" "ibis-framework >=1.3" "nbsite >=0.7.1" "sphinx" "sphinx_holoviz_theme" "mpl_sample_data >=3.1.3" "pscript" "graphviz" "bokeh >2.2"' returned 137

This may come from the fact that tests is the default group installed: https://github.com/pyviz-dev/pyctdev/blob/d11c91aaa81c6034bdc42ce547823248acc05efb/pyctdev/util.py#L81-L89

There's a hack just below that that we may wanna use instead: https://github.com/pyviz-dev/pyctdev/blob/d11c91aaa81c6034bdc42ce547823248acc05efb/pyctdev/util.py#L91-L98

By replacing _options_param by _options_param2 here: https://github.com/pyviz-dev/pyctdev/blob/d11c91aaa81c6034bdc42ce547823248acc05efb/pyctdev/_conda.py#L873

jbednar commented 2 years ago

Doesn't development necessarily include testing? I.e., wouldn't any developer also need to run the tests before submitting a change?

maximlt commented 2 years ago

It depends on what you change I guess. If I change the template or CSS of a site and want to build it again I for sure do not want to have pytest or flake8 installed by default. I'd rather have to explicitely write -o tests when I want the tests dependencies, I believe it's what we're recommending (see panel's developer guide) or doing in our CI (see panel's workflow).