Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo and get pyright version from lint script #291

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading