-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from roflcoopter/dev
v2.3.0 - CodeProject AI and License Plate Recognition
- Loading branch information
Showing
249 changed files
with
40,122 additions
and
53,655 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"name": "Viseron Development", | ||
"context": "..", | ||
"dockerFile": "../docker/Dockerfile.dev", | ||
"postCreateCommand": ".devcontainer/setup.sh", | ||
"overrideCommand": false, | ||
"containerEnv": { | ||
"DEVCONTAINER": "1", | ||
"PUID": "1000", | ||
"PGID": "1000" | ||
}, | ||
"containerUser": "root", | ||
"remoteUser": "abc", | ||
"forwardPorts": [8888], | ||
"portsAttributes": { | ||
"8888": { | ||
"label": "Viseron", | ||
"onAutoForward": "silent" | ||
} | ||
}, | ||
"runArgs": ["-e", "GIT_EDITOR=code --wait"], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-python.isort", | ||
"ms-python.flake8", | ||
"redhat.vscode-yaml", | ||
"esbenp.prettier-vscode", | ||
"GitHub.vscode-pull-request-github", | ||
"GitHub.vscode-github-actions", | ||
"GitHub.copilot", | ||
"eamodio.gitlens", | ||
"dbaeumer.vscode-eslint", | ||
"ms-azuretools.vscode-docker", | ||
"unifiedjs.vscode-mdx" | ||
], | ||
"settings": { | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"python.linting.enabled": true, | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.pylintPath": "/usr/local/bin/pylint", | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.flake8Path": "/usr/local/bin/flake8", | ||
"python.linting.pycodestylePath": "/usr/local/bin/pycodestyle", | ||
"python.linting.pydocstylePath": "/usr/local/bin/pydocstyle", | ||
"python.formatting.blackPath": "/usr/local/bin/black", | ||
"python.formatting.provider": "black", | ||
"python.testing.pytestArgs": ["--no-cov"], | ||
"python.linting.mypyEnabled": true, | ||
"python.linting.mypyPath": "/usr/local/bin/mypy", | ||
"editor.rulers": [80], | ||
"[python]": { | ||
"editor.rulers": [88], | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true, | ||
"yaml.customTags": ["!secret scalar"], | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
} | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
} | ||
} |
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,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Set workspace dir | ||
export WORKSPACE_DIR=$PWD | ||
echo "export WORKSPACE_DIR=$PWD" >> $HOME/.bashrc | ||
|
||
# Install python deps | ||
pip3 install -r requirements.txt | ||
|
||
# Install frontend dependencies | ||
cd $WORKSPACE_DIR/frontend | ||
npm install | ||
|
||
# Install pre-commit hooks | ||
cd $WORKSPACE_DIR | ||
pre-commit install | ||
|
||
# Set environment variables | ||
cd /var/run/environment | ||
for FILE in * | ||
do | ||
echo "export $FILE=$(cat $FILE)" >> $HOME/.bashrc | ||
sed -i "s/$FILE=true/$FILE=false/g" $HOME/.bashrc | ||
done | ||
|
||
# Symlink config | ||
cd $WORKSPACE_DIR | ||
mkdir -p $WORKSPACE_DIR/config | ||
FILE=$WORKSPACE_DIR/config/config.yaml | ||
if test -f "$FILE"; then | ||
echo "Config file already exists" | ||
else | ||
echo "Creating default config" | ||
python3 -c "import viseron.config; viseron.config.create_default_config('$FILE')" | ||
fi | ||
ln -s $WORKSPACE_DIR/config/config.yaml /config/config.yaml | ||
|
||
# Create .env.local | ||
FILE=$WORKSPACE_DIR/frontend/.env.local | ||
if test -f "$FILE"; then | ||
echo "Frontend .env.local already exists" | ||
else | ||
echo "Creating frontend .env.local" | ||
echo "VITE_PROXY_HOST=localhost:8888" > $FILE | ||
fi |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
* | ||
!/.coveragerc | ||
!/.devcontainer/ | ||
!/.devcontainer/* | ||
!tests/ | ||
!tests/* | ||
!viseron/ | ||
|
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 @@ | ||
name: run_in_venv | ||
description: Set Python symlink and activate venv | ||
|
||
inputs: | ||
command: | ||
required: true | ||
description: The command to run in the venv | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set Python symlink and activate venv | ||
shell: bash | ||
run: | | ||
PYTHON_PATH=$(which python3) | ||
source venv/bin/activate | ||
PYTHON_BROKEN_PATH=$(dirname $(which pip)) | ||
rm $PYTHON_BROKEN_PATH/python | ||
ln -s $PYTHON_PATH $PYTHON_BROKEN_PATH/python | ||
export PATH=$PATH:$(dirname $PYTHON_BROKEN_PATH) | ||
${{ inputs.command }} |
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,72 @@ | ||
name: CI Frontend | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- master | ||
pull_request: ~ | ||
|
||
env: | ||
NODE_VERSION: 16 | ||
|
||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
jobs: | ||
lint: | ||
name: Lint and check format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Node ${{ env.NODE_VERSION }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: npm | ||
cache-dependency-path: ./frontend/package-lock.json | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run eslint | ||
run: npm run lint:eslint | ||
- name: Run prettier | ||
run: npm run lint:prettier | ||
- name: Run tsc | ||
run: npm run lint:types | ||
|
||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Node ${{ env.NODE_VERSION }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: npm | ||
cache-dependency-path: ./frontend/package-lock.json | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run tests | ||
run: npm run test | ||
|
||
build: | ||
name: Build frontend | ||
needs: [lint, test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Set up Node ${{ env.NODE_VERSION }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: npm | ||
cache-dependency-path: ./frontend/package-lock.json | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run build | ||
run: npm run build |
Oops, something went wrong.