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

All package updates #4792

Merged
merged 10 commits into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -343,4 +343,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the above comments

filter_fields = ('slug',)  # django-filter<2.0.0
filterset_fields = ('slug',)

are because of this? I think is better to just create an issue, rather than hiding it on the code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't upgrade to 2.0.0 yet because we are still running tests with Py2. Once we remove that, we can upgrade without touching the code.

The comments added into the code already prepared it for 2.0.0.

Copy link
Member Author

@humitos humitos Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to prepare the code to work with both versions now and when we upgrade, we can remove the lines that are not needed.


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
stsewd marked this conversation as resolved.
Show resolved Hide resolved

# 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