Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ jobs:
- uses: astral-sh/ruff-action@v3
with:
version-file: "pyproject.toml"
- run: ruff format --check
- run: ruff format --check --diff
# Show formatting issues even if the "check" step failed
if: ${{ !cancelled() }}

Pyright:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: pretty-format-ini
args: [--autofix]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6 # Must match requirements-dev.txt
rev: v0.11.8 # Must match requirements-dev.txt
hooks:
- id: ruff
args: [--fix]
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ Not a developer? You can still help through the following methods:
- <https://bugreports.qt.io/browse/PYSIDE-2541>
- <https://bugreports.qt.io/browse/PYSIDE-2542>
- <https://github.com/pyinstaller/pyinstaller/issues/9012>
- <https://github.com/astral-sh/uv/issues/1495>
- <https://github.com/opencv/opencv/issues?q=is%3Aissue+is%3Aopen+involves%3AAvasam+sort%3Areactions-%2B1-asc+>
- <https://github.com/opencv/opencv/issues/18305>
- <https://github.com/opencv/opencv/issues/23906>
- <https://github.com/mypyc/mypyc/issues?q=sort%3Areactions-%2B1%20is%3Aissue%20is%3Aopen%20%20involves%3AAvasam%20>
- <https://github.com/uiri/toml/issues/270>
- <https://github.com/microsoft/vscode/issues/40239>
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"typed-D3DShot[numpy] >=1.0.1; sys_platform == 'win32'",
"winrt-Windows.Foundation >=2.2.0; sys_platform == 'win32'", # Python 3.13 support
"winrt-Windows.Graphics >=2.2.0; sys_platform == 'win32'", # Python 3.13 support
"winrt-Windows.Graphics.Capture >=2.3.0; sys_platform == 'win32'", # Python 3.13 support
"winrt-Windows.Graphics.Capture >=3.0.0; sys_platform == 'win32'", # Type hints are no longer typing.Optional by default.
"winrt-Windows.Graphics.Capture.Interop >=2.3.0; sys_platform == 'win32'", # Python 3.13 support
"winrt-Windows.Graphics.DirectX >=2.3.0; sys_platform == 'win32'", # Python 3.13 support
"winrt-Windows.Graphics.DirectX.Direct3D11 >=2.3.0; sys_platform == 'win32'", # Python 3.13 support
Expand All @@ -51,8 +51,8 @@ dev = [
#
# Linters & Formatters
"mypy[faster-cache] >=1.14",
"pyright[nodejs] >=1.1",
"ruff >=0.9.6",
"pyright[nodejs] >=1.1.400", # reportPrivateImportUsage behaviour change
"ruff >=0.11.8",
#
# Types
"scipy-stubs >=1.14.1.1",
Expand Down Expand Up @@ -110,6 +110,8 @@ reportUnusedCallResult = "none"

# Exclude from scanning when running pyright
exclude = [
".git/", # Avoid accidentally scanning branch names ending in .py
".venv*/",
".venv/",
# Auto generated, fails some strict pyright checks
"build/",
Expand Down
2 changes: 0 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Modifications to this file that are not project-specific should also be done upstream.

# https://docs.astral.sh/ruff/configuration/
target-version = "py311" # Change this to the oldest supported version by your application
line-length = 100
preview = true
required-version = ">=0.9.0" # Removed ISC compatibility warning
Expand All @@ -24,7 +23,6 @@ ignore = [
"D1", # pydocstyle Missing doctring
"D401", # pydocstyle: non-imperative-mood
"EM", # flake8-errmsg
"EXE", # flake8-executable
# This is often something we can't control: https://github.com/astral-sh/ruff/issues/9497
# Also false-positive with positional-only arguments: https://github.com/astral-sh/ruff/issues/3247
"FBT003", # flake8-boolean-trap: boolean-positional-value-in-call
Expand Down
2 changes: 2 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/pwsh

& "$PSScriptRoot/compile_resources.ps1"

$SupportsSplashScreen = [System.Convert]::ToBoolean($(uv run --active python -c "import _tkinter; print(hasattr(_tkinter, '__file__'))"))
Expand Down
2 changes: 2 additions & 0 deletions scripts/compile_resources.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/pwsh

$originalDirectory = $pwd
Set-Location "$PSScriptRoot/.."

Expand Down
2 changes: 2 additions & 0 deletions scripts/designer.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/pwsh

$qt6_applications_path = uv run --active python -c 'import qt6_applications; print(qt6_applications.__path__[0])'

& "$qt6_applications_path/Qt/bin/designer" `
Expand Down
2 changes: 2 additions & 0 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/pwsh

# Validating user groups on Linux
If ($IsLinux) {
$groups = groups
Expand Down
2 changes: 2 additions & 0 deletions scripts/lint.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/pwsh

$originalDirectory = $pwd
Set-Location "$PSScriptRoot/.."
$exitCodes = 0
Expand Down
2 changes: 2 additions & 0 deletions scripts/start.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/pwsh

param ([string]$p1)
& "$PSScriptRoot/compile_resources.ps1"
uv run --active "$PSScriptRoot/../src/AutoSplit.py" $p1
2 changes: 1 addition & 1 deletion src/capture_method/WindowsGraphicsCaptureMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
WGC_NO_BORDER_MIN_BUILD = 20348


async def convert_d3d_surface_to_software_bitmap(surface: IDirect3DSurface | None):
async def convert_d3d_surface_to_software_bitmap(surface: IDirect3DSurface):
return await SoftwareBitmap.create_copy_from_surface_async(surface)


Expand Down
4 changes: 2 additions & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def run_tesseract(png: bytes):
@return: The recognized output string from tesseract.
"""
return (
subprocess.Popen( # noqa: S603 # Only using known literal strings
subprocess.Popen( # noqa: S603 # Only using known literal strings or shutil.which result
TESSERACT_CMD, **subprocess_kwargs()
)
.communicate(input=png)[0]
Expand All @@ -306,7 +306,7 @@ def list_processes():
return [
# The first row is the process name
line.split()[0]
for line in subprocess.check_output( # noqa: S603 # Known input
for line in subprocess.check_output(
"C:/Windows/System32/tasklist.exe", text=True
).splitlines()[3:] # Skip the table header lines
if line
Expand Down
Loading
Loading