Commit b9334439 by David Hotham Committed by GitHub

Misc tidying (#7673)

* correct logger for publisher
* build 0.10.0 to get metadata in PackageInfo
* prefer pathlib
* passwords must be strings
parent 7687539d
...@@ -211,6 +211,7 @@ To remove a repository (repo is a short alias for repositories): ...@@ -211,6 +211,7 @@ To remove a repository (repo is a short alias for repositories):
username = values[0] username = values[0]
# Only username, so we prompt for password # Only username, so we prompt for password
password = self.secret("Password:") password = self.secret("Password:")
assert isinstance(password, str)
elif len(values) != 2: elif len(values) != 2:
raise ValueError( raise ValueError(
"Expected one or two arguments " "Expected one or two arguments "
......
...@@ -44,7 +44,7 @@ The --repository option should match the name of a configured repository using ...@@ -44,7 +44,7 @@ The --repository option should match the name of a configured repository using
the config command. the config command.
""" """
loggers = ["poetry.masonry.publishing.publisher"] loggers = ["poetry.publishing.publisher"]
def handle(self) -> int: def handle(self) -> int:
from poetry.publishing.publisher import Publisher from poetry.publishing.publisher import Publisher
......
...@@ -58,11 +58,11 @@ with build.env.IsolatedEnvBuilder() as env: ...@@ -58,11 +58,11 @@ with build.env.IsolatedEnvBuilder() as env:
builder.metadata_path(dest) builder.metadata_path(dest)
""" """
PEP517_META_BUILD_DEPS = ["build==0.9.0", "pyproject_hooks==1.0.0"] PEP517_META_BUILD_DEPS = ["build==0.10.0", "pyproject_hooks==1.0.0"]
class PackageInfoError(ValueError): class PackageInfoError(ValueError):
def __init__(self, path: Path | str, *reasons: BaseException | str) -> None: def __init__(self, path: Path, *reasons: BaseException | str) -> None:
reasons = (f"Unable to determine package info for path: {path!s}",) + reasons reasons = (f"Unable to determine package info for path: {path!s}",) + reasons
super().__init__("\n\n".join(str(msg).strip() for msg in reasons if msg)) super().__init__("\n\n".join(str(msg).strip() for msg in reasons if msg))
...@@ -617,7 +617,7 @@ def get_pep517_metadata(path: Path) -> PackageInfo: ...@@ -617,7 +617,7 @@ def get_pep517_metadata(path: Path) -> PackageInfo:
) )
cwd = Path.cwd() cwd = Path.cwd()
os.chdir(path.as_posix()) os.chdir(path)
try: try:
venv.run("python", "setup.py", "egg_info") venv.run("python", "setup.py", "egg_info")
info = PackageInfo.from_metadata(path) info = PackageInfo.from_metadata(path)
...@@ -626,7 +626,7 @@ def get_pep517_metadata(path: Path) -> PackageInfo: ...@@ -626,7 +626,7 @@ def get_pep517_metadata(path: Path) -> PackageInfo:
path, "Fallback egg_info generation failed.", fbe path, "Fallback egg_info generation failed.", fbe
) )
finally: finally:
os.chdir(cwd.as_posix()) os.chdir(cwd)
if info: if info:
logger.debug("Falling back to parsed setup.py file for %s", path) logger.debug("Falling back to parsed setup.py file for %s", path)
......
...@@ -650,7 +650,7 @@ class Executor: ...@@ -650,7 +650,7 @@ class Executor:
if package.source_subdirectory: if package.source_subdirectory:
req /= package.source_subdirectory req /= package.source_subdirectory
pyproject = PyProjectTOML(os.path.join(req, "pyproject.toml")) pyproject = PyProjectTOML(req / "pyproject.toml")
package_poetry = None package_poetry = None
if pyproject.is_poetry_project(): if pyproject.is_poetry_project():
......
...@@ -221,7 +221,7 @@ class PipInstaller(BaseInstaller): ...@@ -221,7 +221,7 @@ class PipInstaller(BaseInstaller):
if package.source_subdirectory: if package.source_subdirectory:
req /= package.source_subdirectory req /= package.source_subdirectory
pyproject = PyProjectTOML(os.path.join(req, "pyproject.toml")) pyproject = PyProjectTOML(req / "pyproject.toml")
package_poetry = None package_poetry = None
if pyproject.is_poetry_project(): if pyproject.is_poetry_project():
......
...@@ -31,7 +31,7 @@ class WheelDestination(SchemeDictionaryDestination): ...@@ -31,7 +31,7 @@ class WheelDestination(SchemeDictionaryDestination):
def write_to_fs( def write_to_fs(
self, self,
scheme: Scheme, scheme: Scheme,
path: Path | str, path: str,
stream: BinaryIO, stream: BinaryIO,
is_executable: bool, is_executable: bool,
) -> RecordEntry: ) -> RecordEntry:
...@@ -58,7 +58,7 @@ class WheelDestination(SchemeDictionaryDestination): ...@@ -58,7 +58,7 @@ class WheelDestination(SchemeDictionaryDestination):
if is_executable: if is_executable:
make_file_executable(target_path) make_file_executable(target_path)
return RecordEntry(str(path), Hash(self.hash_algorithm, hash_), size) return RecordEntry(path, Hash(self.hash_algorithm, hash_), size)
def for_source(self, source: WheelFile) -> WheelDestination: def for_source(self, source: WheelFile) -> WheelDestination:
scheme_dict = self.scheme_dict.copy() scheme_dict = self.scheme_dict.copy()
...@@ -90,7 +90,7 @@ class WheelInstaller: ...@@ -90,7 +90,7 @@ class WheelInstaller:
schemes["headers"] = schemes["include"] schemes["headers"] = schemes["include"]
self._destination = WheelDestination( self._destination = WheelDestination(
schemes, interpreter=self._env.python, script_kind=script_kind schemes, interpreter=str(self._env.python), script_kind=script_kind
) )
def enable_bytecode_compilation(self, enable: bool = True) -> None: def enable_bytecode_compilation(self, enable: bool = True) -> None:
......
...@@ -53,8 +53,8 @@ class Locker: ...@@ -53,8 +53,8 @@ class Locker:
_legacy_keys = ["dependencies", "source", "extras", "dev-dependencies"] _legacy_keys = ["dependencies", "source", "extras", "dev-dependencies"]
_relevant_keys = [*_legacy_keys, "group"] _relevant_keys = [*_legacy_keys, "group"]
def __init__(self, lock: str | Path, local_config: dict[str, Any]) -> None: def __init__(self, lock: Path, local_config: dict[str, Any]) -> None:
self._lock = lock if isinstance(lock, Path) else Path(lock) self._lock = lock
self._local_config = local_config self._local_config = local_config
self._lock_data: dict[str, Any] | None = None self._lock_data: dict[str, Any] | None = None
self._content_hash = self._get_content_hash() self._content_hash = self._get_content_hash()
......
...@@ -290,9 +290,8 @@ class ArtifactCache: ...@@ -290,9 +290,8 @@ class ArtifactCache:
cache_dir = self.get_cache_directory_for_link(link) cache_dir = self.get_cache_directory_for_link(link)
archive_types = ["whl", "tar.gz", "tar.bz2", "bz2", "zip"] archive_types = ["whl", "tar.gz", "tar.bz2", "bz2", "zip"]
paths = [] paths: list[Path] = []
for archive_type in archive_types: for archive_type in archive_types:
for archive in cache_dir.glob(f"*.{archive_type}"): paths += cache_dir.glob(f"*.{archive_type}")
paths.append(Path(archive))
return paths return paths
...@@ -65,7 +65,7 @@ def _on_rm_error(func: Callable[[str], None], path: str, exc_info: Exception) -> ...@@ -65,7 +65,7 @@ def _on_rm_error(func: Callable[[str], None], path: str, exc_info: Exception) ->
def remove_directory( def remove_directory(
path: Path | str, *args: Any, force: bool = False, **kwargs: Any path: Path, *args: Any, force: bool = False, **kwargs: Any
) -> None: ) -> None:
""" """
Helper function handle safe removal, and optionally forces stubborn file removal. Helper function handle safe removal, and optionally forces stubborn file removal.
...@@ -74,8 +74,8 @@ def remove_directory( ...@@ -74,8 +74,8 @@ def remove_directory(
Internally, all arguments are passed to `shutil.rmtree`. Internally, all arguments are passed to `shutil.rmtree`.
""" """
if Path(path).is_symlink(): if path.is_symlink():
return os.unlink(str(path)) return os.unlink(path)
kwargs["onerror"] = kwargs.pop("onerror", _on_rm_error if force else None) kwargs["onerror"] = kwargs.pop("onerror", _on_rm_error if force else None)
shutil.rmtree(path, *args, **kwargs) shutil.rmtree(path, *args, **kwargs)
...@@ -239,7 +239,7 @@ def get_win_folder(csidl_name: str) -> Path: ...@@ -239,7 +239,7 @@ def get_win_folder(csidl_name: str) -> Path:
raise RuntimeError("Method can only be called on Windows.") raise RuntimeError("Method can only be called on Windows.")
def get_real_windows_path(path: str | Path) -> Path: def get_real_windows_path(path: Path) -> Path:
program_files = get_win_folder("CSIDL_PROGRAM_FILES") program_files = get_win_folder("CSIDL_PROGRAM_FILES")
local_appdata = get_win_folder("CSIDL_LOCAL_APPDATA") local_appdata = get_win_folder("CSIDL_LOCAL_APPDATA")
......
...@@ -3,12 +3,16 @@ from __future__ import annotations ...@@ -3,12 +3,16 @@ from __future__ import annotations
import ast import ast
from configparser import ConfigParser from configparser import ConfigParser
from pathlib import Path from typing import TYPE_CHECKING
from typing import Any from typing import Any
from poetry.core.constraints.version import Version from poetry.core.constraints.version import Version
if TYPE_CHECKING:
from pathlib import Path
class SetupReader: class SetupReader:
""" """
Class that reads a setup.py file without executing it. Class that reads a setup.py file without executing it.
...@@ -25,10 +29,7 @@ class SetupReader: ...@@ -25,10 +29,7 @@ class SetupReader:
FILES = ["setup.py", "setup.cfg"] FILES = ["setup.py", "setup.cfg"]
@classmethod @classmethod
def read_from_directory(cls, directory: str | Path) -> dict[str, Any]: def read_from_directory(cls, directory: Path) -> dict[str, Any]:
if isinstance(directory, str):
directory = Path(directory)
result = cls.DEFAULT.copy() result = cls.DEFAULT.copy()
for filename in cls.FILES: for filename in cls.FILES:
filepath = directory / filename filepath = directory / filename
...@@ -44,10 +45,7 @@ class SetupReader: ...@@ -44,10 +45,7 @@ class SetupReader:
return result return result
def read_setup_py(self, filepath: str | Path) -> dict[str, Any]: def read_setup_py(self, filepath: Path) -> dict[str, Any]:
if isinstance(filepath, str):
filepath = Path(filepath)
with filepath.open(encoding="utf-8") as f: with filepath.open(encoding="utf-8") as f:
content = f.read() content = f.read()
...@@ -71,7 +69,7 @@ class SetupReader: ...@@ -71,7 +69,7 @@ class SetupReader:
return result return result
def read_setup_cfg(self, filepath: str | Path) -> dict[str, Any]: def read_setup_cfg(self, filepath: Path) -> dict[str, Any]:
parser = ConfigParser() parser = ConfigParser()
parser.read(str(filepath)) parser.read(str(filepath))
......
...@@ -137,11 +137,11 @@ class GitRefSpec: ...@@ -137,11 +137,11 @@ class GitRefSpec:
@dataclasses.dataclass @dataclasses.dataclass
class GitRepoLocalInfo: class GitRepoLocalInfo:
repo: dataclasses.InitVar[Repo | Path | str] repo: dataclasses.InitVar[Repo | Path]
origin: str = dataclasses.field(init=False) origin: str = dataclasses.field(init=False)
revision: str = dataclasses.field(init=False) revision: str = dataclasses.field(init=False)
def __post_init__(self, repo: Repo | Path | str) -> None: def __post_init__(self, repo: Repo | Path) -> None:
repo = Git.as_repo(repo=repo) if not isinstance(repo, Repo) else repo repo = Git.as_repo(repo=repo) if not isinstance(repo, Repo) else repo
self.origin = Git.get_remote_url(repo=repo, remote="origin") self.origin = Git.get_remote_url(repo=repo, remote="origin")
self.revision = Git.get_revision(repo=repo) self.revision = Git.get_revision(repo=repo)
...@@ -149,7 +149,7 @@ class GitRepoLocalInfo: ...@@ -149,7 +149,7 @@ class GitRepoLocalInfo:
class Git: class Git:
@staticmethod @staticmethod
def as_repo(repo: Path | str) -> Repo: def as_repo(repo: Path) -> Repo:
return Repo(str(repo)) return Repo(str(repo))
@staticmethod @staticmethod
...@@ -171,7 +171,7 @@ class Git: ...@@ -171,7 +171,7 @@ class Git:
return repo.head().decode("utf-8") return repo.head().decode("utf-8")
@classmethod @classmethod
def info(cls, repo: Repo | Path | str) -> GitRepoLocalInfo: def info(cls, repo: Repo | Path) -> GitRepoLocalInfo:
return GitRepoLocalInfo(repo=repo) return GitRepoLocalInfo(repo=repo)
@staticmethod @staticmethod
...@@ -302,7 +302,7 @@ class Git: ...@@ -302,7 +302,7 @@ class Git:
), ),
local.path, local.path,
) )
remove_directory(local.path, force=True) remove_directory(Path(local.path), force=True)
if isinstance(e, AssertionError) and "Invalid object name" not in str(e): if isinstance(e, AssertionError) and "Invalid object name" not in str(e):
raise raise
......
...@@ -295,10 +295,11 @@ def fixture_dir(fixture_base: Path) -> FixtureDirGetter: ...@@ -295,10 +295,11 @@ def fixture_dir(fixture_base: Path) -> FixtureDirGetter:
@pytest.fixture @pytest.fixture
def tmp_dir() -> Iterator[str]: def tmp_dir() -> Iterator[str]:
dir_ = tempfile.mkdtemp(prefix="poetry_") dir_ = tempfile.mkdtemp(prefix="poetry_")
path = Path(dir_)
yield Path(dir_).resolve().as_posix() yield path.resolve().as_posix()
remove_directory(dir_, force=True) remove_directory(path, force=True)
@pytest.fixture @pytest.fixture
......
...@@ -55,7 +55,7 @@ def test_activate_activates_non_existing_virtualenv_no_envs_file( ...@@ -55,7 +55,7 @@ def test_activate_activates_non_existing_virtualenv_no_envs_file(
venv_cache: Path, venv_cache: Path,
venv_name: str, venv_name: str,
venvs_in_cache_config: None, venvs_in_cache_config: None,
): ) -> None:
mocker.patch( mocker.patch(
"subprocess.check_output", "subprocess.check_output",
side_effect=check_output_wrapper(), side_effect=check_output_wrapper(),
...@@ -70,7 +70,7 @@ def test_activate_activates_non_existing_virtualenv_no_envs_file( ...@@ -70,7 +70,7 @@ def test_activate_activates_non_existing_virtualenv_no_envs_file(
venv_py37 = venv_cache / f"{venv_name}-py3.7" venv_py37 = venv_cache / f"{venv_name}-py3.7"
mock_build_env.assert_called_with( mock_build_env.assert_called_with(
venv_py37, venv_py37,
executable="/usr/bin/python3.7", executable=Path("/usr/bin/python3.7"),
flags={ flags={
"always-copy": False, "always-copy": False,
"system-site-packages": False, "system-site-packages": False,
...@@ -99,7 +99,7 @@ def test_get_prefers_explicitly_activated_virtualenvs_over_env_var( ...@@ -99,7 +99,7 @@ def test_get_prefers_explicitly_activated_virtualenvs_over_env_var(
venv_cache: Path, venv_cache: Path,
venv_name: str, venv_name: str,
venvs_in_cache_config: None, venvs_in_cache_config: None,
): ) -> None:
os.environ["VIRTUAL_ENV"] = "/environment/prefix" os.environ["VIRTUAL_ENV"] = "/environment/prefix"
python_minor = ".".join(str(v) for v in current_python[:2]) python_minor = ".".join(str(v) for v in current_python[:2])
...@@ -128,7 +128,7 @@ def test_get_prefers_explicitly_activated_non_existing_virtualenvs_over_env_var( ...@@ -128,7 +128,7 @@ def test_get_prefers_explicitly_activated_non_existing_virtualenvs_over_env_var(
venv_cache: Path, venv_cache: Path,
venv_name: str, venv_name: str,
venvs_in_cache_config: None, venvs_in_cache_config: None,
): ) -> None:
os.environ["VIRTUAL_ENV"] = "/environment/prefix" os.environ["VIRTUAL_ENV"] = "/environment/prefix"
python_minor = ".".join(str(v) for v in current_python[:2]) python_minor = ".".join(str(v) for v in current_python[:2])
......
...@@ -36,11 +36,10 @@ if TYPE_CHECKING: ...@@ -36,11 +36,10 @@ if TYPE_CHECKING:
@pytest.fixture @pytest.fixture
def source_dir(tmp_path: Path) -> Iterator[Path]: def source_dir(tmp_path: Path) -> Iterator[Path]:
cwd = os.getcwd() cwd = Path.cwd()
try: try:
os.chdir(str(tmp_path)) os.chdir(tmp_path)
yield Path(tmp_path.as_posix()) yield tmp_path
finally: finally:
os.chdir(cwd) os.chdir(cwd)
......
...@@ -67,7 +67,7 @@ def installer(pool: RepositoryPool, env: NullEnv) -> PipInstaller: ...@@ -67,7 +67,7 @@ def installer(pool: RepositoryPool, env: NullEnv) -> PipInstaller:
return PipInstaller(env, NullIO(), pool) return PipInstaller(env, NullIO(), pool)
def test_requirement(installer: PipInstaller): def test_requirement(installer: PipInstaller) -> None:
package = Package("ipython", "7.5.0") package = Package("ipython", "7.5.0")
package.files = [ package.files = [
{"file": "foo-0.1.0.tar.gz", "hash": "md5:dbdc53e3918f28fa335a173432402a00"}, {"file": "foo-0.1.0.tar.gz", "hash": "md5:dbdc53e3918f28fa335a173432402a00"},
...@@ -88,7 +88,7 @@ def test_requirement(installer: PipInstaller): ...@@ -88,7 +88,7 @@ def test_requirement(installer: PipInstaller):
assert result == expected assert result == expected
def test_requirement_source_type_url(env: NullEnv): def test_requirement_source_type_url(env: NullEnv) -> None:
installer = PipInstaller(env, NullIO(), RepositoryPool()) installer = PipInstaller(env, NullIO(), RepositoryPool())
foo = Package( foo = Package(
...@@ -121,7 +121,9 @@ def test_requirement_git_subdirectory( ...@@ -121,7 +121,9 @@ def test_requirement_git_subdirectory(
assert Path(cmd[-1]).parts[-3:] == ("demo", "subdirectories", "two") assert Path(cmd[-1]).parts[-3:] == ("demo", "subdirectories", "two")
def test_requirement_git_develop_false(installer: PipInstaller, package_git: Package): def test_requirement_git_develop_false(
installer: PipInstaller, package_git: Package
) -> None:
package_git.develop = False package_git.develop = False
result = installer.requirement(package_git) result = installer.requirement(package_git)
expected = "git+git@github.com:demo/demo.git@master#egg=demo" expected = "git+git@github.com:demo/demo.git@master#egg=demo"
...@@ -131,7 +133,7 @@ def test_requirement_git_develop_false(installer: PipInstaller, package_git: Pac ...@@ -131,7 +133,7 @@ def test_requirement_git_develop_false(installer: PipInstaller, package_git: Pac
def test_install_with_non_pypi_default_repository( def test_install_with_non_pypi_default_repository(
pool: RepositoryPool, installer: PipInstaller pool: RepositoryPool, installer: PipInstaller
): ) -> None:
default = LegacyRepository("default", "https://default.com") default = LegacyRepository("default", "https://default.com")
another = LegacyRepository("another", "https://another.com") another = LegacyRepository("another", "https://another.com")
...@@ -164,7 +166,9 @@ def test_install_with_non_pypi_default_repository( ...@@ -164,7 +166,9 @@ def test_install_with_non_pypi_default_repository(
("cert", "cert"), ("cert", "cert"),
], ],
) )
def test_install_with_certs(mocker: MockerFixture, key: str, option: str, env: NullEnv): def test_install_with_certs(
mocker: MockerFixture, key: str, option: str, env: NullEnv
) -> None:
client_path = "path/to/client.pem" client_path = "path/to/client.pem"
mocker.patch( mocker.patch(
"poetry.utils.authenticator.Authenticator.get_certs_for_url", "poetry.utils.authenticator.Authenticator.get_certs_for_url",
...@@ -195,7 +199,9 @@ def test_install_with_certs(mocker: MockerFixture, key: str, option: str, env: N ...@@ -195,7 +199,9 @@ def test_install_with_certs(mocker: MockerFixture, key: str, option: str, env: N
assert cmd[cert_index + 1] == str(Path(client_path)) assert cmd[cert_index + 1] == str(Path(client_path))
def test_requirement_git_develop_true(installer: PipInstaller, package_git: Package): def test_requirement_git_develop_true(
installer: PipInstaller, package_git: Package
) -> None:
package_git.develop = True package_git.develop = True
result = installer.requirement(package_git) result = installer.requirement(package_git)
expected = ["-e", "git+git@github.com:demo/demo.git@master#egg=demo"] expected = ["-e", "git+git@github.com:demo/demo.git@master#egg=demo"]
...@@ -205,7 +211,7 @@ def test_requirement_git_develop_true(installer: PipInstaller, package_git: Pack ...@@ -205,7 +211,7 @@ def test_requirement_git_develop_true(installer: PipInstaller, package_git: Pack
def test_uninstall_git_package_nspkg_pth_cleanup( def test_uninstall_git_package_nspkg_pth_cleanup(
mocker: MockerFixture, tmp_venv: VirtualEnv, pool: RepositoryPool mocker: MockerFixture, tmp_venv: VirtualEnv, pool: RepositoryPool
): ) -> None:
# this test scenario requires a real installation using the pip installer # this test scenario requires a real installation using the pip installer
installer = PipInstaller(tmp_venv, NullIO(), pool) installer = PipInstaller(tmp_venv, NullIO(), pool)
...@@ -236,7 +242,7 @@ def test_uninstall_git_package_nspkg_pth_cleanup( ...@@ -236,7 +242,7 @@ def test_uninstall_git_package_nspkg_pth_cleanup(
installer.install(package) installer.install(package)
installer.remove(package) installer.remove(package)
pth_file = f"{package.name}-nspkg.pth" pth_file = Path(f"{package.name}-nspkg.pth")
assert not tmp_venv.site_packages.exists(pth_file) assert not tmp_venv.site_packages.exists(pth_file)
# any command in the virtual environment should trigger the error message # any command in the virtual environment should trigger the error message
...@@ -244,7 +250,7 @@ def test_uninstall_git_package_nspkg_pth_cleanup( ...@@ -244,7 +250,7 @@ def test_uninstall_git_package_nspkg_pth_cleanup(
assert not re.match(rf"Error processing line 1 of .*{pth_file}", output) assert not re.match(rf"Error processing line 1 of .*{pth_file}", output)
def test_install_with_trusted_host(config: Config, env: NullEnv): def test_install_with_trusted_host(config: Config, env: NullEnv) -> None:
config.merge({"certificates": {"default": {"cert": False}}}) config.merge({"certificates": {"default": {"cert": False}}})
default = LegacyRepository("default", "https://foo.bar") default = LegacyRepository("default", "https://foo.bar")
...@@ -272,7 +278,7 @@ def test_install_with_trusted_host(config: Config, env: NullEnv): ...@@ -272,7 +278,7 @@ def test_install_with_trusted_host(config: Config, env: NullEnv):
def test_install_directory_fallback_on_poetry_create_error( def test_install_directory_fallback_on_poetry_create_error(
mocker: MockerFixture, tmp_venv: VirtualEnv, pool: RepositoryPool mocker: MockerFixture, tmp_venv: VirtualEnv, pool: RepositoryPool
): ) -> None:
mock_create_poetry = mocker.patch( mock_create_poetry = mocker.patch(
"poetry.factory.Factory.create_poetry", side_effect=RuntimeError "poetry.factory.Factory.create_poetry", side_effect=RuntimeError
) )
......
...@@ -86,7 +86,7 @@ def env_manager(simple_poetry: Poetry) -> EnvManager: ...@@ -86,7 +86,7 @@ def env_manager(simple_poetry: Poetry) -> EnvManager:
def tmp_venv(tmp_dir: str, env_manager: EnvManager) -> VirtualEnv: def tmp_venv(tmp_dir: str, env_manager: EnvManager) -> VirtualEnv:
venv_path = Path(tmp_dir) / "venv" venv_path = Path(tmp_dir) / "venv"
env_manager.build_venv(str(venv_path)) env_manager.build_venv(venv_path)
venv = VirtualEnv(venv_path) venv = VirtualEnv(venv_path)
yield venv yield venv
...@@ -96,20 +96,20 @@ def tmp_venv(tmp_dir: str, env_manager: EnvManager) -> VirtualEnv: ...@@ -96,20 +96,20 @@ def tmp_venv(tmp_dir: str, env_manager: EnvManager) -> VirtualEnv:
def test_builder_installs_proper_files_for_standard_packages( def test_builder_installs_proper_files_for_standard_packages(
simple_poetry: Poetry, tmp_venv: VirtualEnv simple_poetry: Poetry, tmp_venv: VirtualEnv
): ) -> None:
builder = EditableBuilder(simple_poetry, tmp_venv, NullIO()) builder = EditableBuilder(simple_poetry, tmp_venv, NullIO())
builder.build() builder.build()
assert tmp_venv._bin_dir.joinpath("foo").exists() assert tmp_venv._bin_dir.joinpath("foo").exists()
pth_file = "simple_project.pth" pth_file = Path("simple_project.pth")
assert tmp_venv.site_packages.exists(pth_file) assert tmp_venv.site_packages.exists(pth_file)
assert ( assert (
simple_poetry.file.parent.resolve().as_posix() simple_poetry.file.parent.resolve().as_posix()
== tmp_venv.site_packages.find(pth_file)[0].read_text().strip(os.linesep) == tmp_venv.site_packages.find(pth_file)[0].read_text().strip(os.linesep)
) )
dist_info = "simple_project-1.2.3.dist-info" dist_info = Path("simple_project-1.2.3.dist-info")
assert tmp_venv.site_packages.exists(dist_info) assert tmp_venv.site_packages.exists(dist_info)
dist_info = tmp_venv.site_packages.find(dist_info)[0] dist_info = tmp_venv.site_packages.find(dist_info)[0]
...@@ -176,7 +176,7 @@ My Package ...@@ -176,7 +176,7 @@ My Package
assert all(len(row) == 3 for row in records) assert all(len(row) == 3 for row in records)
record_entries = {row[0] for row in records} record_entries = {row[0] for row in records}
pth_file = "simple_project.pth" pth_file = Path("simple_project.pth")
assert tmp_venv.site_packages.exists(pth_file) assert tmp_venv.site_packages.exists(pth_file)
assert str(tmp_venv.site_packages.find(pth_file)[0]) in record_entries assert str(tmp_venv.site_packages.find(pth_file)[0]) in record_entries
assert str(tmp_venv._bin_dir.joinpath("foo")) in record_entries assert str(tmp_venv._bin_dir.joinpath("foo")) in record_entries
...@@ -223,7 +223,7 @@ if __name__ == '__main__': ...@@ -223,7 +223,7 @@ if __name__ == '__main__':
def test_builder_falls_back_on_setup_and_pip_for_packages_with_build_scripts( def test_builder_falls_back_on_setup_and_pip_for_packages_with_build_scripts(
mocker: MockerFixture, extended_poetry: Poetry, tmp_dir: str mocker: MockerFixture, extended_poetry: Poetry, tmp_dir: str
): ) -> None:
pip_install = mocker.patch("poetry.masonry.builders.editable.pip_install") pip_install = mocker.patch("poetry.masonry.builders.editable.pip_install")
env = MockEnv(path=Path(tmp_dir) / "foo") env = MockEnv(path=Path(tmp_dir) / "foo")
builder = EditableBuilder(extended_poetry, env, NullIO()) builder = EditableBuilder(extended_poetry, env, NullIO())
...@@ -273,11 +273,11 @@ def test_builder_setup_generation_runs_with_pip_editable(tmp_dir: str) -> None: ...@@ -273,11 +273,11 @@ def test_builder_setup_generation_runs_with_pip_editable(tmp_dir: str) -> None:
def test_builder_installs_proper_files_when_packages_configured( def test_builder_installs_proper_files_when_packages_configured(
project_with_include: Poetry, tmp_venv: VirtualEnv project_with_include: Poetry, tmp_venv: VirtualEnv
): ) -> None:
builder = EditableBuilder(project_with_include, tmp_venv, NullIO()) builder = EditableBuilder(project_with_include, tmp_venv, NullIO())
builder.build() builder.build()
pth_file = "with_include.pth" pth_file = Path("with_include.pth")
assert tmp_venv.site_packages.exists(pth_file) assert tmp_venv.site_packages.exists(pth_file)
pth_file = tmp_venv.site_packages.find(pth_file)[0] pth_file = tmp_venv.site_packages.find(pth_file)[0]
...@@ -298,12 +298,12 @@ def test_builder_installs_proper_files_when_packages_configured( ...@@ -298,12 +298,12 @@ def test_builder_installs_proper_files_when_packages_configured(
def test_builder_generates_proper_metadata_when_multiple_readme_files( def test_builder_generates_proper_metadata_when_multiple_readme_files(
with_multiple_readme_files: Poetry, tmp_venv: VirtualEnv with_multiple_readme_files: Poetry, tmp_venv: VirtualEnv
): ) -> None:
builder = EditableBuilder(with_multiple_readme_files, tmp_venv, NullIO()) builder = EditableBuilder(with_multiple_readme_files, tmp_venv, NullIO())
builder.build() builder.build()
dist_info = "my_package-0.1.dist-info" dist_info = Path("my_package-0.1.dist-info")
assert tmp_venv.site_packages.exists(dist_info) assert tmp_venv.site_packages.exists(dist_info)
dist_info = tmp_venv.site_packages.find(dist_info)[0] dist_info = tmp_venv.site_packages.find(dist_info)[0]
...@@ -336,7 +336,7 @@ Changelog ...@@ -336,7 +336,7 @@ Changelog
def test_builder_should_execute_build_scripts( def test_builder_should_execute_build_scripts(
mocker: MockerFixture, extended_without_setup_poetry: Poetry, tmp_path: Path mocker: MockerFixture, extended_without_setup_poetry: Poetry, tmp_path: Path
): ) -> None:
env = MockEnv(path=tmp_path / "foo") env = MockEnv(path=tmp_path / "foo")
mocker.patch( mocker.patch(
"poetry.masonry.builders.editable.build_environment" "poetry.masonry.builders.editable.build_environment"
......
...@@ -34,7 +34,7 @@ if TYPE_CHECKING: ...@@ -34,7 +34,7 @@ if TYPE_CHECKING:
def locker() -> Locker: def locker() -> Locker:
with tempfile.NamedTemporaryFile() as f: with tempfile.NamedTemporaryFile() as f:
f.close() f.close()
locker = Locker(f.name, {}) locker = Locker(Path(f.name), {})
return locker return locker
...@@ -44,7 +44,7 @@ def root() -> ProjectPackage: ...@@ -44,7 +44,7 @@ def root() -> ProjectPackage:
return ProjectPackage("root", "1.2.3") return ProjectPackage("root", "1.2.3")
def test_lock_file_data_is_ordered(locker: Locker, root: ProjectPackage): def test_lock_file_data_is_ordered(locker: Locker, root: ProjectPackage) -> None:
package_a = get_package("A", "1.0.0") package_a = get_package("A", "1.0.0")
package_a.add_dependency(Factory.create_dependency("B", "^1.0")) package_a.add_dependency(Factory.create_dependency("B", "^1.0"))
package_a.files = [{"file": "foo", "hash": "456"}, {"file": "bar", "hash": "123"}] package_a.files = [{"file": "foo", "hash": "456"}, {"file": "bar", "hash": "123"}]
...@@ -200,7 +200,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -200,7 +200,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
assert content == expected assert content == expected
def test_locker_properly_loads_extras(locker: Locker): def test_locker_properly_loads_extras(locker: Locker) -> None:
content = f"""\ content = f"""\
# {GENERATED_COMMENT} # {GENERATED_COMMENT}
...@@ -246,7 +246,7 @@ content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77 ...@@ -246,7 +246,7 @@ content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77
assert lockfile_dep.name == "lockfile" assert lockfile_dep.name == "lockfile"
def test_locker_properly_loads_nested_extras(locker: Locker): def test_locker_properly_loads_nested_extras(locker: Locker) -> None:
content = f"""\ content = f"""\
# {GENERATED_COMMENT} # {GENERATED_COMMENT}
...@@ -327,7 +327,7 @@ content-hash = "123456789" ...@@ -327,7 +327,7 @@ content-hash = "123456789"
assert len(packages) == 1 assert len(packages) == 1
def test_locker_properly_loads_extras_legacy(locker: Locker): def test_locker_properly_loads_extras_legacy(locker: Locker) -> None:
content = f"""\ content = f"""\
# {GENERATED_COMMENT} # {GENERATED_COMMENT}
...@@ -530,7 +530,9 @@ demo = [ ...@@ -530,7 +530,9 @@ demo = [
package.files = [] package.files = []
def test_lock_packages_with_null_description(locker: Locker, root: ProjectPackage): def test_lock_packages_with_null_description(
locker: Locker, root: ProjectPackage
) -> None:
package_a = get_package("A", "1.0.0") package_a = get_package("A", "1.0.0")
package_a.description = None package_a.description = None
...@@ -560,7 +562,9 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -560,7 +562,9 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
assert content == expected assert content == expected
def test_lock_file_should_not_have_mixed_types(locker: Locker, root: ProjectPackage): def test_lock_file_should_not_have_mixed_types(
locker: Locker, root: ProjectPackage
) -> None:
package_a = get_package("A", "1.0.0") package_a = get_package("A", "1.0.0")
package_a.add_dependency(Factory.create_dependency("B", "^1.0.0")) package_a.add_dependency(Factory.create_dependency("B", "^1.0.0"))
package_a.add_dependency( package_a.add_dependency(
...@@ -604,7 +608,9 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -604,7 +608,9 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
assert content == expected assert content == expected
def test_reading_lock_file_should_raise_an_error_on_invalid_data(locker: Locker): def test_reading_lock_file_should_raise_an_error_on_invalid_data(
locker: Locker,
) -> None:
content = f"""\ content = f"""\
# {GENERATED_COMMENT} # {GENERATED_COMMENT}
...@@ -639,7 +645,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -639,7 +645,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
def test_locking_legacy_repository_package_should_include_source_section( def test_locking_legacy_repository_package_should_include_source_section(
root: ProjectPackage, locker: Locker root: ProjectPackage, locker: Locker
): ) -> None:
package_a = Package( package_a = Package(
"A", "A",
"1.0.0", "1.0.0",
...@@ -682,7 +688,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -682,7 +688,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
def test_locker_should_emit_warnings_if_lock_version_is_newer_but_allowed( def test_locker_should_emit_warnings_if_lock_version_is_newer_but_allowed(
locker: Locker, caplog: LogCaptureFixture locker: Locker, caplog: LogCaptureFixture
): ) -> None:
version = ".".join(Version.parse(Locker._VERSION).next_minor().text.split(".")[:2]) version = ".".join(Version.parse(Locker._VERSION).next_minor().text.split(".")[:2])
content = f"""\ content = f"""\
[metadata] [metadata]
...@@ -712,7 +718,7 @@ regenerate the lock file with the `poetry lock` command.\ ...@@ -712,7 +718,7 @@ regenerate the lock file with the `poetry lock` command.\
def test_locker_should_raise_an_error_if_lock_version_is_newer_and_not_allowed( def test_locker_should_raise_an_error_if_lock_version_is_newer_and_not_allowed(
locker: Locker, caplog: LogCaptureFixture locker: Locker, caplog: LogCaptureFixture
): ) -> None:
content = f"""\ content = f"""\
# {GENERATED_COMMENT} # {GENERATED_COMMENT}
...@@ -730,7 +736,9 @@ content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77 ...@@ -730,7 +736,9 @@ content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77
_ = locker.lock_data _ = locker.lock_data
def test_root_extras_dependencies_are_ordered(locker: Locker, root: ProjectPackage): def test_root_extras_dependencies_are_ordered(
locker: Locker, root: ProjectPackage
) -> None:
root_dir = Path(__file__).parent.parent.joinpath("fixtures") root_dir = Path(__file__).parent.parent.joinpath("fixtures")
Factory.create_dependency("B", "1.0.0", root_dir=root_dir) Factory.create_dependency("B", "1.0.0", root_dir=root_dir)
Factory.create_dependency("C", "1.0.0", root_dir=root_dir) Factory.create_dependency("C", "1.0.0", root_dir=root_dir)
...@@ -765,7 +773,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -765,7 +773,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
assert content == expected assert content == expected
def test_extras_dependencies_are_ordered(locker: Locker, root: ProjectPackage): def test_extras_dependencies_are_ordered(locker: Locker, root: ProjectPackage) -> None:
package_a = get_package("A", "1.0.0") package_a = get_package("A", "1.0.0")
package_a.add_dependency( package_a.add_dependency(
Factory.create_dependency( Factory.create_dependency(
...@@ -805,7 +813,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -805,7 +813,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
def test_locker_should_neither_emit_warnings_nor_raise_error_for_lower_compatible_versions( # noqa: E501 def test_locker_should_neither_emit_warnings_nor_raise_error_for_lower_compatible_versions( # noqa: E501
locker: Locker, caplog: LogCaptureFixture locker: Locker, caplog: LogCaptureFixture
): ) -> None:
older_version = "1.1" older_version = "1.1"
content = f"""\ content = f"""\
[metadata] [metadata]
...@@ -827,7 +835,7 @@ content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77 ...@@ -827,7 +835,7 @@ content-hash = "c3d07fca33fba542ef2b2a4d75bf5b48d892d21a830e2ad9c952ba5123a52f77
def test_locker_dumps_dependency_information_correctly( def test_locker_dumps_dependency_information_correctly(
locker: Locker, root: ProjectPackage locker: Locker, root: ProjectPackage
): ) -> None:
root_dir = Path(__file__).parent.parent.joinpath("fixtures") root_dir = Path(__file__).parent.parent.joinpath("fixtures")
package_a = get_package("A", "1.0.0") package_a = get_package("A", "1.0.0")
package_a.add_dependency( package_a.add_dependency(
...@@ -950,7 +958,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -950,7 +958,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
def test_locker_dumps_dependency_extras_in_correct_order( def test_locker_dumps_dependency_extras_in_correct_order(
locker: Locker, root: ProjectPackage locker: Locker, root: ProjectPackage
): ) -> None:
root_dir = Path(__file__).parent.parent.joinpath("fixtures") root_dir = Path(__file__).parent.parent.joinpath("fixtures")
package_a = get_package("A", "1.0.0") package_a = get_package("A", "1.0.0")
Factory.create_dependency("B", "1.0.0", root_dir=root_dir) Factory.create_dependency("B", "1.0.0", root_dir=root_dir)
...@@ -996,7 +1004,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8 ...@@ -996,7 +1004,7 @@ content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8
def test_locked_repository_uses_root_dir_of_package( def test_locked_repository_uses_root_dir_of_package(
locker: Locker, mocker: MockerFixture locker: Locker, mocker: MockerFixture
): ) -> None:
content = f"""\ content = f"""\
# {GENERATED_COMMENT} # {GENERATED_COMMENT}
...@@ -1084,7 +1092,7 @@ def test_content_hash_with_legacy_is_compatible( ...@@ -1084,7 +1092,7 @@ def test_content_hash_with_legacy_is_compatible(
assert (content_hash == old_content_hash) or fresh assert (content_hash == old_content_hash) or fresh
def test_lock_file_resolves_file_url_symlinks(root: ProjectPackage): def test_lock_file_resolves_file_url_symlinks(root: ProjectPackage) -> None:
""" """
Create directories and file structure as follows: Create directories and file structure as follows:
...@@ -1119,7 +1127,7 @@ def test_lock_file_resolves_file_url_symlinks(root: ProjectPackage): ...@@ -1119,7 +1127,7 @@ def test_lock_file_resolves_file_url_symlinks(root: ProjectPackage):
# Test is not possible in that case. # Test is not possible in that case.
return return
raise raise
locker = Locker(str(symlink_path) + os.sep + Path(lock_file.name).name, {}) locker = Locker(symlink_path / lock_file.name, {})
package_local = Package( package_local = Package(
"local-package", "local-package",
......
from __future__ import annotations from __future__ import annotations
import os from pathlib import Path
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import pytest import pytest
...@@ -16,16 +15,16 @@ if TYPE_CHECKING: ...@@ -16,16 +15,16 @@ if TYPE_CHECKING:
@pytest.fixture() @pytest.fixture()
def setup() -> Callable[[str], str]: def setup() -> Callable[[str], Path]:
def _setup(name: str) -> str: def _setup(name: str) -> Path:
return os.path.join(os.path.dirname(__file__), "fixtures", "setups", name) return Path(__file__).parent / "fixtures" / "setups" / name
return _setup return _setup
def test_setup_reader_read_first_level_setup_call_with_direct_types( def test_setup_reader_read_first_level_setup_call_with_direct_types(
setup: Callable[[str], str] setup: Callable[[str], Path]
): ) -> None:
result = SetupReader.read_from_directory(setup("flask")) result = SetupReader.read_from_directory(setup("flask"))
expected_name = "Flask" expected_name = "Flask"
...@@ -58,8 +57,8 @@ def test_setup_reader_read_first_level_setup_call_with_direct_types( ...@@ -58,8 +57,8 @@ def test_setup_reader_read_first_level_setup_call_with_direct_types(
def test_setup_reader_read_first_level_setup_call_with_variables( def test_setup_reader_read_first_level_setup_call_with_variables(
setup: Callable[[str], str] setup: Callable[[str], Path]
): ) -> None:
result = SetupReader.read_from_directory(setup("requests")) result = SetupReader.read_from_directory(setup("requests"))
expected_name = None expected_name = None
...@@ -85,8 +84,8 @@ def test_setup_reader_read_first_level_setup_call_with_variables( ...@@ -85,8 +84,8 @@ def test_setup_reader_read_first_level_setup_call_with_variables(
def test_setup_reader_read_sub_level_setup_call_with_direct_types( def test_setup_reader_read_sub_level_setup_call_with_direct_types(
setup: Callable[[str], str] setup: Callable[[str], Path]
): ) -> None:
result = SetupReader.read_from_directory(setup("sqlalchemy")) result = SetupReader.read_from_directory(setup("sqlalchemy"))
expected_name = "SQLAlchemy" expected_name = "SQLAlchemy"
...@@ -110,7 +109,7 @@ def test_setup_reader_read_sub_level_setup_call_with_direct_types( ...@@ -110,7 +109,7 @@ def test_setup_reader_read_sub_level_setup_call_with_direct_types(
assert result["python_requires"] is None assert result["python_requires"] is None
def test_setup_reader_read_setup_cfg(setup: Callable[[str], str]): def test_setup_reader_read_setup_cfg(setup: Callable[[str], Path]) -> None:
result = SetupReader.read_from_directory(setup("with-setup-cfg")) result = SetupReader.read_from_directory(setup("with-setup-cfg"))
expected_name = "with-setup-cfg" expected_name = "with-setup-cfg"
...@@ -129,12 +128,12 @@ def test_setup_reader_read_setup_cfg(setup: Callable[[str], str]): ...@@ -129,12 +128,12 @@ def test_setup_reader_read_setup_cfg(setup: Callable[[str], str]):
assert result["python_requires"] == expected_python_requires assert result["python_requires"] == expected_python_requires
def test_setup_reader_read_setup_cfg_with_attr(setup: Callable[[str], str]): def test_setup_reader_read_setup_cfg_with_attr(setup: Callable[[str], Path]) -> None:
with pytest.raises(InvalidVersion): with pytest.raises(InvalidVersion):
SetupReader.read_from_directory(setup("with-setup-cfg-attr")) SetupReader.read_from_directory(setup("with-setup-cfg-attr"))
def test_setup_reader_read_setup_kwargs(setup: Callable[[str], str]): def test_setup_reader_read_setup_kwargs(setup: Callable[[str], Path]) -> None:
result = SetupReader.read_from_directory(setup("pendulum")) result = SetupReader.read_from_directory(setup("pendulum"))
expected_name = "pendulum" expected_name = "pendulum"
...@@ -150,7 +149,7 @@ def test_setup_reader_read_setup_kwargs(setup: Callable[[str], str]): ...@@ -150,7 +149,7 @@ def test_setup_reader_read_setup_kwargs(setup: Callable[[str], str]):
assert result["python_requires"] == expected_python_requires assert result["python_requires"] == expected_python_requires
def test_setup_reader_read_setup_call_in_main(setup: Callable[[str], str]): def test_setup_reader_read_setup_call_in_main(setup: Callable[[str], Path]) -> None:
result = SetupReader.read_from_directory(setup("pyyaml")) result = SetupReader.read_from_directory(setup("pyyaml"))
expected_name = "PyYAML" expected_name = "PyYAML"
...@@ -166,7 +165,9 @@ def test_setup_reader_read_setup_call_in_main(setup: Callable[[str], str]): ...@@ -166,7 +165,9 @@ def test_setup_reader_read_setup_call_in_main(setup: Callable[[str], str]):
assert result["python_requires"] == expected_python_requires assert result["python_requires"] == expected_python_requires
def test_setup_reader_read_extras_require_with_variables(setup: Callable[[str], str]): def test_setup_reader_read_extras_require_with_variables(
setup: Callable[[str], Path]
) -> None:
result = SetupReader.read_from_directory(setup("extras_require_with_vars")) result = SetupReader.read_from_directory(setup("extras_require_with_vars"))
expected_name = "extras_require_with_vars" expected_name = "extras_require_with_vars"
...@@ -182,7 +183,7 @@ def test_setup_reader_read_extras_require_with_variables(setup: Callable[[str], ...@@ -182,7 +183,7 @@ def test_setup_reader_read_extras_require_with_variables(setup: Callable[[str],
assert result["python_requires"] == expected_python_requires assert result["python_requires"] == expected_python_requires
def test_setup_reader_setuptools(setup: Callable[[str], str]): def test_setup_reader_setuptools(setup: Callable[[str], Path]) -> None:
result = SetupReader.read_from_directory(setup("setuptools_setup")) result = SetupReader.read_from_directory(setup("setuptools_setup"))
expected_name = "my_package" expected_name = "my_package"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment