Merge pull request #10293 from jdufresne/nox

Upgrade nox to remove mypy ignores
This commit is contained in:
Pradyun Gedam 2021-08-13 10:59:41 +01:00 committed by GitHub
commit 4446d1a719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 10 deletions

View File

@ -57,7 +57,7 @@ repos:
args: ["--pretty", "--show-error-codes"] args: ["--pretty", "--show-error-codes"]
additional_dependencies: [ additional_dependencies: [
'keyring==23.0.1', 'keyring==23.0.1',
'nox==2020.12.31', 'nox==2021.6.12',
'types-docutils==0.1.8', 'types-docutils==0.1.8',
'types-six==0.1.9', 'types-six==0.1.9',
] ]

View File

@ -40,8 +40,7 @@ def run_with_protected_pip(session: nox.Session, *arguments: str) -> None:
(stable) version, and not the code being tested. This ensures pip being (stable) version, and not the code being tested. This ensures pip being
used is not the code being tested. used is not the code being tested.
""" """
# https://github.com/theacodes/nox/pull/377 env = {"VIRTUAL_ENV": session.virtualenv.location}
env = {"VIRTUAL_ENV": session.virtualenv.location} # type: ignore
command = ("python", LOCATIONS["protected-pip"]) + arguments command = ("python", LOCATIONS["protected-pip"]) + arguments
session.run(*command, env=env, silent=True) session.run(*command, env=env, silent=True)
@ -87,8 +86,7 @@ def test(session: nox.Session) -> None:
session.log(msg) session.log(msg)
# Build source distribution # Build source distribution
# https://github.com/theacodes/nox/pull/377 sdist_dir = os.path.join(session.virtualenv.location, "sdist")
sdist_dir = os.path.join(session.virtualenv.location, "sdist") # type: ignore
if os.path.exists(sdist_dir): if os.path.exists(sdist_dir):
shutil.rmtree(sdist_dir, ignore_errors=True) shutil.rmtree(sdist_dir, ignore_errors=True)

View File

@ -26,8 +26,7 @@ def get_version_from_arguments(session: Session) -> Optional[str]:
# We delegate to a script here, so that it can depend on packaging. # We delegate to a script here, so that it can depend on packaging.
session.install("packaging") session.install("packaging")
cmd = [ cmd = [
# https://github.com/theacodes/nox/pull/378 os.path.join(session.bin, "python"),
os.path.join(session.bin, "python"), # type: ignore
"tools/release/check_version.py", "tools/release/check_version.py",
version, version,
] ]
@ -156,12 +155,11 @@ def workdir(
"""Temporarily chdir when entering CM and chdir back on exit.""" """Temporarily chdir when entering CM and chdir back on exit."""
orig_dir = pathlib.Path.cwd() orig_dir = pathlib.Path.cwd()
# https://github.com/theacodes/nox/pull/376 nox_session.chdir(dir_path)
nox_session.chdir(dir_path) # type: ignore
try: try:
yield dir_path yield dir_path
finally: finally:
nox_session.chdir(orig_dir) # type: ignore nox_session.chdir(orig_dir)
@contextlib.contextmanager @contextlib.contextmanager