Skip to content

Commit

Permalink
release/0.7.0: Add unicode_literals from __future__
Browse files Browse the repository at this point in the history
  • Loading branch information
nok committed Dec 9, 2018
1 parent 1daa4b3 commit 3fcfe72
Show file tree
Hide file tree
Showing 27 changed files with 83 additions and 5 deletions.
1 change: 1 addition & 0 deletions sklearn_porter/Porter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import sys
Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/Template.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os.path


Expand Down
5 changes: 3 additions & 2 deletions sklearn_porter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import os.path

Expand All @@ -11,8 +14,6 @@ def _read_version():
source_dir = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(source_dir, '__version__.txt')
version = open(version_file, 'r').readlines().pop()
if isinstance(version, bytes):
version = version.decode('utf-8')
version = str(version).strip()
return version

Expand Down
3 changes: 2 additions & 1 deletion sklearn_porter/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import sys
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder

import sklearn

from sklearn_porter.estimator.classifier.Classifier import Classifier


Expand Down
4 changes: 4 additions & 0 deletions sklearn_porter/estimator/classifier/BernoulliNB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder

import numpy as np

from sklearn_porter.estimator.classifier.Classifier import Classifier


Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/estimator/classifier/Classifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

from sklearn_porter.Template import Template


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder

from sklearn_porter.estimator.classifier.Classifier import Classifier


Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/estimator/classifier/GaussianNB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder

from sklearn_porter.estimator.classifier.Classifier import Classifier


Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/estimator/classifier/LinearSVC/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder
Expand Down
4 changes: 4 additions & 0 deletions sklearn_porter/estimator/classifier/MLPClassifier/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder

from sklearn_porter.estimator.classifier.Classifier import Classifier


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder

from sklearn.tree.tree import DecisionTreeClassifier

from sklearn_porter.estimator.classifier.Classifier import Classifier


Expand Down
4 changes: 3 additions & 1 deletion sklearn_porter/estimator/classifier/SVC/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os
import json
from json import encoder
import types

from sklearn_porter.estimator.classifier.Classifier import Classifier

Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/estimator/regressor/MLPRegressor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import print_function
from __future__ import absolute_import

from sklearn_porter.estimator.regressor.Regressor import Regressor


Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/estimator/regressor/Regressor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

from sklearn_porter.Template import Template


Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/utils/Environment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import print_function
from __future__ import absolute_import

import os
import sys

Expand Down
3 changes: 3 additions & 0 deletions sklearn_porter/utils/Shell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import print_function
from __future__ import absolute_import

import six

from subprocess import call
Expand Down
1 change: 0 additions & 1 deletion tests/PorterTest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

import random
import unittest
import filecmp
import os
Expand Down
3 changes: 3 additions & 0 deletions tests/language/C.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os

from sklearn_porter import Porter
Expand Down
3 changes: 3 additions & 0 deletions tests/language/Go.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os

from sklearn_porter import Porter
Expand Down
3 changes: 3 additions & 0 deletions tests/language/Java.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os

from sklearn_porter import Porter
Expand Down
3 changes: 3 additions & 0 deletions tests/language/JavaScript.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os

from sklearn_porter import Porter
Expand Down
3 changes: 3 additions & 0 deletions tests/language/PHP.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os

from sklearn_porter import Porter
Expand Down
3 changes: 3 additions & 0 deletions tests/language/Ruby.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

import os

from sklearn_porter import Porter
Expand Down
3 changes: 3 additions & 0 deletions tests/utils/EnvironmentTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

from unittest import TestCase

from sklearn_porter.utils.Environment import Environment
Expand Down
3 changes: 3 additions & 0 deletions tests/utils/ShellTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from __future__ import absolute_import

from unittest import TestCase

from sklearn_porter.utils.Shell import Shell
Expand Down

0 comments on commit 3fcfe72

Please sign in to comment.