Skip to content

Commit 5e21d9d

Browse files
committed
Remove SAServer
1 parent 6650887 commit 5e21d9d

File tree

22 files changed

+38
-875
lines changed

22 files changed

+38
-875
lines changed

docs/source/cli_client.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@ To initialize CLI (and SDK) with team token:
3333
----------
3434

3535

36-
.. _ref_create_server:
37-
38-
Creating a server
39-
~~~~~~~~~~~~~~~~~~
40-
41-
This will create a directory by the given name in your current or provided directory:
42-
43-
.. code-block:: bash
44-
45-
superannotatecli create-server --name <directory_name> --path <directory_path>
46-
47-
----------
48-
49-
5036
.. _ref_create_project:
5137

5238
Creating a project

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
User guide <userguide/index>
1616
API Reference <api_reference/index>
1717
CLI Reference <cli_client>
18-
SA Server <sa_server>
1918
History <changelog_link>
2019
LICENSE.rst
2120

docs/source/sa_server.rst

Lines changed: 0 additions & 118 deletions
This file was deleted.

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
;addopts = -n auto --dist=loadscope
6+
addopts = -n auto --dist=loadscope
77

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ email-validator>=1.0.3
2020
jsonschema==3.2.0
2121
pandas>=1.1.4
2222
aiofiles==0.8.0
23-
Werkzeug==2.2.3
24-
Jinja2==3.1.2

src/superannotate/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
from superannotate.lib.app.input_converters import export_annotation # noqa
1919
from superannotate.lib.app.input_converters import import_annotation # noqa
2020
from superannotate.lib.app.interface.sdk_interface import SAClient # noqa
21-
from superannotate.lib.app.server import SAServer # noqa
22-
from superannotate.lib.app.server.utils import setup_app # noqa
2321
from superannotate.lib.core import PACKAGE_VERSION_INFO_MESSAGE # noqa
2422
from superannotate.lib.core import PACKAGE_VERSION_MAJOR_UPGRADE # noqa
2523
from superannotate.lib.core import PACKAGE_VERSION_UPGRADE # noqa
@@ -28,17 +26,9 @@
2826
SESSIONS = {}
2927

3028

31-
def create_app(apps: typing.List[str] = None) -> SAServer:
32-
setup_app(apps)
33-
server = SAServer()
34-
return server
35-
36-
3729
__all__ = [
3830
"__version__",
3931
"SAClient",
40-
"SAServer",
41-
"create_app",
4232
# Utils
4333
"enums",
4434
"AppException",

src/superannotate/lib/app/interface/cli_interface.py

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import os
2-
import shutil
32
import sys
43
import tempfile
54
from pathlib import Path
65
from typing import Any
76
from typing import Optional
87

9-
import lib as sa_lib
108
import lib.core as constances
119
from lib.app.input_converters.conversion import import_annotation
1210
from lib.app.interface.sdk_interface import SAClient
@@ -31,9 +29,9 @@ def version():
3129

3230
@staticmethod
3331
def init(
34-
token: str,
35-
logging_level: str = "INFO",
36-
logging_path: str = constances.LOG_FILE_LOCATION,
32+
token: str,
33+
logging_level: str = "INFO",
34+
logging_path: str = constances.LOG_FILE_LOCATION,
3735
):
3836
"""
3937
To initialize CLI (and SDK) with team token
@@ -55,7 +53,7 @@ def init(
5553
if Path(constances.CONFIG_INI_FILE_LOCATION).exists():
5654
operation = "updated"
5755
if not input(
58-
f"File {constances.CONFIG_INI_FILE_LOCATION} exists. Do you want to overwrite? [y/n] : "
56+
f"File {constances.CONFIG_INI_FILE_LOCATION} exists. Do you want to overwrite? [y/n] : "
5957
).lower() in ("y", "yes"):
6058
return
6159
else:
@@ -86,14 +84,14 @@ def create_folder(self, project: str, name: str):
8684
sys.exit(0)
8785

8886
def upload_images(
89-
self,
90-
project: str,
91-
folder: str,
92-
extensions: str = constances.DEFAULT_IMAGE_EXTENSIONS,
93-
set_annotation_status: str = constances.AnnotationStatus.NOT_STARTED.name,
94-
exclude_file_patterns=constances.DEFAULT_FILE_EXCLUDE_PATTERNS,
95-
recursive_subfolders=False,
96-
image_quality_in_editor=None,
87+
self,
88+
project: str,
89+
folder: str,
90+
extensions: str = constances.DEFAULT_IMAGE_EXTENSIONS,
91+
set_annotation_status: str = constances.AnnotationStatus.NOT_STARTED.name,
92+
exclude_file_patterns=constances.DEFAULT_FILE_EXCLUDE_PATTERNS,
93+
recursive_subfolders=False,
94+
image_quality_in_editor=None,
9795
):
9896
"""
9997
To upload images from folder to project use:
@@ -117,12 +115,12 @@ def upload_images(
117115
sys.exit(0)
118116

119117
def export_project(
120-
self,
121-
project,
122-
folder,
123-
include_fuse=False,
124-
disable_extract_zip_contents=False,
125-
annotation_statuses=None,
118+
self,
119+
project,
120+
folder,
121+
include_fuse=False,
122+
disable_extract_zip_contents=False,
123+
annotation_statuses=None,
126124
):
127125
project_name, folder_name = split_project_path(project)
128126
folders = None
@@ -148,7 +146,7 @@ def export_project(
148146
sys.exit(0)
149147

150148
def upload_annotations(
151-
self, project, folder, dataset_name=None, task=None, format=None
149+
self, project, folder, dataset_name=None, task=None, format=None
152150
):
153151
"""
154152
To upload annotations from folder to project use
@@ -198,10 +196,10 @@ def _upload_annotations(self, project, folder, format, dataset_name, task):
198196
sys.exit(0)
199197

200198
def attach_image_urls(
201-
self,
202-
project: str,
203-
attachments: str,
204-
annotation_status: Optional[Any] = "NotStarted",
199+
self,
200+
project: str,
201+
attachments: str,
202+
annotation_status: Optional[Any] = "NotStarted",
205203
):
206204
"""
207205
To attach image URLs to project use:
@@ -215,10 +213,10 @@ def attach_image_urls(
215213
sys.exit(0)
216214

217215
def attach_video_urls(
218-
self,
219-
project: str,
220-
attachments: str,
221-
annotation_status: Optional[Any] = "NotStarted",
216+
self,
217+
project: str,
218+
attachments: str,
219+
annotation_status: Optional[Any] = "NotStarted",
222220
):
223221
SAClient().attach_items(
224222
project=project,
@@ -229,7 +227,7 @@ def attach_video_urls(
229227

230228
@staticmethod
231229
def attach_document_urls(
232-
project: str, attachments: str, annotation_status: Optional[Any] = "NotStarted"
230+
project: str, attachments: str, annotation_status: Optional[Any] = "NotStarted"
233231
):
234232
SAClient().attach_items(
235233
project=project,
@@ -239,15 +237,15 @@ def attach_document_urls(
239237
sys.exit(0)
240238

241239
def upload_videos(
242-
self,
243-
project,
244-
folder,
245-
target_fps=None,
246-
recursive=False,
247-
extensions=constances.DEFAULT_VIDEO_EXTENSIONS,
248-
set_annotation_status=constances.AnnotationStatus.NOT_STARTED.name,
249-
start_time=0.0,
250-
end_time=None,
240+
self,
241+
project,
242+
folder,
243+
target_fps=None,
244+
recursive=False,
245+
extensions=constances.DEFAULT_VIDEO_EXTENSIONS,
246+
set_annotation_status=constances.AnnotationStatus.NOT_STARTED.name,
247+
start_time=0.0,
248+
end_time=None,
251249
):
252250
"""
253251
To upload videos from folder to project use
@@ -273,20 +271,3 @@ def upload_videos(
273271
image_quality_in_editor=None,
274272
)
275273
sys.exit(0)
276-
277-
def create_server(self, name: str, path: str = None):
278-
"""
279-
This will create a directory by the given name in your current or provided directory.
280-
"""
281-
path = Path(os.path.expanduser(path if path else ".")) / name
282-
if path.exists():
283-
raise Exception(f"Directory already exists {str(path.absolute())}")
284-
path.mkdir(parents=True)
285-
default_files_path = Path(sa_lib.__file__).parent / "app" / "server"
286-
shutil.copy(default_files_path / "__app.py", path / "app.py")
287-
shutil.copy(default_files_path / "__wsgi.py", path / "wsgi.py")
288-
shutil.copy(default_files_path / "Dockerfile", path / "Dockerfile")
289-
shutil.copy(default_files_path / "requirements.txt", path / "requirements.txt")
290-
shutil.copy(default_files_path / "README.rst", path / "README.rst")
291-
shutil.copy(default_files_path / "run.sh", path / "run.sh")
292-
shutil.copytree(default_files_path / "deployment", path / "deployment")

src/superannotate/lib/app/server/Dockerfile

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)