pypa / pypa/setuptools

[FR] Allow bootstraping setuptools by running dependencies from source

Open
#2,828 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

What's the problem this feature will solve?

setuptools requires wheel to be installed to bootstrap itself, but wheel requires setuptools to build, preventing bootstrapping.

Even though setuptools now bootstraps itself via a PEP 517 builder, not everyone is able to do the same. Linux distributions, for example, need to bootstrap it from scratch.

Describe the solution you'd like

I would like an option, perhaps an environment variable, to skip the dependency checks, and to make the bdist_wheel command always available.
The easiest way to do this bootstrapping is to run everything from source, which trips up setuptools' dependency checks, and also as a consequence makes the bdist_wheel command unavailable.

Alternative Solutions

I have written https://github.com/FFY00/python-bootstrap to help with this task, but currently, I need to run setup.py egg_info on setuptools, copy that to the package directory, in order to trick setuptools to think it is installed, and then do the same for wheel, only after that I can actually build wheels for setuptools and wheel.
https://github.com/FFY00/python-bootstrap/blob/4004fda86bc82470b0ee1b564764f8ba9960b493/bootstrap/build.py#L43
https://github.com/FFY00/python-bootstrap/blob/bf68a5ff74706e348de1f3dddeaf51bc5f37a449/bootstrap/__init__.py#L109
See https://github.com/pypa/setuptools/issues/2088#issuecomment-950233014 for more details.

Ideally, setuptools would actually be able to bootstrap itself without any dependencies.
See https://github.com/takluyver/flit/tree/master/flit_core for example.

Additional context

No response

Code of Conduct
  • I agree to follow the PSF Code of Conduct

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the referenced bootstrap/build.py and bootstrap/init.py files, then run the setup.py egg_info steps described in the issue to understand the dependency checks. The work is complete when setuptools and wheel can be bootstrapped from source without preinstalled dependencies, while bdist_wheel remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.