Skip to content

Commit

Permalink
fix: remove six dependency
Browse files Browse the repository at this point in the history
Fixes #164
  • Loading branch information
alvarolopez committed Jun 7, 2024
1 parent 01fbe9e commit 7441abb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions deepaas/api/v2/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# under the License.

import datetime
import io
import logging
import sys
import warnings
Expand All @@ -23,7 +24,6 @@
import aiohttp_apispec
from oslo_config import cfg
from oslo_log import log
import six

CONF = cfg.CONF

Expand Down Expand Up @@ -56,7 +56,7 @@ def setup_debug():
global DEBUG_STREAM

if CONF.debug_endpoint:
DEBUG_STREAM = six.StringIO()
DEBUG_STREAM = io.StringIO()

logger = log.getLogger("deepaas").logger
hdlr = logging.StreamHandler(DEBUG_STREAM)
Expand Down
5 changes: 1 addition & 4 deletions deepaas/model/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@

import abc

import six


@six.add_metaclass(abc.ABCMeta)
class BaseModel(object):
class BaseModel(object, meta=abc.ABCMeta):
"""Base class for all models to be used with DEEPaaS.
Note that it is not needed for DEEPaaS to inherit from this abstract base
Expand Down
8 changes: 4 additions & 4 deletions deepaas/tests/test_v2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.

import io
import uuid

from aiohttp import web
import six
from oslo_config import cfg
from oslo_log import log as logging

Expand Down Expand Up @@ -69,7 +69,7 @@ async def test_not_found(self):
self.assertEqual(404, ret.status)

async def test_predict_data(self):
f = six.BytesIO(b"foo")
f = io.BytesIO(b"foo")
ret = await self.client.post(
"/v2/models/deepaas-test/predict/",
data={"data": (f, "foo.txt"), "parameter": 1},
Expand Down Expand Up @@ -187,7 +187,7 @@ def assert_ok(self, response):
self.assertIn(response.status, [200, 201])

async def test_predict_data(self):
f = six.BytesIO(b"foo")
f = io.BytesIO(b"foo")
ret = await self.client.post(
"/custom/v2/models/deepaas-test/predict/",
data={"data": (f, "foo.txt"), "parameter": 1},
Expand Down Expand Up @@ -276,7 +276,7 @@ async def test_predict_no_parameters(self):
self.assertEqual(422, ret.status)

async def test_predict_data(self):
f = six.BytesIO(b"foo")
f = io.BytesIO(b"foo")
ret = await self.client.post(
"/v2/models/deepaas-test/predict/",
data={"data": (f, "foo.txt"), "parameter": 1},
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ deepaas = "deepaas.opts:list_opts"

[tool.poetry.dependencies]
python = "^3.10"
six = "^1.16.0"
"oslo.log" = "^6.0.0"
"oslo.config" = "^9.4.0"
stevedore = "^5.2.0"
Expand Down

0 comments on commit 7441abb

Please sign in to comment.