Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add test for pip installing pendulum failing #2262

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/installation/test_pip_installer.py
@@ -1,12 +1,17 @@
import shutil

import pytest

from poetry.factory import Factory
from poetry.installation.pip_installer import PipInstaller
from poetry.io.null_io import NullIO
from poetry.packages.package import Package
from poetry.repositories.legacy_repository import LegacyRepository
from poetry.repositories.pool import Pool
from poetry.utils._compat import Path
from poetry.utils.env import EnvManager
from poetry.utils.env import NullEnv
from poetry.utils.env import VirtualEnv


@pytest.fixture
Expand Down Expand Up @@ -62,6 +67,39 @@ def test_requirement_source_type_url():
assert expected == result


@pytest.fixture()
def poetry(config):
poetry = Factory().create_poetry(
Path(__file__).parent.parent / "fixtures" / "simple_project"
)
poetry.set_config(config)

return poetry


@pytest.fixture()
def manager(poetry):
return EnvManager(poetry)


@pytest.fixture
def tmp_venv(tmp_dir, manager):
venv_path = Path(tmp_dir) / "venv"

manager.build_venv(str(venv_path))

venv = VirtualEnv(venv_path)
yield venv

shutil.rmtree(str(venv.path))


def test_can_install_pendulum_sdist(tmp_venv):
installer = PipInstaller(tmp_venv, NullIO(), Pool())

installer.run("install", "--no-binary", ":all:", "pendulum")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail today because poetry-core 1.0.0a5 cannot be installed from source. When pendulum is attempted to be built using PEP-517.

Using pip install --no-binary pendulum should progress further. But will fail when we hit pendulum. Which again attempts to install using setuptools.

This should be resolved once python-poetry/poetry-core#24 is merged.



def test_requirement_git_develop_false(installer, package_git):
package_git.develop = False
result = installer.requirement(package_git)
Expand Down