Skip to content

Commit

Permalink
Add a test that pip-compile setup.py preserves env-markers
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Mar 1, 2021
1 parent 4661c89 commit cb704e1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_cli_compile.py
Expand Up @@ -127,6 +127,34 @@ def test_command_line_setuptools_nested_output_file(tmpdir, runner):
assert (proj_dir / "requirements.txt").exists()


@pytest.mark.network
def test_setuptools_preserves_environment_markers(
runner, make_package, make_wheel, tmpdir
):
dists_dir = tmpdir / "dists"

foo_dir = make_package(name="foo", version="1.0")
make_wheel(foo_dir, dists_dir)

bar_dir = make_package(
name="bar", version="2.0", install_requires=['foo ; python_version >= "1"']
)
out = runner.invoke(
cli,
[
str(bar_dir / "setup.py"),
"--no-header",
"--no-annotate",
"--no-emit-find-links",
"--find-links",
str(dists_dir),
],
)

assert out.exit_code == 0, out.stderr
assert out.stderr == 'foo==1.0 ; python_version >= "1"\n'


def test_find_links_option(runner):
with open("requirements.in", "w") as req_in:
req_in.write("-f ./libs3")
Expand Down

0 comments on commit cb704e1

Please sign in to comment.