Allow stubs to depend on numpy (#9499)

This commit is contained in:
Alex Waygood
2023-01-12 09:01:23 +00:00
committed by GitHub
parent b9eab637cb
commit 0b903441e8
3 changed files with 26 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ import subprocess
import sys
import venv
from collections.abc import Iterable, Mapping
from functools import cache
from functools import lru_cache
from pathlib import Path
from typing import NamedTuple
from typing_extensions import Annotated
@@ -25,6 +25,10 @@ except ImportError:
return text
# A backport of functools.cache for Python <3.9
# This module is imported by mypy_test.py, which needs to run on 3.7 in CI
cache = lru_cache(None)
# Used to install system-wide packages for different OS types:
METADATA_MAPPING = {"linux": "apt_dependencies", "darwin": "brew_dependencies", "win32": "choco_dependencies"}