py36+: remove rexport of Path and PurePath

This commit is contained in:
Anthony Sottile 2020-10-03 08:08:14 -07:00
parent 022ac9b9e8
commit fb1d550aac
27 changed files with 27 additions and 31 deletions

View File

@ -5,6 +5,7 @@ import traceback
from inspect import CO_VARARGS from inspect import CO_VARARGS
from inspect import CO_VARKEYWORDS from inspect import CO_VARKEYWORDS
from io import StringIO from io import StringIO
from pathlib import Path
from traceback import format_exception_only from traceback import format_exception_only
from types import CodeType from types import CodeType
from types import FrameType from types import FrameType
@ -42,7 +43,6 @@ from _pytest._io.saferepr import safeformat
from _pytest._io.saferepr import saferepr from _pytest._io.saferepr import saferepr
from _pytest.compat import final from _pytest.compat import final
from _pytest.compat import get_real_func from _pytest.compat import get_real_func
from _pytest.pathlib import Path
if TYPE_CHECKING: if TYPE_CHECKING:
from typing_extensions import Literal from typing_extensions import Literal

View File

@ -13,6 +13,8 @@ import struct
import sys import sys
import tokenize import tokenize
import types import types
from pathlib import Path
from pathlib import PurePath
from typing import Callable from typing import Callable
from typing import Dict from typing import Dict
from typing import IO from typing import IO
@ -36,8 +38,6 @@ from _pytest.assertion.util import ( # noqa: F401
from _pytest.config import Config from _pytest.config import Config
from _pytest.main import Session from _pytest.main import Session
from _pytest.pathlib import fnmatch_ex from _pytest.pathlib import fnmatch_ex
from _pytest.pathlib import Path
from _pytest.pathlib import PurePath
from _pytest.store import StoreKey from _pytest.store import StoreKey
if TYPE_CHECKING: if TYPE_CHECKING:

View File

@ -3,6 +3,7 @@
# pytest-cache version. # pytest-cache version.
import json import json
import os import os
from pathlib import Path
from typing import Dict from typing import Dict
from typing import Generator from typing import Generator
from typing import Iterable from typing import Iterable
@ -15,7 +16,6 @@ import attr
import py import py
import pytest import pytest
from .pathlib import Path
from .pathlib import resolve_from_str from .pathlib import resolve_from_str
from .pathlib import rm_rf from .pathlib import rm_rf
from .reports import CollectReport from .reports import CollectReport

View File

@ -7,6 +7,7 @@ import sys
from contextlib import contextmanager from contextlib import contextmanager
from inspect import Parameter from inspect import Parameter
from inspect import signature from inspect import signature
from pathlib import Path
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import Generic from typing import Generic
@ -76,8 +77,6 @@ def is_async_function(func: object) -> bool:
def getlocation(function, curdir: Optional[str] = None) -> str: def getlocation(function, curdir: Optional[str] = None) -> str:
from _pytest.pathlib import Path
function = get_real_func(function) function = get_real_func(function)
fn = Path(inspect.getfile(function)) fn = Path(inspect.getfile(function))
lineno = function.__code__.co_firstlineno lineno = function.__code__.co_firstlineno

View File

@ -12,6 +12,7 @@ import sys
import types import types
import warnings import warnings
from functools import lru_cache from functools import lru_cache
from pathlib import Path
from types import TracebackType from types import TracebackType
from typing import Any from typing import Any
from typing import Callable from typing import Callable
@ -52,7 +53,6 @@ from _pytest.outcomes import Skipped
from _pytest.pathlib import bestrelpath from _pytest.pathlib import bestrelpath
from _pytest.pathlib import import_path from _pytest.pathlib import import_path
from _pytest.pathlib import ImportMode from _pytest.pathlib import ImportMode
from _pytest.pathlib import Path
from _pytest.store import Store from _pytest.store import Store
from _pytest.warning_types import PytestConfigWarning from _pytest.warning_types import PytestConfigWarning

View File

@ -1,4 +1,5 @@
import os import os
from pathlib import Path
from typing import Dict from typing import Dict
from typing import Iterable from typing import Iterable
from typing import List from typing import List
@ -14,7 +15,6 @@ from .exceptions import UsageError
from _pytest.outcomes import fail from _pytest.outcomes import fail
from _pytest.pathlib import absolutepath from _pytest.pathlib import absolutepath
from _pytest.pathlib import commonpath from _pytest.pathlib import commonpath
from _pytest.pathlib import Path
if TYPE_CHECKING: if TYPE_CHECKING:
from . import Config from . import Config

View File

@ -5,6 +5,7 @@ import re
import sys import sys
from contextlib import contextmanager from contextlib import contextmanager
from io import StringIO from io import StringIO
from pathlib import Path
from typing import AbstractSet from typing import AbstractSet
from typing import Dict from typing import Dict
from typing import Generator from typing import Generator
@ -27,7 +28,6 @@ from _pytest.config import create_terminal_writer
from _pytest.config.argparsing import Parser from _pytest.config.argparsing import Parser
from _pytest.fixtures import FixtureRequest from _pytest.fixtures import FixtureRequest
from _pytest.main import Session from _pytest.main import Session
from _pytest.pathlib import Path
from _pytest.store import StoreKey from _pytest.store import StoreKey
from _pytest.terminal import TerminalReporter from _pytest.terminal import TerminalReporter

View File

@ -5,6 +5,7 @@ import functools
import importlib import importlib
import os import os
import sys import sys
from pathlib import Path
from typing import Callable from typing import Callable
from typing import Dict from typing import Dict
from typing import FrozenSet from typing import FrozenSet
@ -36,7 +37,6 @@ from _pytest.fixtures import FixtureManager
from _pytest.outcomes import exit from _pytest.outcomes import exit
from _pytest.pathlib import absolutepath from _pytest.pathlib import absolutepath
from _pytest.pathlib import bestrelpath from _pytest.pathlib import bestrelpath
from _pytest.pathlib import Path
from _pytest.pathlib import visit from _pytest.pathlib import visit
from _pytest.reports import CollectReport from _pytest.reports import CollectReport
from _pytest.reports import TestReport from _pytest.reports import TestReport

View File

@ -4,6 +4,7 @@ import re
import sys import sys
import warnings import warnings
from contextlib import contextmanager from contextlib import contextmanager
from pathlib import Path
from typing import Any from typing import Any
from typing import Generator from typing import Generator
from typing import List from typing import List
@ -17,7 +18,6 @@ from typing import Union
import pytest import pytest
from _pytest.compat import final from _pytest.compat import final
from _pytest.fixtures import fixture from _pytest.fixtures import fixture
from _pytest.pathlib import Path
RE_IMPORT_ERROR_NAME = re.compile(r"^No module named (.*)$") RE_IMPORT_ERROR_NAME = re.compile(r"^No module named (.*)$")

View File

@ -1,6 +1,7 @@
import os import os
import warnings import warnings
from functools import lru_cache from functools import lru_cache
from pathlib import Path
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import Dict from typing import Dict
@ -33,7 +34,6 @@ from _pytest.mark.structures import MarkDecorator
from _pytest.mark.structures import NodeKeywords from _pytest.mark.structures import NodeKeywords
from _pytest.outcomes import fail from _pytest.outcomes import fail
from _pytest.pathlib import absolutepath from _pytest.pathlib import absolutepath
from _pytest.pathlib import Path
from _pytest.store import Store from _pytest.store import Store
if TYPE_CHECKING: if TYPE_CHECKING:

View File

@ -32,9 +32,6 @@ from _pytest.compat import assert_never
from _pytest.outcomes import skip from _pytest.outcomes import skip
from _pytest.warning_types import PytestWarning from _pytest.warning_types import PytestWarning
__all__ = ["Path", "PurePath"]
LOCK_TIMEOUT = 60 * 60 * 3 LOCK_TIMEOUT = 60 * 60 * 3

View File

@ -10,6 +10,7 @@ import sys
import traceback import traceback
from fnmatch import fnmatch from fnmatch import fnmatch
from io import StringIO from io import StringIO
from pathlib import Path
from typing import Callable from typing import Callable
from typing import Dict from typing import Dict
from typing import Generator from typing import Generator
@ -43,7 +44,6 @@ from _pytest.monkeypatch import MonkeyPatch
from _pytest.nodes import Collector from _pytest.nodes import Collector
from _pytest.nodes import Item from _pytest.nodes import Item
from _pytest.pathlib import make_numbered_dir from _pytest.pathlib import make_numbered_dir
from _pytest.pathlib import Path
from _pytest.python import Module from _pytest.python import Module
from _pytest.reports import CollectReport from _pytest.reports import CollectReport
from _pytest.reports import TestReport from _pytest.reports import TestReport

View File

@ -1,4 +1,5 @@
from io import StringIO from io import StringIO
from pathlib import Path
from pprint import pprint from pprint import pprint
from typing import Any from typing import Any
from typing import cast from typing import cast
@ -33,7 +34,6 @@ from _pytest.config import Config
from _pytest.nodes import Collector from _pytest.nodes import Collector
from _pytest.nodes import Item from _pytest.nodes import Item
from _pytest.outcomes import skip from _pytest.outcomes import skip
from _pytest.pathlib import Path
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import NoReturn from typing import NoReturn

View File

@ -9,6 +9,7 @@ import platform
import sys import sys
import warnings import warnings
from functools import partial from functools import partial
from pathlib import Path
from typing import Any from typing import Any
from typing import Callable from typing import Callable
from typing import Dict from typing import Dict
@ -43,7 +44,6 @@ from _pytest.nodes import Item
from _pytest.nodes import Node from _pytest.nodes import Node
from _pytest.pathlib import absolutepath from _pytest.pathlib import absolutepath
from _pytest.pathlib import bestrelpath from _pytest.pathlib import bestrelpath
from _pytest.pathlib import Path
from _pytest.reports import BaseReport from _pytest.reports import BaseReport
from _pytest.reports import CollectReport from _pytest.reports import CollectReport
from _pytest.reports import TestReport from _pytest.reports import TestReport

View File

@ -2,6 +2,7 @@
import os import os
import re import re
import tempfile import tempfile
from pathlib import Path
from typing import Optional from typing import Optional
import attr import attr
@ -12,7 +13,6 @@ from .pathlib import ensure_reset_dir
from .pathlib import LOCK_TIMEOUT from .pathlib import LOCK_TIMEOUT
from .pathlib import make_numbered_dir from .pathlib import make_numbered_dir
from .pathlib import make_numbered_dir_with_cleanup from .pathlib import make_numbered_dir_with_cleanup
from .pathlib import Path
from _pytest.compat import final from _pytest.compat import final
from _pytest.config import Config from _pytest.config import Config
from _pytest.fixtures import FixtureRequest from _pytest.fixtures import FixtureRequest

View File

@ -1,12 +1,12 @@
import sys import sys
import textwrap import textwrap
from pathlib import Path
import pytest import pytest
from _pytest import fixtures from _pytest import fixtures
from _pytest.compat import getfuncargnames from _pytest.compat import getfuncargnames
from _pytest.config import ExitCode from _pytest.config import ExitCode
from _pytest.fixtures import FixtureRequest from _pytest.fixtures import FixtureRequest
from _pytest.pathlib import Path
from _pytest.pytester import get_public_names from _pytest.pytester import get_public_names

View File

@ -9,6 +9,7 @@ import sys
import textwrap import textwrap
import zipfile import zipfile
from functools import partial from functools import partial
from pathlib import Path
from typing import Dict from typing import Dict
from typing import List from typing import List
from typing import Mapping from typing import Mapping
@ -28,7 +29,6 @@ from _pytest.assertion.rewrite import PYTEST_TAG
from _pytest.assertion.rewrite import rewrite_asserts from _pytest.assertion.rewrite import rewrite_asserts
from _pytest.config import ExitCode from _pytest.config import ExitCode
from _pytest.pathlib import make_numbered_dir from _pytest.pathlib import make_numbered_dir
from _pytest.pathlib import Path
from _pytest.pytester import Testdir from _pytest.pytester import Testdir

View File

@ -2,12 +2,12 @@ import os
import pprint import pprint
import sys import sys
import textwrap import textwrap
from pathlib import Path
import pytest import pytest
from _pytest.config import ExitCode from _pytest.config import ExitCode
from _pytest.main import _in_venv from _pytest.main import _in_venv
from _pytest.main import Session from _pytest.main import Session
from _pytest.pathlib import Path
from _pytest.pathlib import symlink_or_skip from _pytest.pathlib import symlink_or_skip
from _pytest.pytester import Testdir from _pytest.pytester import Testdir

View File

@ -2,6 +2,7 @@ import os
import re import re
import sys import sys
import textwrap import textwrap
from pathlib import Path
from typing import Dict from typing import Dict
from typing import List from typing import List
from typing import Sequence from typing import Sequence
@ -26,7 +27,6 @@ from _pytest.config.findpaths import determine_setup
from _pytest.config.findpaths import get_common_ancestor from _pytest.config.findpaths import get_common_ancestor
from _pytest.config.findpaths import locate_config from _pytest.config.findpaths import locate_config
from _pytest.monkeypatch import MonkeyPatch from _pytest.monkeypatch import MonkeyPatch
from _pytest.pathlib import Path
from _pytest.pytester import Testdir from _pytest.pytester import Testdir

View File

@ -1,12 +1,12 @@
import os import os
import textwrap import textwrap
from pathlib import Path
import py import py
import pytest import pytest
from _pytest.config import ExitCode from _pytest.config import ExitCode
from _pytest.config import PytestPluginManager from _pytest.config import PytestPluginManager
from _pytest.pathlib import Path
from _pytest.pathlib import symlink_or_skip from _pytest.pathlib import symlink_or_skip

View File

@ -1,10 +1,10 @@
from pathlib import Path
from textwrap import dedent from textwrap import dedent
import pytest import pytest
from _pytest.config.findpaths import get_common_ancestor from _pytest.config.findpaths import get_common_ancestor
from _pytest.config.findpaths import get_dirs_from_args from _pytest.config.findpaths import get_dirs_from_args
from _pytest.config.findpaths import load_config_dict_from_file from _pytest.config.findpaths import load_config_dict_from_file
from _pytest.pathlib import Path
class TestLoadConfigDictFromFile: class TestLoadConfigDictFromFile:

View File

@ -1,6 +1,7 @@
import os import os
import platform import platform
from datetime import datetime from datetime import datetime
from pathlib import Path
from typing import cast from typing import cast
from typing import List from typing import List
from typing import Tuple from typing import Tuple
@ -14,7 +15,6 @@ import pytest
from _pytest.config import Config from _pytest.config import Config
from _pytest.junitxml import bin_xml_escape from _pytest.junitxml import bin_xml_escape
from _pytest.junitxml import LogXML from _pytest.junitxml import LogXML
from _pytest.pathlib import Path
from _pytest.reports import BaseReport from _pytest.reports import BaseReport
from _pytest.reports import TestReport from _pytest.reports import TestReport
from _pytest.store import Store from _pytest.store import Store

View File

@ -1,6 +1,7 @@
import argparse import argparse
import os import os
import re import re
from pathlib import Path
from typing import Optional from typing import Optional
import py.path import py.path
@ -10,7 +11,6 @@ from _pytest.config import ExitCode
from _pytest.config import UsageError from _pytest.config import UsageError
from _pytest.main import resolve_collection_argument from _pytest.main import resolve_collection_argument
from _pytest.main import validate_basetemp from _pytest.main import validate_basetemp
from _pytest.pathlib import Path
from _pytest.pytester import Testdir from _pytest.pytester import Testdir

View File

@ -1,6 +1,7 @@
import os.path import os.path
import sys import sys
import unittest.mock import unittest.mock
from pathlib import Path
from textwrap import dedent from textwrap import dedent
import py import py
@ -15,7 +16,6 @@ from _pytest.pathlib import get_lock_path
from _pytest.pathlib import import_path from _pytest.pathlib import import_path
from _pytest.pathlib import ImportPathMismatchError from _pytest.pathlib import ImportPathMismatchError
from _pytest.pathlib import maybe_delete_a_numbered_dir from _pytest.pathlib import maybe_delete_a_numbered_dir
from _pytest.pathlib import Path
from _pytest.pathlib import resolve_package_path from _pytest.pathlib import resolve_package_path

View File

@ -1,4 +1,5 @@
import sys import sys
from pathlib import Path
from typing import Sequence from typing import Sequence
from typing import Union from typing import Union
@ -6,7 +7,6 @@ import pytest
from _pytest._code.code import ExceptionChainRepr from _pytest._code.code import ExceptionChainRepr
from _pytest._code.code import ExceptionRepr from _pytest._code.code import ExceptionRepr
from _pytest.config import Config from _pytest.config import Config
from _pytest.pathlib import Path
from _pytest.pytester import Testdir from _pytest.pytester import Testdir
from _pytest.reports import CollectReport from _pytest.reports import CollectReport
from _pytest.reports import TestReport from _pytest.reports import TestReport

View File

@ -4,6 +4,7 @@ import os
import sys import sys
import textwrap import textwrap
from io import StringIO from io import StringIO
from pathlib import Path
from typing import cast from typing import cast
from typing import Dict from typing import Dict
from typing import List from typing import List
@ -19,7 +20,6 @@ from _pytest._io.wcwidth import wcswidth
from _pytest.config import Config from _pytest.config import Config
from _pytest.config import ExitCode from _pytest.config import ExitCode
from _pytest.monkeypatch import MonkeyPatch from _pytest.monkeypatch import MonkeyPatch
from _pytest.pathlib import Path
from _pytest.pytester import Testdir from _pytest.pytester import Testdir
from _pytest.reports import BaseReport from _pytest.reports import BaseReport
from _pytest.reports import CollectReport from _pytest.reports import CollectReport

View File

@ -1,6 +1,7 @@
import os import os
import stat import stat
import sys import sys
from pathlib import Path
from typing import Callable from typing import Callable
from typing import cast from typing import cast
from typing import List from typing import List
@ -15,7 +16,6 @@ from _pytest.pathlib import create_cleanup_lock
from _pytest.pathlib import make_numbered_dir from _pytest.pathlib import make_numbered_dir
from _pytest.pathlib import maybe_delete_a_numbered_dir from _pytest.pathlib import maybe_delete_a_numbered_dir
from _pytest.pathlib import on_rm_rf_error from _pytest.pathlib import on_rm_rf_error
from _pytest.pathlib import Path
from _pytest.pathlib import register_cleanup_lock_removal from _pytest.pathlib import register_cleanup_lock_removal
from _pytest.pathlib import rm_rf from _pytest.pathlib import rm_rf
from _pytest.tmpdir import get_user from _pytest.tmpdir import get_user