Skip to content

[FR] Tests: provide a way to point to a custom setuptools wheel #3147

@befeleme

Description

@befeleme

What's the problem this feature will solve?

I want to update setuptools to 60.9.3 in Fedora. In our build environment there's no internet access. This means that tests using among others a newly added fixture setuptools_wheel have to be disabled, as this fixture uses module build which needs internet to install wheel. But, during the build, we create our own setuptools' wheel which could well be accessed and used by the tests.

Describe the solution you'd like

If the fixture was enhanced to first look at a customizable location (eg. by an environment variable) and if not found, proceed to the current logic, this could bypass the internet issue. As this feature could find other use cases, would you be interested in such enhancement? Do you have any suggestions about the preferred approach?

PoC working in our case:

def setuptools_wheel(tmp_path_factory, request):
    if 'LOCAL_WHEELDIR' in os.environ:
        for filename in os.listdir(os.environ['LOCAL_WHEELDIR']):
            if filename.endswith(".whl"):
                return os.path.join(os.environ['LOCAL_WHEELDIR'], filename)
    with contexts.session_locked_tmp_dir(request, tmp_path_factory, "wheel_build") as tmp:
        <snip>

Alternative Solutions

No response

Additional context

No response

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions