Skip to content

Conversation

@sth0
Copy link
Contributor

@sth0 sth0 commented Apr 20, 2025

Necessary for tox-py to run tests. See PR#1223
WIP, does not pass 2 tests. Not sure if this is fault of the code or if the asserts have a wrong format?
Does this require the "wheel" package to be installed? I don't think so but I might be misinterpreting the error message of "requirement(wheel).
Error1:

_________________ test_setuptools_get_requires_for_build_wheel _________________

frontend_setuptools = <pyproject_api._via_fresh_subprocess.SubprocessFrontend object at 0x10bfd9c00>

    def test_setuptools_get_requires_for_build_wheel(frontend_setuptools: SubprocessFrontend) -> None:
        result = frontend_setuptools.get_requires_for_build_wheel()
>       assert not result.requires
E       assert not (<Requirement('wheel')>,)
E        +  where (<Requirement('wheel')>,) = RequiresBuildWheelResult(requires=(<Requirement('wheel')>,), out="started backend BackendProxy(backend=<module 'setuptools.build_meta' from '/opt/sw/lib/python3.10/site-packages/setuptools/build_meta.py'>)\nBackend: run command get_requires_for_build_wheel with args {'config_settings': None}\nrunning egg_info\nwriting demo.egg-info/PKG-INFO\nwriting dependency_links to demo.egg-info/dependency_links.txt\nwriting entry points to demo.egg-info/entry_points.txt\nwriting requirements to demo.egg-info/requires.txt\nwriting top-level names to demo.egg-info/top_level.txt\nreading manifest file 'demo.egg-info/SOURCES.txt'\nwriting manifest file 'demo.egg-info/SOURCES.txt'\nBackend: Wrote response {'return': ['wheel']} to /private/tmp/pep517_get_requires_for_build_wheel-bput5dqs.json\n", err="listing git files failed - pretending there aren't any\n").requires

tests/test_frontend_setuptools.py:62: AssertionError

And error 2, which looks like it should pass except the conditions have parenthesis around them

_______________ test_setuptools_prepare_metadata_for_build_wheel _______________

frontend_setuptools = <pyproject_api._via_fresh_subprocess.SubprocessFrontend object at 0x10bfd9c00>
tmp_path = PosixPath('/private/tmp/pytest-of-fink-bld/pytest-0/test_setuptools_prepare_metada0')

    def test_setuptools_prepare_metadata_for_build_wheel(frontend_setuptools: SubprocessFrontend, tmp_path: Path) -> None:
        meta = tmp_path / "meta"
        result = frontend_setuptools.prepare_metadata_for_build_wheel(metadata_directory=meta)
        assert result is not None
        dist = Distribution.at(str(result.metadata))
        assert list(dist.entry_points) == [EntryPoint(name="demo_exe", value="demo:a", group="console_scripts")]
        assert dist.version == "1.0"
        assert dist.metadata["Name"] == "demo"
        values = [v for k, v in dist.metadata.items() if k == "Requires-Dist"]  # type: ignore[attr-defined]
        # ignore because "PackageMetadata" has no attribute "items"
        expected = ["magic>3", "requests>2"] if sys.version_info[0:2] > (3, 8) else ["magic >3", "requests >2"]
>       assert sorted(values) == expected
E       AssertionError: assert ['magic (>3)', 'requests (>2)'] == ['magic>3', 'requests>2']
E         At index 0 diff: 'magic (>3)' != 'magic>3'
E         Full diff:
E         - ['magic>3', 'requests>2']
E         + ['magic (>3)', 'requests (>2)']
E         ?        ++  +            ++  +

tests/test_frontend_setuptools.py:78: AssertionError

Necessary for tox-py to run tests.  See PR#1223
@sth0 sth0 added help wanted new package Packages that do not yet exist in Fink. labels Apr 20, 2025
@sth0 sth0 self-assigned this Apr 20, 2025
@dmacks
Copy link
Member

dmacks commented Jun 21, 2025

New upstream 1.9.1 mentions a fix regarding dropping requirement for wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted new package Packages that do not yet exist in Fink.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants