This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
forked from Toufool/AutoSplit
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toml profiles + Python 3.10 (Toufool#140)
* Typings update * Full setup and configuration update * User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor
- Loading branch information
Showing
44 changed files
with
1,767 additions
and
2,003 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 |
---|---|---|
@@ -1,28 +1,31 @@ | ||
[flake8] | ||
color=always | ||
max-line-length=120 | ||
exclude= | ||
src/gen/, ; Auto generated | ||
typings/cv2-stubs/__init__.pyi, ; External existing stub | ||
; Auto generated | ||
exclude=src/gen/, typings/cv2-stubs/__init__.pyi | ||
ignore= | ||
W503, ; Linebreak before binary operator | ||
E402, ; Allow imports at the bottom of file | ||
Y026, ; Not using typing_extensions | ||
W503, ; Linebreak before binary operator | ||
E402, ; Allow imports at the bottom of file | ||
Y026, ; Not using typing_extensions | ||
SIM105, ; contextlib.suppress is roughly 3x slower than try/except | ||
CCE001, ; False positives for attribute docstrings | ||
per-file-ignores= | ||
; Docstrings in type stubs | ||
; Function bodys contain other than just ... (eg: raise) | ||
; Single quote docstrings | ||
typings/cv2-stubs/__init__.pyi: Q000,N8,E704, Y021,Y010,Q002 | ||
|
||
typings/cv2-stubs/__init__.pyi: Q000,E704,E501,N8,A002,A003,CCE002,F401, Y021,Y010,Q002 | ||
; Quotes | ||
; Allow ... on same line as def | ||
; Line too long | ||
; Naming conventions can't be controlled for external libraries | ||
typings/**: Q000,E704,E501,N8 | ||
|
||
; Argument names can't be controlled for external libraries | ||
; attribute names can't be controlled for external libraries | ||
; False positive Class level expression with elipsis | ||
; Type re-exports | ||
*.pyi: Q000,E704,E501,N8,A002,A003,CCE002,F401 | ||
; PyQt methods | ||
ignore-names=closeEvent,paintEvent,keyPressEvent,mousePressEvent,mouseMoveEvent,mouseReleaseEvent | ||
; McCabe max-complexity is also taken care of by Pylint and doesn't fail the build there | ||
; So this is the hard limit | ||
max-complexity=32 | ||
inline-quotes=" | ||
inline-quotes=double |
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,130 +1,134 @@ | ||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | ||
name: Lint and build | ||
on: | ||
workflow_dispatch: # Allows manual builds | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- 2.0.0 | ||
paths: | ||
- '**.py' | ||
- '**.pyi' | ||
- '**.ui' | ||
- "**.py" | ||
- "**.pyi" | ||
- "**.ui" | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- dev | ||
- dev* | ||
- 2.0.0 | ||
paths: | ||
- '**.py' | ||
- '**.pyi' | ||
- '**.ui' | ||
- "**.py" | ||
- "**.pyi" | ||
- "**.ui" | ||
|
||
env: | ||
GITHUB_HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
||
jobs: | ||
Pyright: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
python-version: ["3.9", "3.10"] | ||
steps: | ||
- name: Checkout ${{ github.repository }}/${{ github.ref }} | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Set up Node | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r "scripts/requirements.txt" | ||
npm install -g pyright | ||
- run: scripts/compile_resources.bat | ||
- name: Analysing the code with ${{ job.name }} | ||
cache: "pip" | ||
cache-dependency-path: "scripts/requirements*.txt" | ||
- run: scripts/install.ps1 | ||
shell: pwsh | ||
- name: Analysing the code with Pyright | ||
run: pyright --warnings | ||
Pylint: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
python-version: ["3.9", "3.10"] | ||
steps: | ||
- name: Checkout ${{ github.repository }}/${{ github.ref }} | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r "scripts/requirements.txt" | ||
- run: scripts/compile_resources.bat | ||
- name: Analysing the code with ${{ job.name }} | ||
run: pylint --reports=y --output-format=colorized $(git ls-files '**/*.py') | ||
cache: "pip" | ||
cache-dependency-path: "scripts/requirements*.txt" | ||
- run: scripts/install.ps1 | ||
shell: pwsh | ||
- name: Analysing the code with Pylint | ||
run: pylint --reports=y --output-format=colorized src/ | ||
Flake8: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
python-version: ["3.9", "3.10"] | ||
steps: | ||
- name: Checkout ${{ github.repository }}/${{ github.ref }} | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r "scripts/requirements.txt" | ||
- run: scripts/compile_resources.bat | ||
- name: Analysing the code with ${{ job.name }} | ||
cache: "pip" | ||
cache-dependency-path: "scripts/requirements*.txt" | ||
- run: scripts/install.ps1 | ||
shell: pwsh | ||
- name: Analysing the code with Flake8 | ||
run: flake8 | ||
Bandit: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
steps: | ||
- name: Checkout ${{ github.repository }}/${{ github.ref }} | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r "scripts/requirements.txt" | ||
- run: scripts/compile_resources.bat | ||
- name: Analysing the code with ${{ job.name }} | ||
python-version: "3.10" | ||
cache: "pip" | ||
cache-dependency-path: "scripts/requirements*.txt" | ||
- run: scripts/install.ps1 | ||
shell: pwsh | ||
- name: Analysing the code with Bandit | ||
run: bandit -n 1 --severity-level medium --recursive src | ||
Build: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
python-version: ["3.10"] | ||
steps: | ||
- name: Checkout ${{ github.repository }}/${{ github.ref }} | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install -r "scripts/requirements.txt" | ||
- run: scripts/build.bat | ||
cache: "pip" | ||
- run: scripts/install.ps1 | ||
shell: pwsh | ||
- run: scripts/build.ps1 | ||
shell: pwsh | ||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: AutoSplit (Python ${{ matrix.python-version }}) | ||
path: dist/AutoSplit.exe | ||
path: dist/AutoSplit* | ||
if-no-files-found: error | ||
- name: Upload Build logs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Build logs (Python ${{ matrix.python-version }}) | ||
path: | | ||
build/AutoSplit/*.toc | ||
build/AutoSplit/*.txt | ||
build/AutoSplit/*.html | ||
if-no-files-found: error |
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,29 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: AutoSplit", | ||
"type": "python", | ||
"request": "launch", | ||
"preLaunchTask": "Compile resources", | ||
"program": "src/AutoSplit.py", | ||
"console": "integratedTerminal", | ||
"justMyCode": true | ||
}, | ||
{ | ||
"name": "Python: AutoSplit --auto-controlled", | ||
"type": "python", | ||
"request": "launch", | ||
"preLaunchTask": "Compile resources", | ||
"program": "src/AutoSplit.py", | ||
"args": [ | ||
"--auto-controlled" | ||
], | ||
"console": "integratedTerminal", | ||
"justMyCode": true | ||
} | ||
] | ||
} |
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
Oops, something went wrong.