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

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

Closed
1 task done
befeleme opened this issue Mar 3, 2022 · 3 comments · Fixed by #3156
Closed
1 task done

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

befeleme opened this issue Mar 3, 2022 · 3 comments · Fixed by #3156
Labels
enhancement Needs Triage Issues that need to be evaluated for severity and status.

Comments

@befeleme
Copy link
Contributor

befeleme commented Mar 3, 2022

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
@befeleme befeleme added enhancement Needs Triage Issues that need to be evaluated for severity and status. labels Mar 3, 2022
@abravalheri
Copy link
Contributor

abravalheri commented Mar 3, 2022

Hi @befeleme , thank you very much for bringing this up.

Would something like I did in the context o #3049 work for you?

if os.getenv("PRE_BUILT_SETUPTOOLS_SDIST"):
return Path(os.getenv("PRE_BUILT_SETUPTOOLS_SDIST")).resolve()

if os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL"):
return Path(os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL")).resolve()

@befeleme
Copy link
Contributor Author

befeleme commented Mar 4, 2022

Hi @abravalheri, thank you, we could definitely utilize those bits in our environment! :)

@abravalheri
Copy link
Contributor

Perfect, let's extract that part of the PR in a separated one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants