Skip to content

Commit 1938c61

Browse files
authored
Merge pull request #161 from superannotateai/re-design-sdk
Re design sdk
2 parents 3cab063 + 066c19d commit 1938c61

File tree

1,054 files changed

+25930
-22029
lines changed

Some content is hidden

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

1,054 files changed

+25930
-22029
lines changed

.coveragerc

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

.dockerignore

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

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- re-design-sdk
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
sonarcloud:
10+
name: SonarCloud
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: SonarCloud Scan
17+
uses: SonarSource/sonarcloud-github-action@master
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
20+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.gitignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
*mypy*
6+
*.egg*
7+
*DS_Store*
58

69
# C extensions
710
*.so
@@ -14,7 +17,6 @@ dist/
1417
downloads/
1518
eggs/
1619
.eggs/
17-
lib/
1820
lib64/
1921
parts/
2022
sdist/
@@ -54,7 +56,7 @@ coverage.xml
5456
# Translations
5557
*.mo
5658
*.pot
57-
59+
.env
5860
# Django stuff:
5961
*.log
6062
local_settings.py
@@ -141,6 +143,7 @@ _mask.c
141143
tags
142144
temp
143145
debug_*
144-
145-
# IDE
146-
.idea
146+
*.idea
147+
*.DS_Store
148+
htmlcov
149+
htmlcov

.pre-commit-config.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
repos:
2+
- repo: 'https://gitlab.com/pycqa/flake8'
3+
rev: 3.8.2
4+
hooks:
5+
- id: flake8
6+
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_convertors
7+
name: Style Guide Enforcement (flake8)
8+
args:
9+
- '--max-line-length=120'
10+
- --ignore=D100,D203,D405,W503,E203,E501,F841,E126,E712
11+
- repo: 'https://github.com/asottile/pyupgrade'
12+
rev: v2.4.3
13+
hooks:
14+
- id: pyupgrade
15+
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_convertors
16+
name: Upgrade syntax for newer versions of the language (pyupgrade)
17+
args:
18+
- '--py37-plus'
19+
- repo: 'https://github.com/asottile/reorder_python_imports'
20+
rev: v2.3.0
21+
hooks:
22+
- id: reorder-python-imports
23+
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_convertors
24+
name: 'Reorder Python imports (src, tests)'
25+
args:
26+
- '--application-directories'
27+
- app
28+
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
29+
rev: v3.1.0
30+
hooks:
31+
- id: check-byte-order-marker
32+
- id: trailing-whitespace
33+
- id: end-of-file-fixer
34+
- repo: 'https://github.com/python/black'
35+
rev: 19.10b0
36+
hooks:
37+
- id: black
38+
name: Uncompromising Code Formatter (black)
39+
# - repo: 'https://github.com/asottile/dead'
40+
# rev: v1.3.0
41+
# hooks:
42+
# - id: dead
43+
files: src/
44+
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_convertors

.pylintrc

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

.vscode/settings.json

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

Dockerfile

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

Dockerfile_dev_env

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

Makefile

Lines changed: 18 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,26 @@
1-
.PHONY: clean tests stress-tests test_coverage install lint docs dist check_formatting
1+
.PHONY: help coverage linter install mypy test validate
22

3-
MAKEFLAGS += -j1
3+
help:
4+
@echo "Please use \`make <target>' where <target> is one of"
5+
@echo " coverage to make source code coverage check"
6+
@echo " help to show this help"
7+
@echo " test to make tests running"
8+
@echo " validate to make source code validation"
49

5-
PYTHON=python3
6-
PIP=pip3
7-
PYLINT=pylint
8-
PYTESTS=pytest
9-
COVERAGE=coverage
10-
11-
tests: check_formatting docs
12-
$(PYTESTS) -n auto --full-trace tests
13-
14-
stress-tests: SA_STRESS_TESTS=1
15-
stress-tests: tests
16-
17-
clean:
18-
rm -rf superannotate.egg-info
19-
rm -rf build
20-
rm -rf dist
21-
rm -rf htmlcov
22-
23-
test_coverage: check_formatting
24-
-$(PYTESTS) --cov=superannotate -n auto tests
25-
$(COVERAGE) html
26-
@echo "\033[95m\n\nCoverage successful! View the output at file://htmlcov/index.html.\n\033[0m"
10+
coverage:
11+
tox -e coverage
2712

2813
install:
29-
$(PIP) install -e .
30-
31-
lint: check_formatting
32-
-$(PYLINT) --output-format=json superannotate/ | pylint-json2html -o pylint.html
33-
34-
lint_tests:
35-
-$(PYLINT) tests/*
36-
37-
docs:
38-
cd docs && make html SPHINXOPTS="-W"
39-
@echo "\033[95m\n\nBuild successful! View the docs homepage at file://docs/build/html/index.html.\n\033[0m"
40-
41-
dist:
42-
-rm -rf dist/*
43-
$(PYTHON) setup.py sdist
44-
twine upload dist/*
45-
46-
check_formatting:
47-
yapf -p -r --diff superannotate
14+
@echo "This function not implemented yet"
4815

49-
docker_run_dev_env: docker_pull_dev_env
50-
docker run -it -p 8888:8888 \
51-
-v ${HOME}/.superannotate:/root/.superannotate \
52-
-v $(pwd):/root/superannotate-python-sdk \
53-
superannotate/pythonsdk-dev-env
16+
linter:
17+
tox -e linter
5418

55-
docker_run_dev_env_local_copy: docker_build_dev_env_from_local_copy
56-
docker run -it -p 8888:8888 \
57-
-v ${HOME}/.superannotate:/root/.superannotate \
58-
-v $(pwd):/root/superannotate-python-sdk \
59-
superannotate/pythonsdk-dev-env \
60-
bash -c "pip install -e superannotate-python-sdk && jupyter lab --allow-root --NotebookApp.token='' --NotebookApp.password='' --no-browser --ip 0.0.0.0"
19+
mypy:
20+
tox -e mypy
6121

62-
docker_build_dev_env_from_local_copy:
63-
docker build -t superannotate/pythonsdk-dev-env:latest -f Dockerfile_dev_env .
22+
test:
23+
tox
6424

65-
docker_pull_dev_env:
66-
docker pull superannotate/pythonsdk-dev-env:latest
25+
validate:
26+
tox -e pre-commit

0 commit comments

Comments
 (0)