From 91954324f53f84e0b7899f1baa52129868a75d46 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 09:02:17 -0500 Subject: [PATCH 1/9] Update, simplify requirements Bump versions for new requirements. Allow pip to choose versions for more requirements. Update code for new versions of linting tools. --- django_nose/runner.py | 7 ++++--- django_nose/tools.py | 7 ++++--- requirements.txt | 34 +++++++++++++--------------------- setup.py | 1 + testapp/settings.py | 1 + 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/django_nose/runner.py b/django_nose/runner.py index 123c406..d37b9dd 100644 --- a/django_nose/runner.py +++ b/django_nose/runner.py @@ -246,7 +246,8 @@ def run_suite(self, nose_argv): return result_plugin.result def run_tests(self, test_labels, extra_tests=None): - """Run the unit tests for all the test names in the provided list. + """ + Run the unit tests for all the test names in the provided list. Test names specified may be file or module names, and may optionally indicate the test case to run by separating the module or file name @@ -259,7 +260,6 @@ def run_tests(self, test_labels, extra_tests=None): not the whole string. Examples: - runner.run_tests( ('test.module',) ) runner.run_tests(['another.test:TestCase.test_method']) runner.run_tests(['a.test:TestCase']) @@ -271,6 +271,7 @@ def run_tests(self, test_labels, extra_tests=None): but the extra tests will not be run. Maybe later. Returns the number of tests that failed. + """ nose_argv = (['nosetests'] + list(test_labels)) if hasattr(settings, 'NOSE_ARGS'): @@ -435,7 +436,7 @@ def _get_models_for_connection(self, connection): m._meta.db_table in tables] def setup_databases(self): - """Setup databases, skipping DB creation if requested and possible.""" + """Set up databases. Skip DB creation if requested and possible.""" for alias in connections: connection = connections[alias] creation = connection.creation diff --git a/django_nose/tools.py b/django_nose/tools.py index 4469691..c341a1d 100644 --- a/django_nose/tools.py +++ b/django_nose/tools.py @@ -14,6 +14,7 @@ def _get_nose_vars(): new_names[t] = getattr(tools, t) return new_names + for _name, _value in _get_nose_vars().items(): vars()[_name] = _value @@ -40,7 +41,7 @@ class Dummy(TransactionTestCase): """A dummy test case for gathering current assertion helpers.""" def nop(): - """A dummy test to get an initialized test case.""" + """Do nothing, dummy test to get an initialized test case.""" pass dummy_test = Dummy('nop') @@ -86,5 +87,5 @@ def assert_mail_count(count, msg=None): if msg is None: msg = ', '.join([e.subject for e in mail.outbox]) msg = '%d != %d %s' % (len(mail.outbox), count, msg) - # assert_equals is dynamicaly added above - assert_equals(len(mail.outbox), count, msg) # nopep8 + # assert_equals is dynamicaly added above. F821 is undefined name error + assert_equals(len(mail.outbox), count, msg) # noqa: F821 diff --git a/requirements.txt b/requirements.txt index fcd8ba0..46eeb6c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,44 +3,36 @@ # # Latest Django -Django==1.11 +Django>=1.11,<2.0 # This project -e . # Load database config from environment -dj-database-url==0.3.0 +dj-database-url==0.4.2 # Packaging -wheel==0.26.0 +wheel==0.29.0 # PEP8, PEP257, and static analysis -mccabe==0.3.1 -pep8==1.6.2 -pyflakes==1.0.0 -flake8==2.5.0 -pep257==0.7.0 -flake8-docstrings==0.2.1 +flake8==3.4.1 +flake8-docstrings==1.1.0 # Code coverage -coverage==4.0 +coverage==4.4.1 # Documentation -Pygments==2.0.2 -Sphinx==1.3.1 -docutils==0.12 +Sphinx==1.6.3 # Packaging Linters -check-manifest==0.25 -pyroma==1.8.2 +check-manifest==0.35 +pyroma==2.2 # Multi-env test runner -virtualenv==13.1.2 -py==1.4.30 -tox==2.1.1 +tox==2.7.0 # Better interactive debugging gnureadline==6.3.3 -ipython==4.0.0 -ipdb==0.8.1 -ipdbplugin==1.4.2 +ipython==5.4.1 +ipdb==0.10.3 +ipdbplugin==1.4.5 diff --git a/setup.py b/setup.py index e9ff421..0c48cb4 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ def get_long_description(title): """ % locals() return long_description + setup( name='django-nose', version='1.4.4', diff --git a/testapp/settings.py b/testapp/settings.py index 51a157f..a803307 100644 --- a/testapp/settings.py +++ b/testapp/settings.py @@ -20,6 +20,7 @@ def rel_path(*subpaths): """Construct the full path given a relative path.""" return path.join(BASE_DIR, *subpaths) + DATABASES = { 'default': dj_database_url.config( From 2e8c219e2af86254800929256d17cacb9c064e86 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:16:55 -0500 Subject: [PATCH 2/9] Better clean-pyc target --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e9fbf01..e1bf2d9 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,8 @@ clean-build: rm -fr *.egg-info clean-pyc: - find . -name '*.pyc' -exec rm -f {} + - find . -name '*.pyo' -exec rm -f {} + - find . -name '*~' -exec rm -f {} + - find . -name '__pycache__' -exec rm -fr {} + + find . \( -name \*.pyc -o -name \*.pyo -o -name __pycache__ \) -delete + find . -name '*~' -delete clean-test: rm -fr .tox/ From c513ccdd3d9b53f4f3736e8cfc3d54caa17f2c1f Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:17:09 -0500 Subject: [PATCH 3/9] Ignore pyenv file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5c9b3f8..7cb0d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ testapp.sqlite3 # Sphinx documentation build docs/_build/* + +# pyenv +.python-version From 3be6faba3abe96ff83f7cccf89b88d531bfde74e Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:17:53 -0500 Subject: [PATCH 4/9] Run coverage in make qa-all --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e1bf2d9..bd3f3dc 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ test: ./manage.py test test-all: - tox --skip-missing-interpreters + COVERAGE=1 tox --skip-missing-interpreters coverage-console: coverage erase From 4d20cf6bc2c1c6c7fe3a497f3591dc048c79cbae Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:18:08 -0500 Subject: [PATCH 5/9] Coverage is optional in tox "coverage combine" fails if env COVERAGE is unset, but should not make tox fail. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index cce9bc6..5962f61 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ skip_missing_interpreters = True passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH COVERAGE RUNTEST_ARGS DATABASE_URL commands = ./runtests.sh {env:RUNTEST_ARGS:} - coverage combine + - coverage combine deps = coveralls dj-database-url From 415bad3a5b382c6324dbb454f8a21d1fb28d6446 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:19:15 -0500 Subject: [PATCH 6/9] Fix Python support (3.x not 2.x) for master branch --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 5962f61..af4df74 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{27,34,35}-django-{18,19,110}{,-postgres,-mysql} py{27,34,35,36}-django-111{,-postgres,-mysql} - py{25,26}-django-master{,-postgres,-mysql} + py{35,36}-django-master{,-postgres,-mysql} flake8 docs skip_missing_interpreters = True From d08c4d7539e6eafbf16b0ee30d6ba39c21a8f0a5 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:19:55 -0500 Subject: [PATCH 7/9] Drop download statistics PyPI no longer populates these, so it will always show 0 downloads. --- README.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.rst b/README.rst index 1d84d37..f710c03 100644 --- a/README.rst +++ b/README.rst @@ -6,10 +6,6 @@ django-nose :alt: The PyPI package :target: https://pypi.python.org/pypi/django-nose -.. image:: https://img.shields.io/pypi/dw/django-nose.svg - :alt: PyPI download statistics - :target: https://pypi.python.org/pypi/django-nose - .. image:: https://img.shields.io/travis/django-nose/django-nose/master.svg :alt: TravisCI Build Status :target: https://travis-ci.org/django-nose/django-nose From 9cf47afda7e7b4035b46db700921447ad0d81f91 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:29:05 -0500 Subject: [PATCH 8/9] Update to twine for release uploads --- Makefile | 14 +++++++------- requirements.txt | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index bd3f3dc..90b2ad0 100644 --- a/Makefile +++ b/Makefile @@ -60,17 +60,17 @@ coverage: coverage-console coverage html open htmlcov/index.html -release: clean - python setup.py sdist bdist_wheel upload +release: sdist + twine upload dist/* python -m webbrowser -n https://pypi.python.org/pypi/django-nose -test-release: - python setup.py register -r https://testpypi.python.org/pypi - python setup.py sdist bdist_wheel upload -r https://testpypi.python.org/pypi +# Add [test] section to ~/.pypirc, https://test.pypi.org/legacy/ +test-release: sdist + twine upload --repository test dist/* python -m webbrowser -n https://testpypi.python.org/pypi/django-nose sdist: clean - python setup.py sdist + python setup.py sdist bdist_wheel ls -l dist check-manifest - pyroma dist/`ls -t dist | head -n1` + pyroma dist/`ls -t dist | grep tar.gz | head -n1` diff --git a/requirements.txt b/requirements.txt index 46eeb6c..16da17d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,6 +13,7 @@ dj-database-url==0.4.2 # Packaging wheel==0.29.0 +twine==1.9.1 # PEP8, PEP257, and static analysis flake8==3.4.1 From f746e5d2dd770028a40d70d092e302ca2b5aeb9a Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Aug 2017 10:29:57 -0500 Subject: [PATCH 9/9] Release 1.4.5 --- README.rst | 1 + changelog.rst | 4 ++++ django_nose/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f710c03..30605fe 100644 --- a/README.rst +++ b/README.rst @@ -45,6 +45,7 @@ recommended. It follows the `Django's support policy`_, supporting: * Django 1.8 (LTS) with Python 2.7, 3.4, or 3.5 * Django 1.9 with Python 2.7, 3.4, or 3.5 * Django 1.10 with Python 2.7, 3.4, or 3.5 + * Django 1.11 (LTS) with Python 2.7, 3.4, 3.5, or 3.6 .. _latest release: https://pypi.python.org/pypi/nose .. _Django's support policy: https://docs.djangoproject.com/en/1.8/internals/release-process/#supported-versions diff --git a/changelog.rst b/changelog.rst index b43168c..8e63182 100644 --- a/changelog.rst +++ b/changelog.rst @@ -1,6 +1,10 @@ Changelog --------- +1.4.5 (2017-08-22) +~~~~~~~~~~~~~~~~~~ +* Add Django 1.11 support + 1.4.4 (2016-06-27) ~~~~~~~~~~~~~~~~~~ * Add Django 1.10 support diff --git a/django_nose/__init__.py b/django_nose/__init__.py index 07d9bcb..beda667 100644 --- a/django_nose/__init__.py +++ b/django_nose/__init__.py @@ -8,5 +8,5 @@ assert NoseTestSuiteRunner assert FastFixtureTestCase -VERSION = (1, 4, 4) +VERSION = (1, 4, 5) __version__ = '.'.join(map(str, VERSION)) diff --git a/setup.py b/setup.py index 0c48cb4..d02e383 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ def get_long_description(title): setup( name='django-nose', - version='1.4.4', + version='1.4.5', description='Makes your Django tests simple and snappy', long_description=get_long_description('django-nose'), author='Jeff Balogh',