Skip to content

Commit e104fa3

Browse files
authored
Merge pull request #477 from superannotateai/friday
Friday
2 parents 8867d65 + f607bcf commit e104fa3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1470
-589
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
name: Style Guide Enforcement (flake8)
2222
args:
2323
- '--max-line-length=120'
24-
- --ignore=D100,D203,D405,W503,E203,E501,F841,E126,E712,E123,E131,F821,E121
24+
- --ignore=D100,D203,D405,W503,E203,E501,F841,E126,E712,E123,E131,F821,E121,W605
2525
- repo: 'https://github.com/asottile/pyupgrade'
2626
rev: v2.4.3
2727
hooks:

docs/source/superannotate.sdk.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ ______
7979

8080
----------
8181

82+
Custom Metadata
83+
______
84+
85+
.. automethod:: superannotate.SAClient.create_custom_fields
86+
.. automethod:: superannotate.SAClient.get_custom_fields
87+
.. automethod:: superannotate.SAClient.delete_custom_fields
88+
.. automethod:: superannotate.SAClient.upload_custom_values
89+
.. automethod:: superannotate.SAClient.delete_custom_values
90+
91+
----------
92+
8293
Subsets
8394
______
8495

@@ -96,8 +107,6 @@ ______
96107
.. automethod:: superannotate.SAClient.upload_image_annotations
97108
.. automethod:: superannotate.SAClient.copy_image
98109
.. automethod:: superannotate.SAClient.pin_image
99-
.. automethod:: superannotate.SAClient.assign_images
100-
.. automethod:: superannotate.SAClient.delete_images
101110
.. automethod:: superannotate.SAClient.add_annotation_bbox_to_image
102111
.. automethod:: superannotate.SAClient.add_annotation_point_to_image
103112
.. automethod:: superannotate.SAClient.add_annotation_comment_to_image

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
5-
;addopts = -n auto --dist=loadscope
5+
addopts = -n auto --dist=loadscope

setup.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
from packaging.version import parse
1+
import os
2+
import re
3+
24
from setuptools import find_packages, setup
35

46

5-
with open('src/superannotate/version.py') as f:
6-
version = f.read().rstrip()[15:-1]
7+
def get_version():
8+
init = open(os.path.join(os.path.dirname(__file__), 'src', 'superannotate', '__init__.py')).read()
9+
version_re = re.compile(r'''__version__ = ["']((\d+)\.(\d+)\.(\d+)((dev(\d+))?(b(\d+))?))['"]''')
10+
return version_re.search(init).group(1)
11+
12+
13+
sdk_version = get_version()
14+
15+
16+
requirements_path = "requirements_{}.txt".format('dev' if 'dev' in sdk_version else 'prod')
717

8-
requirements_path = "requirements_{}.txt".format('dev' if parse(version).is_prerelease else 'prod')
918
requirements = []
1019

1120
with open("requirements.txt") as f:
@@ -23,14 +32,13 @@
2332

2433
setup(
2534
name='superannotate',
26-
version=version,
35+
version=sdk_version,
2736
package_dir={"": "src"},
2837
package_data={"superannotate": ["logging.conf"]},
2938
packages=find_packages(where="src"),
3039
description='Python SDK to SuperAnnotate platform',
3140
license='MIT',
3241
author='SuperAnnotate AI',
33-
author_email='vaghinak@superannotate.com',
3442
url='https://github.com/superannotateai/superannotate-python-sdk',
3543
long_description=readme,
3644
long_description_content_type='text/markdown',
@@ -40,5 +48,17 @@
4048
entry_points={
4149
'console_scripts': ['superannotatecli = superannotate.lib.app.bin.superannotate:main']
4250
},
43-
python_requires='>=3.6'
51+
classifiers=[
52+
'Programming Language :: Python',
53+
'Programming Language :: Python :: 3',
54+
'Programming Language :: Python :: 3.7',
55+
'Programming Language :: Python :: 3.8',
56+
'Programming Language :: Python :: 3.9',
57+
'Programming Language :: Python :: 3.10',
58+
'Programming Language :: Python :: 3.11',
59+
],
60+
project_urls={
61+
'Documentation': 'https://superannotate.readthedocs.io/en/stable/',
62+
},
63+
python_requires='>=3.7'
4464
)

src/superannotate/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
import sys
33

4+
__version__ = "4.4.1dev10"
5+
46
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
57

68
import logging.config # noqa
@@ -19,7 +21,6 @@
1921
from superannotate.lib.core import PACKAGE_VERSION_MAJOR_UPGRADE # noqa
2022
from superannotate.lib.core import PACKAGE_VERSION_UPGRADE # noqa
2123
from superannotate.logger import get_default_logger # noqa
22-
from superannotate.version import __version__ # noqa
2324
import superannotate.lib.core.enums as enums # noqa
2425

2526
SESSIONS = {}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from lib.infrastructure.controller import Controller
1717
from lib.infrastructure.repositories import ConfigRepository
1818
from mixpanel import Mixpanel
19-
from version import __version__
19+
from superannotate import __version__
2020

2121

2222
class BaseInterfaceFacade:
@@ -26,7 +26,11 @@ def __init__(self, token: str = None, config_path: str = None):
2626
version = os.environ.get("SA_VERSION", "v1")
2727
_token, _config_path = None, None
2828
_host = os.environ.get("SA_URL", constants.BACKEND_URL)
29-
_ssl_verify = bool(os.environ.get("SA_SSL", True))
29+
_ssl_verify = not os.environ.get("SA_SSL", "True").lower() in (
30+
"false",
31+
"f",
32+
"0",
33+
)
3034
if token:
3135
_token = Controller.validate_token(token=token)
3236
elif config_path:
@@ -37,6 +41,9 @@ def __init__(self, token: str = None, config_path: str = None):
3741
_token, _host, _ssl_verify = self._retrieve_configs(
3842
constants.CONFIG_PATH
3943
)
44+
_host = _host if _host else constants.BACKEND_URL
45+
_ssl_verify = True if _ssl_verify is None else _ssl_verify
46+
4047
self._token, self._host = _token, _host
4148
self.controller = Controller(_token, _host, _ssl_verify, version)
4249
BaseInterfaceFacade.REGISTRY.append(self)

0 commit comments

Comments
 (0)