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

Document how to bootstrap flit_core #441

Merged
merged 2 commits into from Oct 10, 2021
Merged

Document how to bootstrap flit_core #441

merged 2 commits into from Oct 10, 2021

Conversation

takluyver
Copy link
Member

Mainly for people putting Python packages into other packaging systems.

@nanonyme
Copy link
Contributor

nanonyme commented Sep 5, 2021

This is really awesome, especially if we eventually move towards a situation that things like setuptools require PEP517 to build. (currently it self-bootstraps) The only thing I'm a bit concerned about is that unpacking wheels seems not a really straightforward operation when it comes to entrypoints. There is no processor for those except for pip as far as I've understood and that makes the bootstrapping cycle more complex.

@nanonyme
Copy link
Contributor

nanonyme commented Sep 5, 2021

I was just for PoC trying to see if I can follow this chain. It looks like flit stage 1 -> tomli -> flit -> pep517 works but then build requires setuptools and wheel (wheel also requires setuptools). Setuptools in turn can be built either through setup.py or through build/pip. But pip requires setuptools to be built. There seem to be cycles in this bootstrapping chain. Did I miss something?

It would at least break the chain if build and wheel were converted to be built with flit. Wheel does not even have a pyproject.toml at this point.

@takluyver
Copy link
Member Author

Thanks for trying it out! I would imagine that setuptools is meant to self-bootstrap in a vaguely similar way to flit-core, but right now it looks like there's a cycle between setuptools & wheel in a fully PEP-517 world. You can presumably get round that by using the 'old way' setup.py install to install setuptools. It's up to them whether that's just what you have to do, or whether there will be a solution for PEP 517 bootstrapping.

Packaging wheel with flit_core would also break the cycle. I always try not to push Flit on anyone, though.

unpacking wheels seems not a really straightforward operation when it comes to entrypoints. There is no processor for those except for pip as far as I've understood...

There's the installer project. It's still quite new & rough, but this is meant to be the low-level tool for this purpose (in partnership with build).

I hope that all of the packages you need to get build & installer can be installed as plain libraries - i.e. just unzip the wheel, no entry points required. Some of them may have non-essential entry points, though.

@nanonyme
Copy link
Contributor

nanonyme commented Sep 29, 2021

I see. So then the chain would probably be installer-stage1 (just lumped somewhere, added to PYTHONPATH)->flit_core->tomli->installer+tomli-w->flit to get entrypoints fully set up. (flit itself even has one)

@nanonyme
Copy link
Contributor

I'll have another round of testing with that set of tooling at some point.

@takluyver
Copy link
Member Author

Yup. The flit package isn't especially important for bootstrapping - flit_core is what really builds packages, flit is mainly handy developer tooling around that.

@takluyver takluyver merged commit a2920ba into master Oct 10, 2021
@takluyver takluyver deleted the doc-bootstrap branch October 10, 2021 09:14
@takluyver takluyver added this to the 3.4 milestone Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants