Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: 13 warnings, 1 error #2084

Closed
yurivict opened this issue Aug 5, 2022 · 13 comments
Closed

Tests: 13 warnings, 1 error #2084

yurivict opened this issue Aug 5, 2022 · 13 comments
Labels

Comments

@yurivict
Copy link

yurivict commented Aug 5, 2022

==================================================================================== test session starts =====================================================================================
platform freebsd13 -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/disk-samsung/freebsd-ports/math/py-arviz/work-py39/arviz-0.12.1/.hypothesis/examples')
rootdir: /disk-samsung/freebsd-ports/math/py-arviz/work-py39/arviz-0.12.1
plugins: forked-1.4.0, rerunfailures-10.1, hypothesis-6.51.0, xdist-2.5.0, cov-2.9.0, typeguard-2.13.3
collected 3402 items / 1 error / 5 skipped                                                                                                                                                   

=========================================================================================== ERRORS ===========================================================================================
_______________________________________________________________ ERROR collecting arviz/tests/external_tests/test_data_pymc.py ________________________________________________________________
arviz/tests/external_tests/test_data_pymc.py:44: in <module>
    class TestDataPyMC3:
arviz/tests/external_tests/test_data_pymc.py:225: in TestDataPyMC3
    packaging.version.Version(pm.__version__) < packaging.version.Version("3.9.0"),
E   NameError: name 'pm' is not defined
====================================================================================== warnings summary ======================================================================================
../../../../../../usr/local/lib/python3.9/site-packages/matplotlib/__init__.py:152
../../../../../../usr/local/lib/python3.9/site-packages/matplotlib/__init__.py:152
../../../../../../usr/local/lib/python3.9/site-packages/matplotlib/__init__.py:152
../../../../../../usr/local/lib/python3.9/site-packages/matplotlib/__init__.py:152
../../../../../../usr/local/lib/python3.9/site-packages/matplotlib/__init__.py:152
  /usr/local/lib/python3.9/site-packages/matplotlib/__init__.py:152: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(module.__version__) < minver:

../../../../../../usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py:346
../../../../../../usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py:346
../../../../../../usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py:346
../../../../../../usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py:346
../../../../../../usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py:346
  /usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py:346: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    other = LooseVersion(other)

arviz/tests/base_tests/test_plots_matplotlib.py:550
  /disk-samsung/freebsd-ports/math/py-arviz/work-py39/arviz-0.12.1/arviz/tests/base_tests/test_plots_matplotlib.py:550: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

arviz/tests/helpers.py:21
  /disk-samsung/freebsd-ports/math/py-arviz/work-py39/arviz-0.12.1/arviz/tests/helpers.py:21: PytestCollectionWarning: cannot collect test class 'TestRandomVariable' because it has a __init__ constructor (from: arviz/tests/base_tests/test_plots_matplotlib.py)
    class TestRandomVariable:

arviz/tests/helpers.py:21
  /disk-samsung/freebsd-ports/math/py-arviz/work-py39/arviz-0.12.1/arviz/tests/helpers.py:21: PytestCollectionWarning: cannot collect test class 'TestRandomVariable' because it has a __init__ constructor (from: arviz/tests/base_tests/test_utils.py)
    class TestRandomVariable:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ===================================================================================
SKIPPED [1] arviz/tests/helpers.py:630: could not import 'zarr': No module named 'zarr'
SKIPPED [1] arviz/tests/helpers.py:630: could not import 'bokeh.plotting': No module named 'bokeh'
SKIPPED [1] arviz/tests/helpers.py:630: could not import 'emcee': No module named 'emcee'
SKIPPED [1] arviz/tests/helpers.py:630: could not import 'jax': No module named 'jax'
SKIPPED [1] arviz/tests/helpers.py:630: could not import 'torch': No module named 'torch'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================= 5 skipped, 13 warnings, 1 error in 10.28s ==========================================================================
*** Error code 2

Version: 0.12.1
FreeBSD 13.1

@OriolAbril
Copy link
Member

It looks like some dependencies are missing. To be able to run all the tests in the test suite (from both base_tests and external_tests folders) you need to install:

requirements.txt  # arviz dependencies
requirements-dev.txt  # testing related dependencies like pytest
requirements-optional.txt  # optinonal dependencies, they are tested in base_test
requirements-external.txt  # to be able to execute tests in external_tests

hope it helps.

@yurivict
Copy link
Author

yurivict commented Aug 5, 2022

I think test dependencies are supposed to be in requirements-test.txt.

@OriolAbril
Copy link
Member

It is much more convenient for us to spllit the dependencies in this way. For example, I often develop on my laptop where I don't install requirements-external nor run the tests in external_tests folder which are trickier to install and require more resources. What I generally do is:

pip install -e ".[all]"
pip install -r requirements-dev.txt
# only if developing from a desktop computer
pip install -r requirements-external.txt

is there a PEP or something of the sort that says test dependencies should be in a single file called requirements-test?

@yurivict
Copy link
Author

yurivict commented Aug 5, 2022

is there a PEP or something of the sort that says test dependencies should be in a single file called requirements-test?

I am not a Python expert so I don't know for sure. But if you google "requirements-test.txt" you get a lot of hits, for example https://github.com/amphibian-dev/toad/blob/master/requirements-test.txt

I maintain the FreeBSD port for arviz. In order for tests to always have the right dependencies we need to populate the TEST_DEPENDS clause. It's easier to get these from the file "requirements-test.txt" than to add several other requirements files where most entries aren't relevant for tests.

@OriolAbril
Copy link
Member

There are a couple of dependencies in requirements-dev that are not relevant for tests, linters like pylint or pydocstyle, but all the dependencies on the other files are relevant and required for tests to pass. Is the issues with having to list multiple files or with the non-testing dependencies included?

@OriolAbril
Copy link
Member

Would for example adding a requirements-test.txt with the following content work?

pytest
pytest-cov
cloudpickle

-r requirements-optional.txt
-r requirements-external.txt

@yurivict
Copy link
Author

yurivict commented Aug 5, 2022

If all of requirements-optional.txt and requirements-external.txt are needed - this should be okay.

@camillebruckmann
Copy link
Contributor

Hey, I would like to make my first contribution. Can I work on this one?

@OriolAbril
Copy link
Member

That would be great, thanks!

@camillebruckmann
Copy link
Contributor

When I try to install the requirements in requirements-external.txt, I get an error when installing the third package, pymc3 @ git+https://github.com/pymc-devs/pymc3. It appears that pymc3 no longer exists and has been replaced by pymc (see here and here). pymc3 is still available on pypip, and can be installed if we replace pymc3 @ git+https://github.com/pymc-devs/pymc3 with pymc3. However, if there is no reason to keep pymc3, perhaps it is better to replace it with pymc. @OriolAbril thoughts?

@OriolAbril
Copy link
Member

use pymc3.

It should not be pymc because from 4.0 upwards, the converter is inside pymc directly, and it is already tested there. I think we should keep pymc3 for a bit more here so we still test the <4 converter but yes, it should eventually be removed.

@camillebruckmann
Copy link
Contributor

Thank you for the clarification!

@OriolAbril
Copy link
Member

closed by #2169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants