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

Drop python2 #1474

Merged
merged 4 commits into from Dec 14, 2017
Merged

Drop python2 #1474

merged 4 commits into from Dec 14, 2017

Conversation

patrys
Copy link
Member

@patrys patrys commented Dec 13, 2017

This removes Python 2-specific features:

  • encoding declaration (Python 3 defaults to UTF-8)
  • __future__ feature imports
  • u-prefixed unicode literals
  • six library
  • conditional imports in try/except
  • mock library as it's now part of the standard library

Fixes #1421

Pull Request Checklist

(Please keep this section. It will make maintainer's life easier.)

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. The changes are tested.
  6. The code is documented (docstrings, project documentation).
  7. Python code quality checks pass: pycodestyle, pydocstyle, pylint.
  8. JavaScript code quality checks pass: eslint.

@codecov-io
Copy link

codecov-io commented Dec 13, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@7ae13c2). Click here to learn what that means.
The diff coverage is 94.59%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1474   +/-   ##
=========================================
  Coverage          ?   82.44%           
=========================================
  Files             ?      131           
  Lines             ?     5668           
  Branches          ?      647           
=========================================
  Hits              ?     4673           
  Misses            ?      831           
  Partials          ?      164
Impacted Files Coverage Δ
saleor/core/__init__.py 100% <ø> (ø)
saleor/product/templatetags/price_ranges.py 100% <ø> (ø)
saleor/checkout/urls.py 100% <ø> (ø)
saleor/search/backends/elasticsearch.py 100% <ø> (ø)
saleor/dashboard/order/views.py 56.67% <ø> (ø)
saleor/core/views.py 89.47% <ø> (ø)
saleor/wsgi/__init__.py 0% <ø> (ø)
saleor/checkout/forms.py 95.45% <ø> (ø)
saleor/order/models.py 87.87% <ø> (ø)
saleor/dashboard/discount/forms.py 77.89% <ø> (ø)
... and 115 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ae13c2...a040c3a. Read the comment docs.

from django.conf import settings
import mock
Copy link
Member

Choose a reason for hiding this comment

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

Can we use Mock from unittest?
from unittest.mock import Mock

@@ -1,4 +1,3 @@
from __future__ import unicode_literals
try:
from itertools import zip_longest
Copy link
Member

Choose a reason for hiding this comment

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

Catching import error no longer needed

Copy link
Member

@krzysztofwolski krzysztofwolski left a comment

Choose a reason for hiding this comment

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

👍

@patrys
Copy link
Member Author

patrys commented Dec 14, 2017

Rebased on current master branch.

This removes Py2-specific features:

* encoding declaration (Python 3 defaults to UTF-8)
* future feature imports
* u-prefixed unicode literals
* six library
@maarcingebala maarcingebala merged commit fc99c2e into saleor:master Dec 14, 2017
@patrys patrys deleted the drop-python2 branch December 14, 2017 13:42
lampyjon added a commit to lampyjon/saleor that referenced this pull request Dec 28, 2017
saleor#1474 should have included a documentation updated.
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.

Drop Python 2 support
4 participants