Skip to content

Commit

Permalink
Fix pyright failure in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed Nov 22, 2023
1 parent 1373ebe commit 2396c2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

@nox.session
def test(session: nox.Session):
session.install(".[test]")
session.install("-e", ".[test]")

# this apparently CANNOT run from pre-commit in GitHub Actions (venv issues)
session.run("pyright", "src", "--warnings")
session.run("pyright", "--warnings")

session.run("pytest", *session.posargs)

Expand Down
2 changes: 1 addition & 1 deletion submodules/hexdoc-hexcasting-template
7 changes: 6 additions & 1 deletion test/integration/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import subprocess
from pathlib import Path
from typing import TYPE_CHECKING

import pytest
from hexdoc.cli.app import render
Expand All @@ -22,7 +23,11 @@

@pytest.fixture(scope="session", autouse=True)
def patch_versions(monkeysession: MonkeyPatch):
from hexdoc_hexcasting import _hooks
# because pyright complains when we do this in the CI
if TYPE_CHECKING:
_hooks = None
else:
from hexdoc_hexcasting import _hooks

monkeysession.setattr(_hooks, "GRADLE_VERSION", "MOD_VERSION")
monkeysession.setattr(_hooks, "PY_VERSION", "PLUGIN_VERSION")
Expand Down

0 comments on commit 2396c2d

Please sign in to comment.