forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'opencv/develop' into develop
# Conflicts: # cvat/apps/engine/backup.py # cvat/requirements/base.txt # docker-compose.yml # site/config.toml # site/content/en/docs/administration/basics/installation.md # utils/cli/cli.py # utils/cli/core/core.py
- Loading branch information
Showing
1,213 changed files
with
103,111 additions
and
125,752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
# B406 : import_xml_sax | ||
# B410 : import_lxml | ||
skips: B101,B102,B320,B404,B406,B410 | ||
exclude: **/tests/**,tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ branch = true | |
|
||
source = | ||
cvat/apps/ | ||
utils/cli/ | ||
cvat-sdk/ | ||
cvat-cli/ | ||
utils/dataset_manifest | ||
|
||
omit = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Black | ||
on: pull_request | ||
jobs: | ||
Linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: files | ||
uses: jitterbit/get-changed-files@v1 | ||
continue-on-error: true | ||
|
||
- name: Run checks | ||
env: | ||
PR_FILES_AM: ${{ steps.files.outputs.added_modified }} | ||
PR_FILES_RENAMED: ${{ steps.files.outputs.renamed }} | ||
run: | | ||
# If different modules use different Black configs, | ||
# we need to run Black for each python component group separately. | ||
# Otherwise, they all will use the same config. | ||
ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python") | ||
isValueIn () { | ||
# Checks if a value is in an array | ||
# https://stackoverflow.com/a/8574392 | ||
# args: value, array | ||
local e match="$1" | ||
shift | ||
for e; do | ||
[[ "$e" == "$match" ]] && return 0; | ||
done | ||
return 1 | ||
} | ||
startswith () { | ||
# Inspired by https://stackoverflow.com/a/2172367 | ||
# Checks if the first arg starts with the second one | ||
local value="$1" | ||
local beginning="$2" | ||
return $([[ $value == ${beginning}* ]]) | ||
} | ||
PR_FILES="$PR_FILES_AM $PR_FILES_RENAMED" | ||
UPDATED_DIRS="" | ||
for FILE in $PR_FILES; do | ||
EXTENSION="${FILE##*.}" | ||
DIRECTORY="$(dirname $FILE)" | ||
if [[ "$EXTENSION" == "py" ]]; then | ||
for EDIR in ${ENABLED_DIRS[@]}; do | ||
if startswith "${DIRECTORY}/" "${EDIR}/" && ! isValueIn "${EDIR}" ${UPDATED_DIRS[@]}; | ||
then | ||
UPDATED_DIRS+=" ${EDIR}" | ||
fi | ||
done | ||
fi | ||
done | ||
if [[ ! -z $UPDATED_DIRS ]]; then | ||
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv | ||
python3 -m venv .env | ||
. .env/bin/activate | ||
pip install -U pip wheel setuptools | ||
pip install $(egrep "black.*" ./cvat-cli/requirements/development.txt) | ||
mkdir -p black_report | ||
echo "Black version: "$(black --version) | ||
echo "The dirs will be checked: $UPDATED_DIRS" | ||
EXIT_CODE=0 | ||
for DIR in $UPDATED_DIRS; do | ||
black --check $DIR >> ./black_report/black_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true | ||
done | ||
deactivate | ||
exit $EXIT_CODE | ||
else | ||
echo "No files with the \"py\" extension found" | ||
fi | ||
- name: Upload artifacts | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: black_report | ||
path: black_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Workflow deletes image artifacts that created by CI workflow | ||
name: Delete image artifacts | ||
on: | ||
workflow_run: | ||
workflows: [CI, Comment] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
cleanup: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Clean up | ||
run: | | ||
wri=${{ github.event.workflow_run.id }} | ||
for ai in $(gh api /repos/${{ github.repository }}/actions/runs/$wri/artifacts | jq '.artifacts[] | select( .name | startswith("cvat")) | .id'); | ||
do | ||
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$ai | ||
done |
Oops, something went wrong.