From 50e7d4be3bb8500dadffe9cff982394847157c6b Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 14 Mar 2018 23:16:35 -0500 Subject: [PATCH] Upgrade all packages using `pur` tool (#2916) * Upgrade all packages using `pur` tool These ones were not upgraded since they are incompatible: * docker-py * celery * elasticsearch * pyelasticsearch * Upgrade all packages with `pur` pur --skip django,docker-py,elasticsearch,pyelasticsearch and some packages pinned manually to avoid conflicts with our tests. * Downgrade commonmark to 0.5.5 In 6.x changelog > DocParser has been renamed to Parser. https://github.com/rtfd/CommonMark-py/releases/tag/0.6.0 and that it's not compatible with the latest version of recommonmark (0.4.0) * `assert_not_called` replaced by `call_count` It doesn't receive arguments and can't be used at that point because it was called previously by the other POST on the API: https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.assert_not_called * Upgrade packages with `pur` $ pur --skip django-tastypie,django,docker-py,elasticsearch,pyelasticsearch,commonmark,stripe,djangorestframework * Upgrade more packages * Pin django-allauth to 0.32.0 django-allauth 0.33.0 doesn't support Django 1.9.x which is the version we are using at the moment. * Pin mkdocs to 0.15.0 for compatibility reasons This version is the one installed by default on the venv to build the user's documentation. * Fix typo in method name * Proper call to the superproject symlink on Project.save `Project.superprojects.all()` returns `ProjectRelationship` instances where we need to use the `parent` or `child` attribute to access to the project itself. (we were sending the `ProjectRelationship.pk`) --- readthedocs/projects/models.py | 4 +- readthedocs/rtd_tests/tests/test_api.py | 4 +- .../rtd_tests/tests/test_project_symlinks.py | 6 +- requirements/pip.txt | 71 ++++++++++++------- 4 files changed, 53 insertions(+), 32 deletions(-) diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index c4249351e84..9d30b37788a 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -339,11 +339,11 @@ def save(self, *args, **kwargs): # pylint: disable=arguments-differ 'Re-symlinking superprojects: project=%s', self.slug, ) - for superproject in self.superprojects.all(): + for relationship in self.superprojects.all(): broadcast( type='app', task=tasks.symlink_project, - args=[superproject.pk], + args=[relationship.parent.pk], ) except Exception: diff --git a/readthedocs/rtd_tests/tests/test_api.py b/readthedocs/rtd_tests/tests/test_api.py index d2f9c6e4b53..87e328e5037 100644 --- a/readthedocs/rtd_tests/tests/test_api.py +++ b/readthedocs/rtd_tests/tests/test_api.py @@ -466,6 +466,7 @@ def test_bitbucket_webhook(self, trigger_build): trigger_build.assert_has_calls( [mock.call(force=True, version=mock.ANY, project=self.project)]) + trigger_build_call_count = trigger_build.call_count client.post( '/api/v2/webhook/bitbucket/{0}/'.format(self.project.slug), { @@ -479,8 +480,7 @@ def test_bitbucket_webhook(self, trigger_build): }, format='json', ) - trigger_build.assert_not_called( - [mock.call(force=True, version=mock.ANY, project=self.project)]) + self.assertEqual(trigger_build_call_count, trigger_build.call_count) def test_bitbucket_invalid_webhook(self, trigger_build): """Bitbucket webhook unhandled event.""" diff --git a/readthedocs/rtd_tests/tests/test_project_symlinks.py b/readthedocs/rtd_tests/tests/test_project_symlinks.py index 149e10c1242..1e029c25c48 100644 --- a/readthedocs/rtd_tests/tests/test_project_symlinks.py +++ b/readthedocs/rtd_tests/tests/test_project_symlinks.py @@ -926,7 +926,7 @@ def test_symlink_broadcast_calls_on_project_save(self): project.description = 'New description' project.save() # called once for this project itself - broadcast.assert_any_calls( + broadcast.assert_any_call( type='app', task=symlink_project, args=[project.pk], @@ -944,13 +944,13 @@ def test_symlink_broadcast_calls_on_project_save(self): subproject.description = 'New subproject description' subproject.save() # subproject symlinks - broadcast.assert_any_calls( + broadcast.assert_any_call( type='app', task=symlink_project, args=[subproject.pk], ) # superproject symlinks - broadcast.assert_any_calls( + broadcast.assert_any_call( type='app', task=symlink_project, args=[project.pk], diff --git a/requirements/pip.txt b/requirements/pip.txt index e58feeb4aec..0fb48317964 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,67 +1,88 @@ # Base packages pip==9.0.1 appdirs==1.4.3 -virtualenv==15.0.1 -docutils==0.11 -Sphinx==1.5.3 +virtualenv==15.1.0 +docutils==0.14 +Sphinx==1.7.0 sphinx_rtd_theme==0.2.5b1 Pygments==2.2.0 -mkdocs==0.14.0 -django==1.9.12 -six==1.10.0 + +# latest compatible version with our code +# https://github.com/rtfd/readthedocs.org/pull/2916#discussion_r172991757 +mkdocs==0.15.0 + +django==1.9.13 +six==1.11.0 future==0.16.0 readthedocs-build<2.1 +# django-tastypie 0.13.x and 0.14.0 are not compatible with our code django-tastypie==0.13.0 -django-haystack==2.6.0 + +django-haystack==2.7.0 celery-haystack==0.10 -django-guardian==1.4.6 -django-extensions==1.7.4 -djangorestframework==3.5.4 +django-guardian==1.4.9 +django-extensions==2.0.0 + +# djangorestframework 3.7.x drops support for django 1.9.x +djangorestframework==3.6.4 + django-vanilla-views==1.0.4 -jsonfield==1.0.3 +jsonfield==2.0.2 -requests==2.9.1 +requests==2.18.4 slumber==0.7.1 -lxml==3.3.5 +lxml==4.1.1 defusedxml==0.5.0 # Basic tools redis==2.10.6 celery==4.1.0 + +# django-allauth 0.33.0 dropped support for Django 1.9 +# https://django-allauth.readthedocs.io/en/latest/release-notes.html#backwards-incompatible-changes django-allauth==0.32.0 + dnspython==1.15.0 # VCS -httplib2==0.7.7 +httplib2==0.10.3 # Search elasticsearch==1.5.0 pyelasticsearch==0.7.1 -pyquery==1.2.2 +pyquery==1.4.0 # Utils -django-gravatar2==1.4.0 -pytz==2013b -beautifulsoup4==4.1.3 +django-gravatar2==1.4.2 +pytz==2018.3 +beautifulsoup4==4.6.0 Unipath==1.1 django-kombu==0.9.4 mimeparse==0.1.3 -mock==1.0.1 +mock==2.0.0 + +# stripe 1.20.2 is the latest compatible with our code base (otherwise +# gold/tests/test_forms.py fails) stripe==1.20.2 -django-formtools==1.0 -django-dynamic-fixture==1.8.5 + +django-formtools==2.1 +django-dynamic-fixture==2.0.0 docker-py==1.3.1 django-textclassifier==1.0 -django-annoying==0.10.1 -django-messages-extends==0.5 +django-annoying==0.10.4 +django-messages-extends==0.6.0 djangorestframework-jsonp==1.0.2 django-taggit==0.22.2 dj-pagination==2.3.2 # Docs -sphinxcontrib-httpdomain==1.4.0 +sphinxcontrib-httpdomain==1.6.0 + +# commonmark 0.5.5 is the latest version compatible with our docs, the +# newer ones make `tox -e docs` to fail commonmark==0.5.5 + recommonmark==0.4.0 # Version comparison stuff @@ -69,4 +90,4 @@ packaging==16.8 # Commenting stuff django-cors-middleware==1.3.1 -nilsimsa==0.3.7 +nilsimsa==0.3.8