Commit a0c93572 by finswimmer Committed by Sébastien Eustace

fix (masonry.api): `get_requires_for_build_wheel` must return additional list of…

fix (masonry.api): `get_requires_for_build_wheel` must return additional list of requirements for building a package, not listed in `pyproject.toml` and not dependencies for the package itself (#1875)

fix (tests): adopted tests
parent 22f06e55
...@@ -20,13 +20,14 @@ log = logging.getLogger(__name__) ...@@ -20,13 +20,14 @@ log = logging.getLogger(__name__)
def get_requires_for_build_wheel(config_settings=None): def get_requires_for_build_wheel(config_settings=None):
""" """
Returns a list of requirements for building, as strings Returns an additional list of requirements for building, as PEP508 strings,
""" above and beyond those specified in the pyproject.toml file.
poetry = Factory().create_poetry(Path("."))
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. # For now, we require all dependencies to build either a wheel or an sdist.
......
...@@ -28,15 +28,15 @@ fixtures = os.path.join(os.path.dirname(__file__), "builders", "fixtures") ...@@ -28,15 +28,15 @@ fixtures = os.path.join(os.path.dirname(__file__), "builders", "fixtures")
def test_get_requires_for_build_wheel(): 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")): 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(): 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")): 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(): def test_build_wheel():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment