Skip to content

Conversation

@twidi
Copy link
Contributor

@twidi twidi commented Jun 11, 2018

I first checked the dependencies that could be upgraded

$ pip list --outdated
Package             Version  Latest   Type
------------------- -------- -------- -----
amqp                1.4.9    2.3.2    wheel
beautifulsoup4      4.4.1    4.6.0    wheel
billiard            3.3.0.23 3.5.0.3  wheel
boto3               1.3.1    1.7.35   wheel
botocore            1.4.93   1.10.35  wheel
celery              3.1.23   4.2.0    wheel
Django              1.10     2.0.6    wheel
django-celery       3.1.17   3.2.2    sdist
django-filter       0.14.0   1.1.0    wheel
django-rest-swagger 2.0.5    2.2.0    wheel
djangorestframework 3.4.5    3.8.2    wheel
factory-boy         2.7.0    2.11.1   wheel
fake-factory        0.7.4    9999.9.9 wheel
idna                2.6      2.7      wheel
kombu               3.0.37   4.2.1    wheel
Markdown            2.6.6    2.6.11   wheel
Pillow              3.3.1    5.1.0    wheel
pycaption           1.0.0    1.0.1    sdist
urllib3             1.22     1.23     wheel

Them filtered this list (manually) to only include the ones in our requirement files.:

Package             Version  Latest   Type
------------------- -------- -------- -----
celery              3.1.23   4.2.0    wheel
Django              1.10     2.0.6    wheel
django-celery       3.1.17   3.2.2    sdist
django-filter       0.14.0   1.1.0    wheel
django-rest-swagger 2.0.5    2.2.0    wheel
djangorestframework 3.4.5    3.8.2    wheel
pycaption           1.0.0    1.0.1    sdist
Markdown            2.6.6    2.6.11   wheel
Pillow              3.3.1    5.1.0    wheel
boto3               1.3.1    1.7.35   wheel
factory-boy         2.7.0    2.11.1   wheel

At the end we have this:

$ pip list --outdated
Package        Version  Latest  Type 
-------------- -------- ------- -----
amqp           1.4.9    2.3.2   wheel
beautifulsoup4 4.4.1    4.6.0   wheel
billiard       3.3.0.23 3.5.0.3 wheel
celery         3.1.25   4.2.0   wheel
idna           2.6      2.7     wheel
kombu          3.0.37   4.2.1   wheel
urllib3        1.22     1.23    wheel

And limited to our requirements:

$ pip list --outdated
Package        Version  Latest  Type 
-------------- -------- ------- -----
celery         3.1.25   4.2.0   wheel

The only reason for not upgrading to celery 4 is that there are some important changes and I don't know this library enough (in fact I don't know it at all) to carry this change on my own.

So everything else is ok, but celery (still upgraded to the last version before 4).

One thing: on an existing environment, I had to uninstall fake-factory AND factory-boy before reinstalling factory-boy to the last version.

twidi added 23 commits June 14, 2018 15:49
In addition to being up-to-date, this removes the need to have and pin
`fake-factory` becauses uses the replacement `faker`.
`3.6.4` is the last version working without changes. 3.7 needs change
about using django-filter instead of previously integrated feature in
drf.
Before upgrading 4+, it was recommended to upgrade to 3.1.25.
`rest_framework.filters` is removed in `3.7` and replaced by
`django_filters.rest_framework`.
In DFR 3.8, it's not possible anymore to have read-only fields in
serializers having a default value set on creation. For this, there is
`CreateOnlyDefault`, so we use this for
`VideoUploadUrlSerializer.expires_at`
They will be required in Django 2. The actual default is `CASCADE`
so we set the arg to this value, it implies no changes.
To solve this that will break when migrating to Django 2

https://docs.djangoproject.com/en/dev/releases/1.9/#passing-a-3-tuple-or-an-app-name-to-include

```bash
$ python -Wd manage.py check

api/urls.py:4: RemovedInDjango20Warning: Specifying a namespace in
django.conf.urls.include() without providing an app_name is deprecated.
Set the app_name attribute in the included module, or pass a 2-tuple
containing the list of patterns and app_name instead.
url(r'^v1/', include('api.v1.urls', namespace="v1")),

videofront/urls.py:8: RemovedInDjango20Warning: Specifying a namespace
in django.conf.urls.include() without providing an app_name is
deprecated. Set the app_name attribute in the included module, or pass a
2-tuple containing the list of patterns and app_name instead.
url(r'^api/', include('api.urls', namespace="api")),
```
http://django-filter.readthedocs.io/en/latest/guide/migration.html#filter-name-renamed-to-filter-field-name

```
$ python -Wd manage.py check
api/v1/views.py:181: DeprecationWarning: `Filter.name` has been renamed
to `Filter.field_name`. See:
https://django-filter.readthedocs.io/en/develop/migration.html
playlist_id = django_filters.CharFilter(name="playlists",
lookup_expr="public_id")
```
http://www.django-rest-framework.org/topics/3.8-announcement/#action-decorator-replaces-list_route-and-detail_route

```
$ python -Wd manage.py check
api/v1/views.py:68: PendingDeprecationWarning: `detail_route` is pending
deprecation and will be removed in 3.10 in favor of `action`, which
accepts a `detail` bool. Use `@action(detail=True)` instead.
@detail_route(methods=['POST'])
api/v1/views.py:82: PendingDeprecationWarning: `detail_route` is pending
deprecation and will be removed in 3.10 in favor of `action`, which
accepts a `detail` bool. Use `@action(detail=True)` instead.
@detail_route(methods=['POST'])
api/v1/views.py:266: PendingDeprecationWarning: `detail_route` is
pending deprecation and will be removed in 3.10 in favor of `action`,
which accepts a `detail` bool. Use `@action(detail=True)` instead.
@detail_route(methods=['POST'])
api/v1/views.py:302: PendingDeprecationWarning: `detail_route` is
pending deprecation and will be removed in 3.10 in favor of `action`,
which accepts a `detail` bool. Use `@action(detail=True)` instead.
@detail_route(methods=['POST'])
api/v1/views.py:351: PendingDeprecationWarning: `detail_route` is
pending deprecation and will be removed in 3.10 in favor of `action`,
which accepts a `detail` bool. Use `@action(detail=True)` instead.
@detail_route(methods=['POST', 'OPTIONS'])
```
"session authentication" is enabled by default in django 1.10 so
`SessionAuthenticationMiddleware` was not needed anymore. And removed in
django 2.
We use `assert_called_once` which is only present in python 3.6
@twidi twidi force-pushed the upgrade-requirements branch from 566001a to 8907c6a Compare June 14, 2018 13:50
@twidi twidi force-pushed the upgrade-requirements branch from 8907c6a to fe0be1e Compare June 14, 2018 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants