Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #249 from cfpb/remove-py2
Browse files Browse the repository at this point in the history
Remove python 2 compatibility
  • Loading branch information
schbetsy authored Jan 13, 2020
2 parents 3aa27e4 + e96c8c9 commit 3e690a2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- 2.7
- 3.6
cache: pip
install:
Expand All @@ -10,7 +9,7 @@ before_script:
- npm config set package-lock false
script:
- tox
- python2.7 setup.py bdist_wheel --universal
- python setup.py bdist_wheel
after_success:
- coveralls
deploy:
Expand Down
4 changes: 1 addition & 3 deletions retirement_api/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from django.db import models
from django.template.defaultfilters import slugify

from six import text_type


WORKFLOW_STATE = [
('APPROVED', 'Approved'),
Expand Down Expand Up @@ -171,7 +169,7 @@ def dump_translation_text(self, output=False, outfile=None):
f.write(line.encode('utf-8'))
for phrase in phrases:
f.write('#: templates/claiming.html\n'.encode('utf-8'))
f.write(text_type('msgid "%s"\n' % phrase).encode('utf-8'))
f.write(str('msgid "%s"\n' % phrase).encode('utf-8'))
f.write('msgstr ""\n\n'.encode('utf-8'))
else:
return phrases
2 changes: 1 addition & 1 deletion retirement_api/tests/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import mock
import unittest

from six import StringIO
from io import StringIO

from django.core.management import call_command

Expand Down
6 changes: 2 additions & 4 deletions retirement_api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# import unittest
from django.http import HttpRequest

from six import binary_type

from retirement_api.views import (param_check,
income_check,
estimator,
Expand Down Expand Up @@ -87,7 +85,7 @@ def test_get_full_retirement_age(self):
def test_estimator_url_data(self):
request = self.req_blank
response = estimator(request, dob='1955-05-05', income='40000')
self.assertIsInstance(response.content, binary_type)
self.assertIsInstance(response.content, bytes)
rdata = json.loads(response.content)
for each in self.return_keys:
self.assertTrue(each in rdata.keys())
Expand All @@ -106,7 +104,7 @@ def test_estimator_query_data(self):
request = self.req_good
response = estimator(request)
self.assertTrue(response.status_code == 200)
self.assertIsInstance(response.content, binary_type)
self.assertIsInstance(response.content, bytes)
rdata = json.loads(response.content)
for each in self.return_keys:
self.assertTrue(each in rdata.keys())
Expand Down
2 changes: 1 addition & 1 deletion retirement_api/utils/ss_update_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import requests
# from django.template.defaultfilters import slugify
from bs4 import BeautifulSoup as bs
from six import StringIO
from io import StringIO

TODAY = datetime.datetime.now().date()
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
'dj-database-url>=0.4.2,<1',
'python-dateutil>=2.1<3',
'requests>=2.18,<3',
'six>=1.11.0,<2',
]


Expand Down Expand Up @@ -49,7 +48,6 @@ def read_file(filename):
'Topic :: Internet :: WWW/HTTP',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Framework :: Django',
'Development Status :: 4 - Beta',
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
skipsdist=True
envlist=py{27,36}-dj{111}
envlist=py{36}-dj{111}

[testenv]
install_command=pip install -e ".[testing]" -U {opts} {packages}
Expand All @@ -10,7 +10,6 @@ commands=
coverage report --skip-covered -m

basepython=
py27: python2.7
py36: python3.6

deps=
Expand Down

0 comments on commit 3e690a2

Please sign in to comment.