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

rough outline of a "conda develop" using pypa/build #5380

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dholth
Copy link
Contributor

@dholth dholth commented Jun 18, 2024

Description

This is how to create and install an editable wheel with pypa/build, as a replacement for "conda develop". At each step we have the opportunity to install dependencies using our preferred installer instead of pip.

#4251

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@dholth
Copy link
Contributor Author

dholth commented Jun 18, 2024

This is what pypa/build's cli does to build an ordinary wheel in its own environment, providing pip or uv as the available installers. We could add a conda installer.

def _build_in_isolated_env(
    srcdir: StrPath,
    outdir: StrPath,
    distribution: Distribution,
    config_settings: ConfigSettings | None,
    installer: _env.Installer,
) -> str:
    with DefaultIsolatedEnv(installer=installer) as env:
        builder = ProjectBuilder.from_isolated_env(env, srcdir)
        # first install the build dependencies
        env.install(builder.build_system_requires)
        # then get the extra required dependencies from the backend (which was installed in the call above :P)
        env.install(builder.get_requires_for_build(distribution, config_settings or {}))
        return builder.build(distribution, outdir, config_settings or {})


if uninstall:
raise NotImplementedError("nope")
# uninstall then exit - does not do any other operations
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask them to use conda uninstall or pip uninstall since these are installed like standard Python packages

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we convert the ephemeral wheel into a conda package and install that instead? Or would it be too much trouble to avoid keeping that in conda's package cache?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

2 participants