Project-specific pip configuration?

I’m looking for a way to save pip configuration that’s specific to the project.

In particular, I’d like to tell it to use --no-build-isolation when doing an editable install. [*]

what I see is:

  • global: system-wide configuration file, shared across users.
  • user: per-user configuration file.
  • site: per-environment configuration file; i.e. per-virtualenv.

Which all makes sense, and for the most part, is what you want.

But in my case, I’m interested in stuff that has to do with building the project, so is about that project specifically.

Of course, pip is supposed to be a package manager, not a build tool, so ???

Well, the case in point is the somewhat neglected editable option:

As far as I can tell, pip is the only front end that can drive an editable install. The build package doesn’t include that.

So I’d like to be able to tell pip what to do by default for an editable install, for this project.

Hmm – maybe what I really want is for build to support an editable install – is it an install or a build process? it’s both!

Why do I want this?

Because I have a team, and a number of users, that are working with and testing a complex package under development – so editable installs are ideal. But it’s a pain to remember to call --no-build-isolation (and how to spell it) – AND this package has a bunch of C/cython extensions, so it does need to be rebuilt fairly often.

Anyway – ideas welcome – maybe there is a solution already that I’ve missed?

[*] NOTE: what I’d really love is to have --no-build-isolation be the default for editable installs – editable installs really are a different beast – it makes sense to have different defaults – but I suppose that ship has sailed…

This sounds like something that’s actively under design, as part of the wheel-next initiative.

2 Likes

This isn’t quite true, see PEP 660 if you want the full details about how editable installations are standardized. Other tools are capable of installing in editable mode (eg uv) and while I’ve never done this with build, the docs do mention ‘editable’ so seems like they do support it in some form.

I’m not sure if it would actually help you, but this is the request for project level pip configuration: pip should read configuration from `pyproject.toml` for local projects · Issue #13003 · pypa/pip · GitHub

That would just be the project you are working on right now. There are many open design questions and I don’t think anyone is actively working or thinking about it, but the issue is there.

hmm – that doesn’t look like quite the same problem as I have.

Though as someone mentioned in that thread, it’s a " tool UI matter" – which is exactly what I’m looking for.

yup – that is indeed what I am looking for – though it’s stalled, and not at all clear that folks think it’s a good idea. But I’ll keep my eye on it.

Thanks.

Hmm – I need to check out uv again – not sure how well it works in front of scikit-build, which is what I’m using for the hard part of this problem.

As for build – I looked at the command line help for the version I have installed – I’ll go look deeper at the docs.