mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
use _typeshed's Path aliases (#4214)
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
import sys
|
||||
|
||||
from typing import Optional, Sequence, Text, Union, AnyStr
|
||||
from _typeshed import AnyPath
|
||||
from typing import Optional, Sequence, Text
|
||||
from types import SimpleNamespace
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from builtins import _PathLike
|
||||
_Path = Union[str, bytes, _PathLike[str], _PathLike[bytes]]
|
||||
else:
|
||||
_Path = Union[str, bytes]
|
||||
|
||||
class EnvBuilder:
|
||||
system_site_packages: bool
|
||||
clear: bool
|
||||
@@ -24,11 +18,11 @@ class EnvBuilder:
|
||||
def __init__(self, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., upgrade: bool = ..., with_pip: bool = ..., prompt: Optional[str] = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., upgrade: bool = ..., with_pip: bool = ...) -> None: ...
|
||||
def create(self, env_dir: _Path) -> None: ...
|
||||
def clear_directory(self, path: _Path) -> None: ... # undocumented
|
||||
def ensure_directories(self, env_dir: _Path) -> SimpleNamespace: ...
|
||||
def create(self, env_dir: AnyPath) -> None: ...
|
||||
def clear_directory(self, path: AnyPath) -> None: ... # undocumented
|
||||
def ensure_directories(self, env_dir: AnyPath) -> SimpleNamespace: ...
|
||||
def create_configuration(self, context: SimpleNamespace) -> None: ...
|
||||
def symlink_or_copy(self, src: _Path, dst: _Path, relative_symlinks_ok: bool = ...) -> None: ... # undocumented
|
||||
def symlink_or_copy(self, src: AnyPath, dst: AnyPath, relative_symlinks_ok: bool = ...) -> None: ... # undocumented
|
||||
def setup_python(self, context: SimpleNamespace) -> None: ...
|
||||
def _setup_pip(self, context: SimpleNamespace) -> None: ... # undocumented
|
||||
def setup_scripts(self, context: SimpleNamespace) -> None: ...
|
||||
@@ -39,10 +33,10 @@ class EnvBuilder:
|
||||
def upgrade_dependencies(self, context: SimpleNamespace) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def create(env_dir: _Path, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., with_pip: bool = ..., prompt: Optional[str] = ..., upgrade_deps: bool = ...) -> None: ...
|
||||
def create(env_dir: AnyPath, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., with_pip: bool = ..., prompt: Optional[str] = ..., upgrade_deps: bool = ...) -> None: ...
|
||||
elif sys.version_info >= (3, 6):
|
||||
def create(env_dir: _Path, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., with_pip: bool = ..., prompt: Optional[str] = ...) -> None: ...
|
||||
def create(env_dir: AnyPath, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., with_pip: bool = ..., prompt: Optional[str] = ...) -> None: ...
|
||||
else:
|
||||
def create(env_dir: _Path, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., with_pip: bool = ...) -> None: ...
|
||||
def create(env_dir: AnyPath, system_site_packages: bool = ..., clear: bool = ..., symlinks: bool = ..., with_pip: bool = ...) -> None: ...
|
||||
|
||||
def main(args: Optional[Sequence[Text]] = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user