repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
poetry | tests/console/commands/debug/test_resolve.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.version.markers import parse_marker
from poetry.factory import Factory
from tests.helpers import get_package
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from tests.helpers import... | 104 | 2,370 |
poetry | tests/console/commands/debug/test_info.py | .py | from __future__ import annotations
import sys
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.__version__ import __version__
from poetry.utils.env import MockEnv
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from pytest_mock import MockerFixtur... | 73 | 1,650 |
poetry | tests/console/commands/python/test_python_list.py | .py | from __future__ import annotations
import platform
from typing import TYPE_CHECKING
import pytest
from poetry.utils._compat import WINDOWS
from tests.helpers import pbs_installer_supported_arch
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from poetry.config.config import Config... | 190 | 5,922 |
poetry | tests/console/commands/python/test_python_install.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version.version import Version
from poetry.console.exceptions import PoetryRuntimeError
from poetry.utils.env.python.installer import PythonDownloadNotFoundError
from poetry.utils.env.python.installer impo... | 193 | 6,429 |
poetry | tests/console/commands/python/test_python_remove.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from poetry.config.config import Config
from tests.types import CommandTesterFactory
from tests.types import MockedPoetryPythonRegister
@pytest... | 147 | 4,622 |
poetry | tests/console/commands/env/test_activate.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.console.commands.env.activate import EnvActivateCommand
from poetry.console.commands.env.activate import ShellNotSupportedError
from poetry.utils._compat import WINDOWS
if TYPE_CHECKING:
from cleo.testers.application_... | 123 | 3,541 |
poetry | tests/console/commands/env/test_remove.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import Version
from tests.console.commands.env.helpers import check_output_wrapper
if TYPE_CHECKING:
from pathlib import Path
from cleo.testers.command_tester import CommandTester
fr... | 169 | 4,825 |
poetry | tests/console/commands/env/test_info.py | .py | from __future__ import annotations
import sys
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.utils.env import MockEnv
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from pytest_mock import MockerFixture
from tests.types import CommandTeste... | 70 | 1,651 |
poetry | tests/console/commands/env/helpers.py | .py | from __future__ import annotations
import os
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from poetry.core.constraints.version import Version
if TYPE_CHECKING:
from collections.abc import Callable
VERSION_3_7_1 = Version.parse("3.7.1")
def build_venv(path: Path | str, **_... | 52 | 1,417 |
poetry | tests/console/commands/env/test_list.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
import tomlkit
from poetry.toml.file import TOMLFile
if TYPE_CHECKING:
from pathlib import Path
from cleo.testers.command_tester import CommandTester
from pytest_mock import MockerFixture
from poetry.utils.env impor... | 79 | 2,039 |
poetry | tests/console/commands/env/test_use.py | .py | from __future__ import annotations
import os
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
import tomlkit
from poetry.core.constraints.version import Version
from poetry.console.commands.env.use import EnvUseCommand
from poetry.toml.file import TOMLFile
from poetry.utils.env import MockEn... | 194 | 5,767 |
poetry | tests/console/commands/env/conftest.py | .py | from __future__ import annotations
import os
from typing import TYPE_CHECKING
import pytest
from poetry.utils.env import EnvManager
if TYPE_CHECKING:
from collections.abc import Iterator
from pathlib import Path
from tests.helpers import PoetryTestApplication
@pytest.fixture
def venv_name(app: Poet... | 98 | 2,431 |
poetry | tests/console/commands/cache/test_list.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from pathlib import Path
from cleo.testers.command_tester import CommandTester
from poetry.utils.cache import FileCache
from tests.types import CommandTesterFactory
@pytest.fixture
def tester(comm... | 45 | 893 |
poetry | tests/console/commands/cache/test_clear.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import TypeVar
import pytest
from cleo.testers.application_tester import ApplicationTester
from poetry.console.application import Application
if TYPE_CHECKING:
from pathlib import Path
from poetry.utils.cache import FileCache... | 144 | 4,266 |
poetry | tests/console/commands/cache/conftest.py | .py | from __future__ import annotations
import uuid
from typing import TYPE_CHECKING
import pytest
from poetry.utils.cache import FileCache
if TYPE_CHECKING:
from pathlib import Path
from tests.conftest import Config
@pytest.fixture
def repository_cache_dir(config: Config) -> Path:
return config.reposit... | 67 | 1,537 |
poetry | tests/masonry/builders/test_editable_builder.py | .py | from __future__ import annotations
import csv
import json
import os
import shutil
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from cleo.io.null_io import NullIO
from deepdiff.diff import DeepDiff
from poetry.core.constraints.version import Version
from poetry.core.masonry.metadata import... | 468 | 15,199 |
poetry | tests/masonry/builders/fixtures/excluded_subpackage/example/__init__.py | .py | from __future__ import annotations
__version__ = "0.1.0"
| 5 | 59 |
poetry | tests/masonry/builders/fixtures/excluded_subpackage/example/test/excluded.py | .py | from __future__ import annotations
from tests.masonry.builders.fixtures.excluded_subpackage.example import __version__
def test_version():
assert __version__ == "0.1.0"
| 8 | 176 |
poetry | tests/installation/test_executor.py | .py | from __future__ import annotations
import csv
import json
import re
import shutil
import tempfile
from pathlib import Path
from subprocess import CalledProcessError
from typing import TYPE_CHECKING
from typing import Any
import pytest
from build import BuildBackendException
from build import ProjectBuilder
from cle... | 1,998 | 61,893 |
poetry | tests/installation/test_chooser.py | .py | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from packaging.tags import Tag
from poetry.core.packages.package import Package
from poetry.console.exceptions import PoetryRuntimeError
from poetry.installation.chooser import Chooser
from poetry.repositories... | 385 | 11,403 |
poetry | tests/installation/test_chef.py | .py | from __future__ import annotations
import os
import shutil
import tempfile
from pathlib import Path
from typing import TYPE_CHECKING
from zipfile import ZipFile
import pytest
from build import ProjectBuilder
from poetry.core.packages.utils.link import Link
from poetry.factory import Factory
from poetry.installatio... | 172 | 4,995 |
poetry | tests/installation/test_chooser_errors.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
from poetry.core.packages.package import Package
from poetry.installation.chooser import Chooser
if TYPE_CHECKING:
from poetry.repositories.repository_pool import RepositoryPool
from poetry.utils.env import MockEnv
def test_chooser_no_li... | 95 | 3,436 |
poetry | tests/installation/test_installer.py | .py | from __future__ import annotations
import json
import re
import shutil
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import cast
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.inputs.input import Input
from cleo.io.null_io import NullIO
from cleo... | 3,340 | 101,771 |
poetry | tests/installation/test_wheel_installer.py | .py | from __future__ import annotations
import re
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import parse_constraint
from poetry.installation.wheel_installer import WheelInstaller
from poetry.utils._compat import WINDOWS
from poetry.utils.env import Mock... | 147 | 4,833 |
poetry | tests/installation/conftest.py | .py | from __future__ import annotations
import pytest
from packaging.tags import Tag
from poetry.repositories.legacy_repository import LegacyRepository
from poetry.repositories.pypi_repository import PyPiRepository
from poetry.repositories.repository_pool import RepositoryPool
from poetry.utils.env import MockEnv
@pyte... | 35 | 942 |
poetry | tests/utils/test_pip.py | .py | from __future__ import annotations
import subprocess
from typing import TYPE_CHECKING
import pytest
from poetry.utils.pip import pip_install
if TYPE_CHECKING:
from pathlib import Path
from pytest_mock import MockerFixture
from poetry.utils.env import VirtualEnv
from tests.types import FixtureDir... | 41 | 1,092 |
poetry | tests/utils/test_log_utils.py | .py | from __future__ import annotations
from poetry.core.packages.package import Package
from poetry.utils.env.mock_env import MockEnv
from poetry.utils.log_utils import format_build_wheel_log
def test_format_build_wheel_log() -> None:
env = MockEnv(version_info=(3, 13, 1), platform="win32", platform_machine="AMD64"... | 17 | 565 |
poetry | tests/utils/test_compat.py | .py | from __future__ import annotations
import sys
from pathlib import Path
import pytest
from poetry.utils._compat import is_relative_to
@pytest.mark.parametrize(
("path1", "path2", "expected"),
[
("a", "a", True),
("a/b", "a/b", True),
("a/b", "a", True),
("a", "a/b", False),
... | 72 | 2,221 |
poetry | tests/utils/test_isolated_build.py | .py | from __future__ import annotations
import shutil
import sys
import uuid
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.factory import Factory
from poetry.puzzle.exceptions import SolverProblemError
from poetry.puzzle.provid... | 183 | 6,095 |
poetry | tests/utils/test_threading.py | .py | from __future__ import annotations
import functools
import logging
import os
import sys
import threading
import time
from concurrent.futures import wait
from concurrent.futures.thread import ThreadPoolExecutor
from typing import TYPE_CHECKING
import pytest
from poetry.utils.threading import AtomicCachedProperty
fro... | 153 | 4,779 |
poetry | tests/utils/test_dependency_specification.py | .py | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from deepdiff.diff import DeepDiff
from poetry.inspection.info import PackageInfo
from poetry.utils.dependency_specification import RequirementsParser
if TYPE_CHECKING:
from collections.abc import Collec... | 193 | 6,417 |
poetry | tests/utils/test_patterns.py | .py | from __future__ import annotations
import pytest
from poetry.utils import patterns
@pytest.mark.parametrize(
["filename", "expected"],
[
(
"markdown_captions-2-py3-none-any.whl",
{
"namever": "markdown_captions-2",
"name": "markdown_captions",
... | 86 | 2,285 |
poetry | tests/utils/test_download.py | .py | from __future__ import annotations
import base64
import re
from typing import TYPE_CHECKING
from typing import Any
from typing import ClassVar
from typing import Literal
import pytest
import responses
from requests.exceptions import ChunkedEncodingError
from poetry.utils.download import Downloader
from poetry.util... | 282 | 9,467 |
poetry | tests/utils/test_wheel.py | .py | from __future__ import annotations
import pytest
from packaging.tags import Tag
from poetry.utils.env import MockEnv
from poetry.utils.wheel import Wheel
@pytest.mark.parametrize(
("filename", "supported_tags", "expected"),
[
("demo-1.0.0-py3-none-any.whl", [Tag("py3", "none", "any")], True),
... | 37 | 1,091 |
poetry | tests/utils/test_password_manager.py | .py | from __future__ import annotations
import logging
import os
from typing import TYPE_CHECKING
from unittest.mock import MagicMock
import pytest
from poetry.utils.password_manager import HTTPAuthCredential
from poetry.utils.password_manager import PasswordManager
from poetry.utils.password_manager import PoetryKeyrin... | 409 | 12,130 |
poetry | tests/utils/test_extras.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.packages.package import Package
from poetry.factory import Factory
from poetry.utils.extras import get_extra_package_names
if TYPE_CHECKING:
from packaging.utils import NormalizedName
_PACKAGE_FOO = Package("fo... | 76 | 2,374 |
poetry | tests/utils/test_python_manager.py | .py | from __future__ import annotations
import os
import sys
import textwrap
from pathlib import Path
from typing import TYPE_CHECKING
import findpython
import packaging.version
import pytest
from poetry.core.constraints.version import Version
from poetry.utils.env.python import Python
if TYPE_CHECKING:
from unit... | 144 | 4,768 |
poetry | tests/utils/test_authenticator.py | .py | from __future__ import annotations
import base64
import logging
import re
import uuid
from pathlib import Path
from typing import TYPE_CHECKING
from typing import NoReturn
import pytest
import requests
import responses
from cleo.io.null_io import NullIO
from keyring.credentials import SimpleCredential
from poetry.... | 754 | 23,862 |
poetry | tests/utils/test_helpers.py | .py | from __future__ import annotations
import contextlib
import sys
import tarfile
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.utils._compat import WINDOWS
from poetry.utils.download import Downloader
from poetry.utils.download import HTTPRangeRequestSupportedError
from poetry.ut... | 359 | 11,571 |
poetry | tests/utils/test_cache.py | .py | from __future__ import annotations
import concurrent.futures
import shutil
import traceback
from pathlib import Path
from typing import TYPE_CHECKING
from typing import TypeVar
import pytest
from packaging.tags import Tag
from poetry.core.packages.utils.link import Link
from poetry.utils.cache import ArtifactCache... | 370 | 11,008 |
poetry | tests/utils/conftest.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from poetry.poetry import Poetry
from poetry.utils.env import EnvManager
@pytest.fixture
def venv_name(
manager: EnvManager,
poetry: Poetry,
) -> str:
return manager.generate_env_name(
p... | 22 | 384 |
poetry | tests/utils/env/test_env_manager.py | .py | from __future__ import annotations
import logging
import os
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
import pytest
import tomlkit
from poetry.core.constraints.version import Version
from poetry.config.config import Config
from poetry.console.exceptions import Poet... | 1,447 | 42,508 |
poetry | tests/utils/env/test_env.py | .py | from __future__ import annotations
import os
import re
import subprocess
import sys
from importlib import metadata
from pathlib import Path
from threading import Thread
from typing import TYPE_CHECKING
import packaging.tags
import pytest
from deepdiff.diff import DeepDiff
from installer.utils import SCHEME_NAMES
f... | 575 | 19,351 |
poetry | tests/utils/env/test_system_env.py | .py | from __future__ import annotations
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from poetry.utils.env import SystemEnv
if TYPE_CHECKING:
from pytest_mock import MockerFixture
def test_get_marker_env_untagged_cpython(mocker: MockerFixture) -> None:
mocker.patch("platform.python_ver... | 20 | 484 |
poetry | tests/utils/env/test_env_site_packages.py | .py | from __future__ import annotations
import uuid
from pathlib import Path
from typing import TYPE_CHECKING
from poetry.utils.env import SitePackages
if TYPE_CHECKING:
from pytest_mock import MockerFixture
def test_env_site_simple(tmp_path: Path, mocker: MockerFixture) -> None:
# emulate permission error wh... | 50 | 1,562 |
poetry | tests/utils/env/conftest.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from cleo.io.buffered_io import BufferedIO
from poetry.utils.env import EnvManager
if TYPE_CHECKING:
from poetry.poetry import Poetry
from tests.types import FixtureDirGetter
from tests.types import ProjectFactory
@pyt... | 31 | 670 |
poetry | tests/utils/env/python/test_manager.py | .py | from __future__ import annotations
import platform
import sys
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import Version
from poetry.core.constraints.version import parse_constraint
from poetry.utils.env.python import Python
from tests.helpers import pbs_installer_supported_... | 151 | 4,956 |
poetry | tests/utils/env/python/test_python_providers.py | .py | from __future__ import annotations
import sys
from typing import TYPE_CHECKING
from poetry.core.constraints.version import Version
from poetry.utils.env.python.providers import PoetryPythonPathProvider
from poetry.utils.env.python.providers import ShutilWhichPythonProvider
if TYPE_CHECKING:
from tests.types i... | 58 | 1,898 |
poetry | tests/utils/env/python/test_python_installer.py | .py | from __future__ import annotations
from subprocess import CalledProcessError
from typing import TYPE_CHECKING
from typing import Literal
from typing import cast
import pytest
from poetry.core.constraints.version import Version
from poetry.console.exceptions import PoetryRuntimeError
from poetry.utils.env.python.ins... | 169 | 5,075 |
poetry | tests/fixtures/project_with_setup/setup.py | .py | from __future__ import annotations
from setuptools import setup
kwargs = dict(
name="project-with-setup",
license="MIT",
version="0.1.2",
description="Demo project.",
author="Sébastien Eustace",
author_email="sebastien@eustace.io",
url="https://github.com/demo/demo",
packages=["my_pac... | 20 | 416 |
poetry | tests/fixtures/excluded_subpackage/example/test/excluded.py | .py | from __future__ import annotations
from tests.fixtures.excluded_subpackage.example import __version__
def test_version():
assert __version__ == "0.1.0"
| 8 | 159 |
poetry | tests/fixtures/project_with_setup_calls_script/setup.py | .py | from __future__ import annotations
import subprocess
from setuptools import setup
if subprocess.call(["exit-code"]) != 42:
raise RuntimeError("Wrong exit code.")
kwargs = dict(
name="project-with-setup-calls-script",
license="MIT",
version="0.1.2",
description="Demo project.",
author="Sébast... | 24 | 532 |
poetry | tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py | .py | from __future__ import annotations
from distutils.core import setup
packages = ["project_with_extras"]
package_data = {"": ["*"]}
extras_require = {"extras_a": ["pendulum>=1.4.4"], "extras_b": ["cachy>=0.2.0"]}
setup_kwargs = {
"name": "project-with-extras",
"version": "1.2.3",
"description": "This is... | 27 | 574 |
poetry | tests/fixtures/extended_project/build.py | .py | from __future__ import annotations
from pathlib import Path
from typing import Any
def build(setup_kwargs: dict[str, Any]):
assert setup_kwargs["name"] == "extended-project"
assert setup_kwargs["version"] == "1.2.3"
dynamic_module = Path(__file__).parent / "extended_project" / "built.py"
dynamic_mod... | 13 | 362 |
poetry | tests/fixtures/with_multiple_readme_files/my_package/__init__.py | .py | """Example module"""
from __future__ import annotations
__version__ = "0.1"
| 7 | 79 |
poetry | tests/fixtures/scripts/scripts/check_argv0.py | .py | from __future__ import annotations
import sys
from pathlib import Path
def main() -> int:
path = Path(sys.argv[0])
if sys.argv[1] == "absolute":
if not path.is_absolute():
raise RuntimeError(f"sys.argv[0] is not an absolute path: {path}")
if not path.exists():
raise R... | 24 | 557 |
poetry | tests/fixtures/scripts/scripts/return_code.py | .py | from __future__ import annotations
def main() -> int:
return 42
if __name__ == "__main__":
raise SystemExit(main())
| 10 | 128 |
poetry | tests/fixtures/scripts/scripts/exit_code.py | .py | from __future__ import annotations
def main() -> None:
raise SystemExit(42)
if __name__ == "__main__":
main()
| 10 | 122 |
poetry | tests/fixtures/with-include/package_with_include/__init__.py | .py | from __future__ import annotations
__version__ = "1.2.3"
| 5 | 59 |
poetry | tests/fixtures/extended_with_no_setup/build.py | .py | from __future__ import annotations
import os
import shutil
from setuptools import Distribution
from setuptools import Extension
from setuptools.command.build_ext import build_ext
extensions = [Extension("extended.extended", ["extended/extended.c"])]
def build():
distribution = Distribution({"name": "extended"... | 33 | 859 |
poetry | tests/fixtures/git/github.com/demo/namespace-package-one/setup.py | .py | from __future__ import annotations
from setuptools import find_packages
from setuptools import setup
setup(
name="namespace_package_one",
version="1.0.0",
description="",
long_description="",
author="Python Poetry",
author_email="noreply@python-poetry.org",
license="MIT",
packages=fin... | 19 | 402 |
poetry | tests/fixtures/git/github.com/demo/namespace-package-one/namespace_package/__init__.py | .py | from __future__ import annotations
__import__("pkg_resources").declare_namespace(__name__)
| 5 | 93 |
poetry | tests/fixtures/git/github.com/demo/namespace-package-one/namespace_package/one/__init__.py | .py | from __future__ import annotations
name = "one"
| 5 | 50 |
poetry | tests/fixtures/git/github.com/demo/non-canonical-name/setup.py | .py | from __future__ import annotations
from setuptools import setup
kwargs = dict(
name="Demo",
license="MIT",
version="0.1.2",
description="Demo project.",
author="Sébastien Eustace",
author_email="sebastien@eustace.io",
url="https://github.com/demo/demo",
packages=["demo"],
install_... | 21 | 429 |
poetry | tests/fixtures/git/github.com/demo/no-dependencies/setup.py | .py | from __future__ import annotations
from setuptools import setup
kwargs = dict(
name="demo",
license="MIT",
version="0.1.2",
description="Demo project.",
author="Sébastien Eustace",
author_email="sebastien@eustace.io",
url="https://github.com/demo/demo",
packages=["demo"],
)
setup(**... | 19 | 329 |
poetry | tests/fixtures/git/github.com/demo/no-version/setup.py | .py | from __future__ import annotations
import ast
import os
from setuptools import setup
def read_version():
with open(os.path.join(os.path.dirname(__file__), "demo", "__init__.py")) as f:
for line in f:
if line.startswith("__version__ = "):
return ast.literal_eval(line[len("__ve... | 31 | 696 |
poetry | tests/repositories/test_repository.py | .py | from __future__ import annotations
import pytest
from poetry.core.constraints.version import Version
from poetry.factory import Factory
from poetry.repositories import Repository
from tests.helpers import get_package
@pytest.fixture(scope="module")
def repository() -> Repository:
repo = Repository("repo")
... | 113 | 3,233 |
poetry | tests/repositories/test_single_page_repository.py | .py | from __future__ import annotations
import re
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from poetry.core.packages.dependency import Dependency
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.repositories.link_sources.html import HTMLPage
from poetry.reposito... | 105 | 3,197 |
poetry | tests/repositories/test_pypi_repository.py | .py | from __future__ import annotations
from datetime import datetime
from datetime import timezone
from io import BytesIO
from typing import TYPE_CHECKING
from typing import Any
import pytest
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from poetry.core.constraints.version imp... | 456 | 14,235 |
poetry | tests/repositories/test_cached_repository.py | .py | from __future__ import annotations
from typing import Any
import pytest
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
from poetry.inspection.info import PackageInfo
from poetry.repositories.cached_repository import Cached... | 83 | 2,604 |
poetry | tests/repositories/test_repository_pool.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.constraints.version import Version
from poetry.repositories import Repository
from poetry.repositories import RepositoryPool
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.repositories.leg... | 310 | 10,728 |
poetry | tests/repositories/test_lockfile_repository.py | .py | from __future__ import annotations
from copy import deepcopy
import pytest
from poetry.core.packages.package import Package
from poetry.repositories.lockfile_repository import LockfileRepository
@pytest.fixture(scope="module")
def packages() -> list[Package]:
return [
Package("a", "1.0", source_type="... | 40 | 1,097 |
poetry | tests/repositories/test_installed_repository.py | .py | from __future__ import annotations
import os
import shutil
import zipfile
from functools import cached_property
from importlib import metadata
from pathlib import Path
from typing import TYPE_CHECKING
from typing import NamedTuple
import pytest
from poetry.repositories.installed_repository import InstalledRepositor... | 514 | 18,600 |
poetry | tests/repositories/test_http_repository.py | .py | from __future__ import annotations
import contextlib
import logging
import shutil
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from zipfile import ZipFile
import pytest
from packaging.metad... | 471 | 15,574 |
poetry | tests/repositories/test_legacy_repository.py | .py | from __future__ import annotations
import base64
import re
from datetime import datetime
from datetime import timezone
from typing import TYPE_CHECKING
from typing import Any
import pytest
import requests
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from poetry.core.const... | 784 | 25,174 |
poetry | tests/repositories/conftest.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from tests.types import HTMLPageGetter
@pytest.fixture
def html_page_content() -> HTMLPageGetter:
def _fixture(content: str, base_url: str | None = None) -> str:
base = f'<base href="{base_url}"' if... | 32 | 701 |
poetry | tests/repositories/link_sources/test_base.py | .py | from __future__ import annotations
import urllib.parse
from collections import defaultdict
from functools import cached_property
from typing import TYPE_CHECKING
from unittest.mock import PropertyMock
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
fro... | 197 | 5,884 |
poetry | tests/repositories/link_sources/test_json.py | .py | from __future__ import annotations
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version.version import Version
from poetry.repositories.link_sources.json import SimpleJsonPage
from poetry.repositories.link_sources.json import SimpleRepositoryJsonRootPage
@pytest.fixture
... | 207 | 6,265 |
poetry | tests/repositories/link_sources/test_html.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
from poetry.core.packages.utils.link import Link
from poetry.repositories.link_sources.html import HTMLPage
from poetry.repositories.lin... | 224 | 7,122 |
poetry | tests/repositories/parsers/test_pypi_search_parser.py | .py | from __future__ import annotations
from pathlib import Path
import pytest
from poetry.repositories.parsers.pypi_search_parser import Result
from poetry.repositories.parsers.pypi_search_parser import SearchResultParser
FIXTURES_DIRECTORY = Path(__file__).parent.parent / "fixtures" / "pypi.org" / "search"
@pytest.... | 132 | 4,176 |
poetry | tests/repositories/parsers/test_html_page_parser.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.repositories.parsers.html_page_parser import HTMLPageParser
if TYPE_CHECKING:
from tests.types import HTMLPageGetter
@pytest.fixture()
def html_page(html_page_content: HTMLPageGetter) -> str:
links = """
... | 70 | 2,219 |
poetry | tests/repositories/fixtures/legacy.py | .py | from __future__ import annotations
import json
import re
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from urllib.parse import urlparse
import pytest
import responses
from packaging.utils import canonicalize_name
from poetry.repositories.legacy_repository import LegacyRepository... | 282 | 8,838 |
poetry | tests/repositories/fixtures/__init__.py | .py | from __future__ import annotations
pytest_plugins = [
"tests.repositories.fixtures.distribution_hashes",
"tests.repositories.fixtures.legacy",
"tests.repositories.fixtures.pypi",
"tests.repositories.fixtures.python_hosted",
]
| 10 | 244 |
poetry | tests/repositories/fixtures/pypi.py | .py | from __future__ import annotations
import json
import re
from typing import TYPE_CHECKING
from typing import Any
from urllib.parse import urlparse
import pytest
import responses
from packaging.utils import parse_sdist_filename
from packaging.utils import parse_wheel_filename
from poetry.repositories.pypi_repositor... | 195 | 5,863 |
poetry | tests/repositories/fixtures/python_hosted.py | .py | from __future__ import annotations
import re
from collections.abc import Iterator
from pathlib import Path
from typing import TYPE_CHECKING
from urllib.parse import urlparse
import pytest
import responses
if TYPE_CHECKING:
from collections.abc import Iterator
from requests import PreparedRequest
from... | 76 | 2,036 |
poetry | tests/repositories/fixtures/pypi.org/generate.py | .py | """
This is a helper script built to generate mocked PyPI json files and release files. Executing the script does the
following for a specified list of releases.
1. Fetch relevant project json file from https://pypi.org/simple/<name>.
2. Fetch relevant release json file from https://pypi.org/pypi/<name>/<version>/json... | 755 | 26,173 |
poetry | tests/plugins/test_plugin_manager.py | .py | from __future__ import annotations
import shutil
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from typing import ClassVar
from typing import Protocol
import pytest
from cleo.io.buffered_io import BufferedIO
from cleo.io.outputs.output import Verbosity
from poetry.core.constraints.version imp... | 628 | 20,932 |
poetry | src/poetry/exceptions.py | .py | from __future__ import annotations
class PoetryError(Exception):
pass
| 6 | 76 |
poetry | src/poetry/__main__.py | .py | from __future__ import annotations
import sys
if __name__ == "__main__":
from poetry.console.application import main
sys.exit(main())
| 10 | 146 |
poetry | src/poetry/__version__.py | .py | from __future__ import annotations
from importlib import metadata
__version__ = metadata.version("poetry")
| 7 | 110 |
poetry | src/poetry/poetry.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import Any
from typing import cast
from poetry.core.poetry import Poetry as BasePoetry
from poetry.__version__ import __version__
from poetry.config.source import Source
from poetry.pyproject.toml import PyProjectTOML
if TYPE_CHECKING:... | 105 | 2,830 |
poetry | src/poetry/factory.py | .py | from __future__ import annotations
import contextlib
import logging
import re
from typing import TYPE_CHECKING
from typing import Any
from cleo.io.null_io import NullIO
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
from po... | 384 | 13,252 |
poetry | src/poetry/locations.py | .py | from __future__ import annotations
import os
from pathlib import Path
from platformdirs import user_cache_path
from platformdirs import user_config_path
from platformdirs import user_data_path
_APP_NAME = "pypoetry"
DEFAULT_CACHE_DIR = user_cache_path(_APP_NAME, appauthor=False)
CONFIG_DIR = Path(
os.getenv("... | 26 | 597 |
poetry | src/poetry/vcs/git/__init__.py | .py | from __future__ import annotations
from poetry.vcs.git.backend import Git
__all__ = ["Git"]
| 7 | 95 |
poetry | src/poetry/vcs/git/system.py | .py | from __future__ import annotations
import os
import subprocess
from typing import TYPE_CHECKING
from dulwich.client import find_git_command
if TYPE_CHECKING:
from pathlib import Path
from typing import Any
class SystemGit:
@classmethod
def clone(cls, repository: str, dest: Path) -> None:
... | 60 | 1,523 |
poetry | src/poetry/vcs/git/backend.py | .py | from __future__ import annotations
import contextlib
import dataclasses
import logging
import os
import re
from pathlib import Path
from subprocess import CalledProcessError
from typing import TYPE_CHECKING
from urllib.parse import urljoin
from urllib.parse import urlparse
from urllib.parse import urlunparse
from du... | 615 | 22,489 |
poetry | src/poetry/puzzle/provider.py | .py | from __future__ import annotations
import functools
import itertools
import logging
import re
import time
from collections import defaultdict
from contextlib import contextmanager
from typing import TYPE_CHECKING
from typing import Any
from typing import ClassVar
from typing import cast
from cleo.ui.progress_indicat... | 1,135 | 47,329 |
poetry | src/poetry/puzzle/exceptions.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.package import Package
from poetry.mixology.failure import SolveFailureError
class SolverProblemError(Exception):
def __init__(self... | 31 | 788 |
poetry | src/poetry/puzzle/__init__.py | .py | from __future__ import annotations
from poetry.puzzle.solver import Solver
__all__ = ["Solver"]
| 7 | 99 |
poetry | src/poetry/puzzle/solver.py | .py | from __future__ import annotations
import functools
import time
from collections import defaultdict
from contextlib import contextmanager
from typing import TYPE_CHECKING
from poetry.core.version.markers import AnyMarker
from poetry.core.version.markers import EmptyMarker
from poetry.core.version.markers import Mult... | 540 | 20,589 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.