Skip to content

Commit

Permalink
Merge pull request #4792 from rtfd/humitos/pur/update
Browse files Browse the repository at this point in the history
All package updates
  • Loading branch information
ericholscher authored Nov 29, 2018
2 parents a5a761b + b774e08 commit b15e5d3
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 73 deletions.
24 changes: 12 additions & 12 deletions readthedocs/projects/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,24 +314,24 @@

LOG_TEMPLATE = '(Build) [{project}:{version}] {msg}'

PROJECT_PK_REGEX = '(?:[-\w]+)'
PROJECT_SLUG_REGEX = '(?:[-\w]+)'
PROJECT_PK_REGEX = r'(?:[-\w]+)'
PROJECT_SLUG_REGEX = r'(?:[-\w]+)'

GITHUB_REGEXS = [
re.compile('github.com/(.+)/(.+)(?:\.git){1}$'),
re.compile('github.com/(.+)/(.+)'),
re.compile('github.com:(.+)/(.+)\.git$'),
re.compile(r'github.com/(.+)/(.+)(?:\.git){1}$'),
re.compile(r'github.com/(.+)/(.+)'),
re.compile(r'github.com:(.+)/(.+)\.git$'),
]
BITBUCKET_REGEXS = [
re.compile('bitbucket.org/(.+)/(.+)\.git$'),
re.compile('@bitbucket.org/(.+)/(.+)\.git$'),
re.compile('bitbucket.org/(.+)/(.+)/?'),
re.compile('bitbucket.org:(.+)/(.+)\.git$'),
re.compile(r'bitbucket.org/(.+)/(.+)\.git$'),
re.compile(r'@bitbucket.org/(.+)/(.+)\.git$'),
re.compile(r'bitbucket.org/(.+)/(.+)/?'),
re.compile(r'bitbucket.org:(.+)/(.+)\.git$'),
]
GITLAB_REGEXS = [
re.compile('gitlab.com/(.+)/(.+)(?:\.git){1}$'),
re.compile('gitlab.com/(.+)/(.+)'),
re.compile('gitlab.com:(.+)/(.+)\.git$'),
re.compile(r'gitlab.com/(.+)/(.+)(?:\.git){1}$'),
re.compile(r'gitlab.com/(.+)/(.+)'),
re.compile(r'gitlab.com:(.+)/(.+)\.git$'),
]
GITHUB_URL = (
'https://github.com/{user}/{repo}/'
Expand Down
6 changes: 5 additions & 1 deletion readthedocs/restapi/views/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,8 @@ def post(self, request, project_slug, integration_pk):
)
view_cls = self.VIEW_MAP[integration.integration_type]
view = view_cls.as_view(integration=integration)
return view(request, project_slug)
# DRF uses ``rest_framework.request.Request`` and Django expects
# ``django.http.HttpRequest``
# https://www.django-rest-framework.org/api-guide/requests/
# https://github.com/encode/django-rest-framework/pull/5771#issuecomment-362815342
return view(request._request, project_slug)
9 changes: 6 additions & 3 deletions readthedocs/restapi/views/model_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class ProjectViewSet(UserSelectViewSet):
admin_serializer_class = ProjectAdminSerializer
model = Project
pagination_class = api_utils.ProjectPagination
filter_fields = ('slug',)
filter_fields = ('slug',) # django-filter<2.0.0
filterset_fields = ('slug',)

@decorators.detail_route()
def valid_versions(self, request, **kwargs):
Expand Down Expand Up @@ -234,7 +235,8 @@ class VersionViewSet(UserSelectViewSet):
serializer_class = VersionSerializer
admin_serializer_class = VersionAdminSerializer
model = Version
filter_fields = ('active', 'project__slug',)
filter_fields = ('active', 'project__slug',) # django-filter<2.0.0
filterset_fields = ('active', 'project__slug',)


class BuildViewSetBase(UserSelectViewSet):
Expand All @@ -243,7 +245,8 @@ class BuildViewSetBase(UserSelectViewSet):
serializer_class = BuildSerializer
admin_serializer_class = BuildAdminSerializer
model = Build
filter_fields = ('project__slug', 'commit')
filter_fields = ('project__slug', 'commit') # django-filter<2.0.0
filterset_fields = ('project__slug', 'commit')


class BuildViewSet(SettingsOverrideObject):
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/search/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def parse_path_from_file(file_path):
# "path/index.html" => "path/index"
# "/path/index" => "path/index"
path = re.sub('/$', '/index', path)
path = re.sub('\.html$', '', path)
path = re.sub(r'\.html$', '', path)
path = re.sub('^/', '', path)

return path
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ def USE_PROMOS(self): # noqa

# CORS
CORS_ORIGIN_REGEX_WHITELIST = (
'^http://(.+)\.readthedocs\.io$',
'^https://(.+)\.readthedocs\.io$'
r'^http://(.+)\.readthedocs\.io$',
r'^https://(.+)\.readthedocs\.io$',
)
# So people can post to their accounts
CORS_ALLOW_CREDENTIALS = True
Expand Down
5 changes: 2 additions & 3 deletions requirements/deploy.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
-r pip.txt
# http://initd.org/psycopg/docs/install.html#binary-install-from-pypi
psycopg2==2.7.5 --no-binary psycopg2
psycopg2==2.7.6.1 --no-binary psycopg2
gunicorn==19.9.0
pysolr==3.7.0
django-redis-cache==1.7.1
django-redis-cache==1.8.1

#For resizing images
pillow
6 changes: 2 additions & 4 deletions requirements/docs-lint.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# Sphinx 1.8 is incompatible with
# the latest version of rstcheck
Sphinx<1.8
rstcheck==3.3
Sphinx==1.8.2
rstcheck==3.3.1
9 changes: 3 additions & 6 deletions requirements/lint.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
-r pip.txt
# We need these special cases of Python < 3 for Read the Docs
# corporate site.
# We need these special cases of Python < 3 because we run tests with
# Python 2 still
astroid==2.0.4; python_version > '3'
astroid==1.6.4; python_version < '3'

pylint==2.1.1; python_version > '3'
pylint<2; python_version < '3'

pylint-django==2.0.2; python_version > '3'
pylint-django==0.11.1; python_version < '3'

pylint-celery==0.3
prospector==1.1.2
prospector==1.1.6.2
pyflakes==2.0.0
65 changes: 29 additions & 36 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,65 +1,59 @@
# Base packages
pip==18.0
pip==18.1
appdirs==1.4.3
virtualenv==16.0.0
virtualenv==16.1.0
docutils==0.14
Sphinx==1.7.8
sphinx_rtd_theme==0.4.1
sphinx-tabs==1.1.7
Sphinx==1.8.2
sphinx_rtd_theme==0.4.2
sphinx-tabs==1.1.10
# Required to avoid Transifex error with reserved slug
# https://github.com/sphinx-doc/sphinx-intl/pull/27
git+https://github.com/agjohnson/sphinx-intl.git@7b5c66bdb30f872b3b1286e371f569c8dcb66de5#egg=sphinx-intl

Pygments==2.2.0
Pygments==2.3.0

mkdocs==0.17.3
# mkdocs requires markdown
# Markdown 3.0 breaks with older Django Rest Framework
Markdown<3.0
mkdocs==1.0.4
Markdown==3.0.1

django==1.11.16
six==1.11.0
future==0.16.0

# django-tastypie 0.14.0 drops support for django 1.9
django-tastypie==0.13.3

future==0.17.1
django-tastypie==0.14.2
django-guardian==1.4.9
django-extensions==2.1.2
django-extensions==2.1.4

# djangorestframework 3.7.x drops support for django 1.9.x
djangorestframework==3.6.4
djangorestframework==3.9.0

# Filtering for the REST API
# django-filter>2.0 require Django 1.11
# https://django-filter.readthedocs.io/en/master/guide/migration.html#migrating-to-2-0
# Besides the guide, check this comment for the migration
# https://github.com/rtfd/readthedocs.org/pull/4318#discussion_r214163531
django-filter==1.1.0
# When Python2 gets deprecated we can upgrade django-filter
# > from .filterset import FilterSet
# E File "/home/travis/build/rtfd/readthedocs.org/.tox/py27/lib/python2.7/site-packages/django_filters/filterset.py", line 184
# E def __init__(self, data=None, queryset=None, *, request=None, prefix=None):
# E ^
# E SyntaxError: invalid syntax
django-filter<2.0.0

django-vanilla-views==1.0.5
jsonfield==2.0.2

requests==2.19.1
requests==2.20.1
requests-toolbelt==0.8.0
slumber==0.7.1
lxml==4.2.4
lxml==4.2.5
defusedxml==0.5.0

# Basic tools
redis==2.10.6
redis==3.0.1
# Celery 4.2 is incompatible with our code
# when ALWAYS_EAGER = True
celery==4.1.1

# 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
django-allauth==0.38.0

dnspython==1.15.0

# VCS
httplib2==0.11.3
httplib2==0.12.0

# GitPython 2.1.11 makes TestGitBackend.test_git_tags to fail because
# of an UnicodeError
Expand All @@ -77,12 +71,12 @@ pyquery==1.4.0

# Utils
django-gravatar2==1.4.2
pytz==2018.5
pytz==2018.7
beautifulsoup4==4.6.3
Unipath==1.1
django-kombu==0.9.4
mock==2.0.0
stripe==2.12.0
stripe==2.13.0

django-formtools==2.1

Expand All @@ -96,9 +90,8 @@ django-textclassifier==1.0
django-annoying==0.10.4
django-messages-extends==0.6.0
djangorestframework-jsonp==1.0.2
# django-taggit 0.23.0 drops support for django < 1.11
django-taggit==0.22.0
dj-pagination==2.3.2
django-taggit==0.23.0
dj-pagination==2.4.0

# Docs
sphinxcontrib-httpdomain==1.7.0
Expand All @@ -110,7 +103,7 @@ commonmark==0.5.5
recommonmark==0.4.0

# Version comparison stuff
packaging==17.1
packaging==18.0

# Commenting stuff
django-cors-middleware==1.3.1
Expand Down
10 changes: 5 additions & 5 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-r pip.txt

django-dynamic-fixture==2.0.0
pytest==3.7.4
pytest-django==3.4.2
pytest-xdist==1.23.0
pytest==4.0.1
pytest-django==3.4.4
pytest-xdist==1.24.1
pytest-cov
apipkg==1.5
execnet==1.5.0
Expand All @@ -16,9 +16,9 @@ execnet==1.5.0
# (Pinned to 4.4.2 since what we need for testing is still useful)
Mercurial==4.4.2

yamale==1.7.0
yamale==1.8.0
pytest-mock==1.10.0

# local debugging tools
datadiff
ipdb
ipdb

0 comments on commit b15e5d3

Please sign in to comment.