Skip to content

Commit b8e6753

Browse files
committed
feat!: remove deprecated deepaas-predict
Fixes #154
1 parent b7af423 commit b8e6753

File tree

7 files changed

+2
-321
lines changed

7 files changed

+2
-321
lines changed

deepaas/cmd/execute.py

-164
This file was deleted.

deepaas/tests/test_cmd.py

-54
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17-
import os
18-
import shutil
1917
import sys
20-
import urllib.request
2118

2219
import mock
2320

24-
from deepaas.cmd import execute
2521
from deepaas.cmd import run
2622
from deepaas.tests import base
2723

@@ -62,53 +58,3 @@ def test_run_custom_ip_port(self, m_get_app, m_run_app, m_handle_signals):
6258
port=port,
6359
)
6460
m_handle_signals.assert_called_once()
65-
66-
67-
class TestExecute(base.TestCase):
68-
@mock.patch("deepaas.cmd.execute.prediction")
69-
def test_execute_data(self, m_out_pred):
70-
in_file = "file"
71-
out_file = "deepaas/tests/out_test/"
72-
self.flags(input_file=in_file)
73-
self.flags(output=out_file)
74-
m_out_pred.return_value = [{"value1": {"pred": 1}, "value2": {"pred": 0.9}}]
75-
with mock.patch.object(sys, "argv", ["deepaas-predict"]):
76-
execute.main()
77-
78-
@mock.patch("deepaas.cmd.execute.prediction")
79-
def test_execute_url(self, m_out_pred):
80-
in_file = "https://xxxxxxxxxx"
81-
out_file = "deepaas/tests/out_test/"
82-
self.flags(input_file=in_file)
83-
self.flags(output=out_file)
84-
self.flags(url=True)
85-
m_out_pred.return_value = [{"value1": {"pred": 1}, "value2": {"pred": 0.9}}]
86-
with mock.patch.object(sys, "argv", ["deepaas-predict"]):
87-
execute.main()
88-
89-
@mock.patch("deepaas.cmd.execute.prediction")
90-
def test_execute_ct(self, m_out_pred):
91-
in_file = "file"
92-
out_file = "deepaas/tests/out_test/"
93-
cont_type = "application/zip"
94-
self.flags(input_file=in_file)
95-
self.flags(output=out_file)
96-
self.flags(content_type=cont_type)
97-
output_dir = "deepaas/tests/tmp_dir"
98-
if os.path.exists(output_dir):
99-
shutil.rmtree(output_dir)
100-
os.mkdir(output_dir)
101-
out_json = [{"value1": {"pred": 1}, "value2": {"pred": 0.9}}]
102-
f_json = open(output_dir + "output" + ".json", "w+")
103-
f_json.write(repr(out_json) + "\n")
104-
f_json.close
105-
url = "https://storage.googleapis.com/" "tfjs-models/assets/posenet/frisbee.jpg"
106-
urllib.request.urlretrieve(url, "example_image.jpg")
107-
shutil.move(f_json.name, output_dir)
108-
shutil.move("example_image.jpg", output_dir)
109-
f = shutil.make_archive(base_name=output_dir, format="zip", root_dir=output_dir)
110-
m_out_pred.return_value = open(f, "rb")
111-
with mock.patch.object(sys, "argv", ["deepaas-predict"]):
112-
execute.main()
113-
shutil.rmtree(output_dir)
114-
os.remove(output_dir + ".zip")

doc/source/cli/deepaas-predict.rst

-63
This file was deleted.

doc/source/cli/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ Available commands
66
:maxdepth: 1
77

88
deepaas-cli
9-
deepaas-predict
109
deepaas-run

doc/source/user/predict.rst

-36
This file was deleted.

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ classifiers = [
4040

4141
[tool.poetry.scripts]
4242
deepaas-run = "deepaas.cmd.run:main"
43-
deepaas-predict = "deepaas.cmd.execute:main"
4443
deepaas-cli = "deepaas.cmd.cli:main"
4544

4645
[tool.poetry.plugins] # Optional super table
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
deprecations:
2+
upgrade:
33
- |
4-
The command ``deepaas-predict`` is now deprecated, please use ``deepaas-cli`` instead.
4+
The command ``deepaas-predict`` has been removed, please use ``deepaas-cli`` instead.

0 commit comments

Comments
 (0)