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"]
additional_dependencies: [
'keyring==23.0.1',
'nox==2020.12.31',
'nox==2021.6.12',
'types-docutils==0.1.8',
'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
used is not the code being tested.
"""
# https://github.com/theacodes/nox/pull/377
env = {"VIRTUAL_ENV": session.virtualenv.location} # type: ignore
env = {"VIRTUAL_ENV": session.virtualenv.location}
command = ("python", LOCATIONS["protected-pip"]) + arguments
session.run(*command, env=env, silent=True)
@ -87,8 +86,7 @@ def test(session: nox.Session) -> None:
session.log(msg)
# Build source distribution
# https://github.com/theacodes/nox/pull/377
sdist_dir = os.path.join(session.virtualenv.location, "sdist") # type: ignore
sdist_dir = os.path.join(session.virtualenv.location, "sdist")
if os.path.exists(sdist_dir):
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.
session.install("packaging")
cmd = [
# https://github.com/theacodes/nox/pull/378
os.path.join(session.bin, "python"), # type: ignore
os.path.join(session.bin, "python"),
"tools/release/check_version.py",
version,
]
@ -156,12 +155,11 @@ def workdir(
"""Temporarily chdir when entering CM and chdir back on exit."""
orig_dir = pathlib.Path.cwd()
# https://github.com/theacodes/nox/pull/376
nox_session.chdir(dir_path) # type: ignore
nox_session.chdir(dir_path)
try:
yield dir_path
finally:
nox_session.chdir(orig_dir) # type: ignore
nox_session.chdir(orig_dir)
@contextlib.contextmanager