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

get_requires_for_build_wheel must return additional build requirements and not dependencies (#1689) #1875

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions poetry/masonry/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@

def get_requires_for_build_wheel(config_settings=None):
"""
Returns a list of requirements for building, as strings
"""
poetry = Factory().create_poetry(Path("."))
Returns an additional list of requirements for building, as PEP508 strings,
above and beyond those specified in the pyproject.toml file.

main, _ = SdistBuilder.convert_dependencies(poetry.package, poetry.package.requires)
This implementation is optional. At the moment it only returns an empty list, which would be the same as if
not define. So this is just for completeness for future implementation.
"""

return main
return []


# For now, we require all dependencies to build either a wheel or an sdist.
Expand Down
8 changes: 4 additions & 4 deletions tests/masonry/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def cwd(directory):


def test_get_requires_for_build_wheel():
expected = ["cleo>=0.6.0,<0.7.0", "cachy[msgpack]>=0.2.0,<0.3.0"]
expected = []
with cwd(os.path.join(fixtures, "complete")):
api.get_requires_for_build_wheel() == expected
assert api.get_requires_for_build_wheel() == expected


def test_get_requires_for_build_sdist():
expected = ["cleo>=0.6.0,<0.7.0", "cachy[msgpack]>=0.2.0,<0.3.0"]
expected = []
with cwd(os.path.join(fixtures, "complete")):
api.get_requires_for_build_sdist() == expected
assert api.get_requires_for_build_sdist() == expected


def test_build_wheel():
Expand Down