Skip to content

[DOCS] Development guide for pip-people incomplete? #7358

Closed

Description

@rubenvdg

In the Development Guidelines it says that for pip-people to work on the dask code base one needs to do:

python -m pip install -e ".[complete]"

to be able to develop. In my experience, this did not work since all kinds of dependencies are missing (scipy, scikit-image, pytest, etc). Am I missing something, or is the documentation incomplete/incorrect?'

I would e.g. expect that I'd be able to run py.test dask --verbose --doctest-modules, but this is by no means the case.

Activity

  1. jsignell commented on Mar 10, 2021

    @jsignell
    Member

    Oh! That is very true. If you install with pip you'll be missing the testing dependencies at the very least. The tests should all run without optional dependencies like scipy or scikit-image. I'm wondering if this is best handled by adding more docs, or by having a pip install -e ".[test]". Docs is definitely quicker.

    In the meantime you should be able to do:

    pip install pytest pytest-rerunfailures pytest-xdist
  2. rubenvdg commented on Mar 10, 2021

    @rubenvdg
    ContributorAuthor

    Thanks for the prompt reply. If I do pip install -e ".[test]" I get:

    Obtaining file:///Users/rvdgeer/Documents/dask
      WARNING: dask 2021.3.0+13.gba5fa1b0 does not provide the extra 'test'
    

    i.e., there's no "test" specified in extras_require in setup.py.

  3. jsignell commented on Mar 10, 2021

    @jsignell
    Member

    oh yeah sorry that was unclear. I meant should there be a .[test]? We can easily add it in the setup.py.

  4. rubenvdg commented on Mar 10, 2021

    @rubenvdg
    ContributorAuthor

    Ah I misunderstood. Yeah that could help. However, still if I do (in a fresh pyenv):

    pip install -e ".[complete]"
    pip install pytest pytest-rerunfailures pytest-xdist
    py.test dask --verbose --doctest-modules
    

    I catch:

    ======================================================================================== ERRORS ========================================================================================
    _________________________________________________________________________ ERROR collecting dask/array/stats.py _________________________________________________________________________
    dask/array/stats.py:39: in <module>
        import scipy.stats
    E   ModuleNotFoundError: No module named 'scipy'
    
    The above exception was the direct cause of the following exception:
    dask/array/stats.py:41: in <module>
        raise ImportError("`dask.array.stats` requires `scipy` to be installed.") from e
    E   ImportError: `dask.array.stats` requires `scipy` to be installed.
    =============================================================================== short test summary info ================================================================================
    SKIPPED [2] dask/array/tests/test_cupy.py:13: could not import 'cupy': No module named 'cupy'
    SKIPPED [2] dask/array/tests/test_image.py:6: could not import 'skimage': No module named 'skimage'
    SKIPPED [2] dask/array/tests/test_linalg.py:4: could not import 'scipy': No module named 'scipy'
    SKIPPED [2] dask/array/tests/test_linearoperator.py:3: could not import 'scipy': No module named 'scipy'
    SKIPPED [2] dask/array/tests/test_sparse.py:12: could not import 'sparse': No module named 'sparse'
    SKIPPED [2] dask/array/tests/test_stats.py:3: could not import 'scipy': No module named 'scipy'
    SKIPPED [2] dask/array/tests/test_xarray.py:6: could not import 'xarray': No module named 'xarray'
    SKIPPED [2] dask/bag/tests/test_avro.py:6: could not import 'fastavro': No module named 'fastavro'
    SKIPPED [2] dask/bytes/tests/test_http.py:14: could not import 'requests': No module named 'requests'
    SKIPPED [2] dask/bytes/tests/test_s3.py:13: could not import 's3fs': No module named 's3fs'
    SKIPPED [2] dask/dataframe/io/tests/test_orc.py:12: could not import 'pyarrow.orc': No module named 'pyarrow'
    SKIPPED [2] dask/dataframe/io/tests/test_sql.py:13: could not import 'sqlalchemy': No module named 'sqlalchemy'
    SKIPPED [2] dask/tests/test_cache.py:9: could not import 'cachey': No module named 'cachey'
    SKIPPED [2] dask/tests/test_dot.py:11: could not import 'graphviz': No module named 'graphviz'
    

    or am I missing something somewhere?

  5. jsignell commented on Mar 10, 2021

    @jsignell
    Member

    You are right! The regular tests run fine: pytest -nauto but the doctests are missing a skip. Thanks for bringing this up! I'll add it to #7345

    It's something like:

    diff --git a/conftest.py b/conftest.py
    index af08311e..d073a99b 100644
    --- a/conftest.py
    +++ b/conftest.py
    @@ -26,6 +26,11 @@ try:
     except ImportError:
         collect_ignore_glob.append("dask/dataframe/*")
     
    +try:
    +    import scipy  # noqa: F401
    +except ImportError:
    +    collect_ignore.append("dask/array/stats.py")
    +
     
     def pytest_addoption(parser):
         parser.addoption("--runslow", action="store_true", help="run slow tests")
  6. GenevieveBuckley commented on Mar 22, 2021

    @GenevieveBuckley
    Contributor

    If #7360 was merged, can this issue be closed now @jsignell? Just flagging it for you.

  7. jrbourbeau commented on Mar 22, 2021

    @jrbourbeau
    Member

    Ah yes, thanks for following up here @GenevieveBuckley!

  8. KoenSR commented on Oct 13, 2021

    @KoenSR

    The Development Guidelines still don't seem to be accurate. I have run python -m pip install -e ".[complete,test]" in a fresh virtual environment. Subsequently, py.test dask --verbose --doctest-modules results in:

    dask/dataframe/io/orc/arrow.py:1: in <module>
        import pyarrow as pa
    E   ModuleNotFoundError: No module named 'pyarrow'
    

    Should the documentation be updated?

  9. GenevieveBuckley commented on Oct 13, 2021

    @GenevieveBuckley
    Contributor

    Good catch, thanks for reporting it @KoenSR

  10. jrbourbeau commented on Oct 14, 2021

    @jrbourbeau
    Member

    Closed via #8256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions