Skip to content

Commit 3e33b23

Browse files
authored
Fix typo and get pyright version from lint script (#291)
1 parent a4cd263 commit 3e33b23

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

Diff for: .github/workflows/lint-and-build.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,20 @@ jobs:
7878
cache-dependency-path: "scripts/requirements*.txt"
7979
- run: scripts/install.ps1
8080
shell: pwsh
81+
- name: Get pyright version
82+
id: pyright_version
83+
run: |
84+
PYRIGHT_VERSION=$(grep '$pyrightVersion = ' 'scripts/lint.ps1' | cut -d "#" -f 1 | cut -d = -f 2 | tr -d ' ')
85+
echo pyright version: "${PYRIGHT_VERSION}"
86+
if [ "$PYRIGHT_VERSION" = "'latest'" ]; then
87+
PYRIGHT_VERSION=
88+
fi
89+
echo PYRIGHT_VERSION="${PYRIGHT_VERSION}" >> "${GITHUB_OUTPUT}"
90+
shell: bash
8191
- name: Analysing the code with Pyright
8292
uses: jakebailey/pyright-action@v2
8393
with:
84-
version: "1.1.364"
94+
version: ${{ steps.pyright_version.outputs.PYRIGHT_VERSION }}
8595
working-directory: src/
8696
python-version: ${{ matrix.python-version }}
8797
Build:

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ max-branches = 15
134134
it doesn't support special characters. Use `utils.imread` instead.
135135
https://github.com/opencv/opencv/issues/4292#issuecomment-2266019697"""
136136
"cv2.imwrite".msg = """\
137-
it doesn't support special characters. . Use `utils.imwrite` instead.
137+
it doesn't support special characters. Use `utils.imwrite` instead.
138138
https://github.com/opencv/opencv/issues/4292#issuecomment-2266019697"""
139139

140140
# https://github.com/hhatto/autopep8#usage

Diff for: src/capture_method/XcbCaptureMethod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_frame(self):
3939
selection = self._autosplit_ref.settings_dict["capture_region"]
4040
x = selection["x"] + offset_x
4141
y = selection["y"] + offset_y
42-
image = ImageGrab.grab( # pyright: ignore[reportUnknownMemberType] # TODO: Fix upstream
42+
image = ImageGrab.grab(
4343
(
4444
x,
4545
y,

Diff for: src/capture_method/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def get(self, key: CaptureMethodEnum, default: object = None, /):
154154
CAPTURE_METHODS[CaptureMethodEnum.DESKTOP_DUPLICATION] = DesktopDuplicationCaptureMethod
155155
CAPTURE_METHODS[CaptureMethodEnum.PRINTWINDOW_RENDERFULLCONTENT] = ForceFullContentRenderingCaptureMethod
156156
elif sys.platform == "linux":
157-
if features.check_feature(feature="xcb"): # pyright: ignore[reportUnknownMemberType] # TODO: Fix upstream
157+
if features.check_feature(feature="xcb"):
158158
CAPTURE_METHODS[CaptureMethodEnum.XCB] = XcbCaptureMethod
159159
try:
160160
pyscreeze.screenshot()

0 commit comments

Comments
 (0)