Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
poetry-core / tests / pyproject / conftest.py
Size: Mime:
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest


if TYPE_CHECKING:
    from pathlib import Path


@pytest.fixture
def pyproject_toml(tmp_path: Path) -> Path:
    path = tmp_path / "pyproject.toml"
    with path.open(mode="w"):
        pass
    return path


@pytest.fixture
def build_system_section(pyproject_toml: Path) -> str:
    content = """
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
"""
    with pyproject_toml.open(mode="a") as f:
        f.write(content)
    return content


@pytest.fixture
def poetry_section(pyproject_toml: Path) -> str:
    content = """
[tool.poetry]
name = "poetry"

[tool.poetry.dependencies]
python = "^3.5"
"""
    with pyproject_toml.open(mode="a") as f:
        f.write(content)
    return content