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

Dropping nose as a dependency #1480

Merged
merged 3 commits into from Jul 18, 2017

Conversation

Projects
None yet
5 participants
@utkbansal
Member

utkbansal commented Jul 13, 2017

Fixes #884

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@utkbansal utkbansal referenced this pull request Jul 13, 2017

Merged

Port analysis module to pytest #1450

0 of 4 tasks complete
@kain88-de

nose also has to be removed from setup.py our nose wrapper script should be removed. Also grep and look through the repository if we mention nose anywhere else and should replace it with pytest.

@utkbansal

This comment has been minimized.

Member

utkbansal commented Jul 13, 2017

@kain88-de We've got from nose.plugins.attrib import attr all over the tests. Can't go ahead with this until I get rid of all attr. Should that be done in this PR or a separate one?

@kain88-de

This comment has been minimized.

Member

kain88-de commented Jul 13, 2017

you can remove attr in this PR. It doesn't do anything special

@jbarnoud

This comment has been minimized.

Contributor

jbarnoud commented Jul 14, 2017

Since you're at it, you can update testsuite/CHANGELOG.

@richardjgowers

This comment has been minimized.

Member

richardjgowers commented Jul 14, 2017

This would officially fix #884!

.travis.yml Outdated
NOSE_COVERAGE='--with-coverage --cover-package MDAnalysis'
PYTEST_COVERAGE='--cov=MDAnalysis'
MAIN_CMD='export COVERAGE_FILE=$PYTEST_COVERAGE_FILE; pytest ${PYTEST_LIST} ${PYTEST_FLAGS} ${PYTEST_COVERAGE}; export COVERAGE_FILE=$NOSE_COVERAGE_FILE; python ./testsuite/MDAnalysisTests/mda_nosetests ${NOSE_TEST_LIST} ${NOSE_FLAGS} ${NOSE_COVERAGE}'
MAIN_CMD='pytest testsuite/MDAnalysisTests/ ${PYTEST_FLAGS} --cov=MDAnalysis'

This comment has been minimized.

@kain88-de

kain88-de Jul 14, 2017

Member

can't you just update the PYTEST_FLAGS variable here instead of rewriting MAIN_CMD?

@kain88-de

the setup.py changes are still missing

@@ -150,28 +147,4 @@
in_dir,
assert_nowarns,
)
from MDAnalysisTests.core.util import make_Universe
def run(*args, **kwargs):

This comment has been minimized.

@kain88-de

kain88-de Jul 14, 2017

Member

it would be nice if you could keep this method. This is shown in our docs how to run the tests yourself from an installation of MDAnalysisTests

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

So this will then be deleted when we do the next release?

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

@kain88-de This function has calls to loaded_plugins which comes from from MDAnalysisTests.plugins which in turn depend upon nose. What should I do?

This comment has been minimized.

@kain88-de

kain88-de Jul 14, 2017

Member

modify this function so that I can still to MDAnalysisTests.run() in an interpreter. This should start the pytest tests. I don't really care how the function is doing that. But it has to be rewritten.

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

So basically, I'm writing a wrapper to run pytest via this run method?

This comment has been minimized.

@kain88-de
@utkbansal

This comment has been minimized.

Member

utkbansal commented Jul 14, 2017

@kain88-de @richardjgowers @jbarnoud Is the maintainer/run_tests.sh file obsolete? Should I drop the file?

@kain88-de

This comment has been minimized.

Member

kain88-de commented Jul 14, 2017

sure remove that as well. No one of us uses it anymore.

@jbarnoud

This comment has been minimized.

Contributor

jbarnoud commented Jul 14, 2017

@kain88-de

testsuite/INSTALL and package/MDAnalysis/tests/init.py also contain comments about nose. Please update and replace them with appropriate pytest information if applicable.

@@ -114,6 +114,9 @@
"""
from __future__ import absolute_import
import logging
import pytest

This comment has been minimized.

@kain88-de

kain88-de Jul 14, 2017

Member

there are still a lot of nose comments in this file

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

@kain88-de Do I have to update all the comments involving nose in all the files?

This comment has been minimized.

@kain88-de

kain88-de Jul 14, 2017

Member

Yes please. There is no sense in having them. Only a few might be useful.

def run(*args, **kwargs):
pytest.main()

This comment has been minimized.

@kain88-de

kain88-de Jul 14, 2017

Member

did you test this?

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

It's still running. Everything fine till now.

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

Do I have to update all comments related to nose in all files?

This comment has been minimized.

@utkbansal

utkbansal Jul 14, 2017

Member

@kain88-de Confirmed, it works.

@orbeckst orbeckst referenced this pull request Jul 14, 2017

Closed

update wiki with new test instructions #1489

2 of 2 tasks complete
@orbeckst

This comment has been minimized.

Member

orbeckst commented Jul 14, 2017

We also need new instructions for the wiki #1489.

@@ -92,16 +92,14 @@
Writing test cases
==================
The unittests use the :mod:`unittest` module together with nose_. See the
The unittests use the :mod:`pytest` module. See the

This comment has been minimized.

@kain88-de

kain88-de Jul 15, 2017

Member

This should be pytest_ so that it links in the docs.

This comment has been minimized.

@utkbansal

utkbansal Jul 15, 2017

Member

@kain88-de :mod:pytest_ ??

This comment has been minimized.

@kain88-de

kain88-de Jul 15, 2017

Member

with out the mod sphinx likely wouldn't link to the right page

@kain88-de

test_streamio and test_trpparser still contain comments about nose.

@kain88-de

This comment has been minimized.

Member

kain88-de commented Jul 16, 2017

@utkbansal I'd appreciate if you prioritize this PR

@utkbansal

This comment has been minimized.

Member

utkbansal commented Jul 16, 2017

@kain88-de The test in test_streamio that has a comment on nose is a yield based test. I'd rather leave it there till I fix it properly.

@utkbansal

This comment has been minimized.

Member

utkbansal commented Jul 16, 2017

@kain88-de Will this PR be squashed and merged or can I clean up the history?

utkbansal added some commits Jul 14, 2017

Remove mda_nosetests and nose plugins
Remove nose from dependencies & implement run method
@kain88-de

minor clean up still do to. But good progress.

@@ -84,9 +84,9 @@ From sources
From the top directory of the checked out sources:
./testsuite/MDAnalysisTests/mda_nosetests --exe -v --processes=4 --process-timeout=120
pytest /testsuite/MDAnalysisTests/ -n=3

This comment has been minimized.

@kain88-de

kain88-de Jul 17, 2017

Member

please add a note that the pytest-xdist package should be installed to run tests in parallel.

This comment has been minimized.

@kain88-de

kain88-de Jul 17, 2017

Member

and use the new pytest.xdist variable numprocesses

@@ -90,22 +67,13 @@
Writing test cases
==================
The unittests use the :mod:`unittest` module together with nose_. See the
The unittests use the :mod:`pytest` module. See the

This comment has been minimized.

@kain88-de

kain88-de Jul 17, 2017

Member

here we should also have a link

This comment has been minimized.

@utkbansal
@@ -36,9 +36,7 @@
assert_array_almost_equal,
assert_raises,

This comment has been minimized.

@kain88-de

kain88-de Jul 17, 2017

Member

can you remove this import as well. Seems like you already changed all occurrences of this

@@ -213,7 +213,7 @@ def dynamic_author_list():
long_description=LONG_DESCRIPTION,
install_requires=[
'MDAnalysis=={0!s}'.format(RELEASE), # same as this release!
'nose>=1.3.7',
'numpy>=1.10.4',

This comment has been minimized.

@kain88-de

kain88-de Jul 17, 2017

Member

Please remove this line when you do the rebase. It's not there in develop right now.

This comment has been minimized.

@utkbansal

utkbansal Jul 17, 2017

Member

@kain88-de Remove numpy?

This comment has been minimized.

@kain88-de

kain88-de Jul 17, 2017

Member

yes it's already installed with MDAnalysis anyway.

Drop comments for running tests with nose
Fix Install docs

Update CHANGELOG

Cleanup docs

@kain88-de kain88-de merged commit 3dd9d3c into MDAnalysis:develop Jul 18, 2017

3 checks passed

QuantifiedCode No new issues introduced. 5 issue(s) fixed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 90.4%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment