Skip to content

Commit

Permalink
Fix typo and get pyright version from lint script (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Aug 6, 2024
1 parent a4cd263 commit 3e33b23
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,20 @@ jobs:
cache-dependency-path: "scripts/requirements*.txt"
- run: scripts/install.ps1
shell: pwsh
- name: Get pyright version
id: pyright_version
run: |
PYRIGHT_VERSION=$(grep '$pyrightVersion = ' 'scripts/lint.ps1' | cut -d "#" -f 1 | cut -d = -f 2 | tr -d ' ')
echo pyright version: "${PYRIGHT_VERSION}"
if [ "$PYRIGHT_VERSION" = "'latest'" ]; then
PYRIGHT_VERSION=
fi
echo PYRIGHT_VERSION="${PYRIGHT_VERSION}" >> "${GITHUB_OUTPUT}"
shell: bash
- name: Analysing the code with Pyright
uses: jakebailey/pyright-action@v2
with:
version: "1.1.364"
version: ${{ steps.pyright_version.outputs.PYRIGHT_VERSION }}
working-directory: src/
python-version: ${{ matrix.python-version }}
Build:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ max-branches = 15
it doesn't support special characters. Use `utils.imread` instead.
https://github.com/opencv/opencv/issues/4292#issuecomment-2266019697"""
"cv2.imwrite".msg = """\
it doesn't support special characters. . Use `utils.imwrite` instead.
it doesn't support special characters. Use `utils.imwrite` instead.
https://github.com/opencv/opencv/issues/4292#issuecomment-2266019697"""

# https://github.com/hhatto/autopep8#usage
Expand Down
2 changes: 1 addition & 1 deletion src/capture_method/XcbCaptureMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_frame(self):
selection = self._autosplit_ref.settings_dict["capture_region"]
x = selection["x"] + offset_x
y = selection["y"] + offset_y
image = ImageGrab.grab( # pyright: ignore[reportUnknownMemberType] # TODO: Fix upstream
image = ImageGrab.grab(
(
x,
y,
Expand Down
2 changes: 1 addition & 1 deletion src/capture_method/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get(self, key: CaptureMethodEnum, default: object = None, /):
CAPTURE_METHODS[CaptureMethodEnum.DESKTOP_DUPLICATION] = DesktopDuplicationCaptureMethod
CAPTURE_METHODS[CaptureMethodEnum.PRINTWINDOW_RENDERFULLCONTENT] = ForceFullContentRenderingCaptureMethod
elif sys.platform == "linux":
if features.check_feature(feature="xcb"): # pyright: ignore[reportUnknownMemberType] # TODO: Fix upstream
if features.check_feature(feature="xcb"):
CAPTURE_METHODS[CaptureMethodEnum.XCB] = XcbCaptureMethod
try:
pyscreeze.screenshot()
Expand Down

0 comments on commit 3e33b23

Please sign in to comment.