question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to bootstrap setuptools from source

See original GitHub issue

Hi, I’m a developer for the Spack package manager. We’ve had a setuptools package that has worked fine for a while now, and the vast majority of our Python packages depend on it. However, I went to update to the latest version of setuptools and noticed that it now depends on six, packaging, and appdirs. Unfortunately all 3 of these packages also depend on setuptools. six and packaging can fall back on distutils.core if necessary, but the setup.py for appdirs has a hard setuptools import.

It seems to me like it is no longer possible to build setuptools from source. Is this correct??

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:73 (43 by maintainers)

github_iconTop GitHub Comments

12reactions
jaracocommented, May 31, 2017

With Setuptools 36, it once again vendors its dependencies.

9reactions
dstufftcommented, Feb 23, 2017

So there exist systems where given a set of dependencies (python and otherwise) build everything from source is a requirement. This gets complicated when you have circular dependencies. Imagine a situation where you want to install setuptools:

  1. You have a source tarball of setuptools, so you build a setuptools binary (it can be a wheel or some other system it doesn’t matter). This works with the PR in #982 just fine.
  2. You discover that setuptools requires packaging, six, appdirs.
  3. You attempt to build appdirs from source, which requires setuptools to build, so you attempt to go and install setuptools, which fails because while you have a setuptools binary package you don’t have it’s runtime packages.

AFAICT having setuptools depend on anything which itself depends on setuptools (build or runtime) is always going to make an assumption that you have somehow managed to have a copy of setuptools + all dependencies already built already available. Any system which cannot have that assumption will not work.

This isn’t unique to setuptools either. Even with PEP 518 a build tool is not going to be able to depend on itself directly or transitively without breaking from scratch source rebuilds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python
Run this script to install or upgrade setuptools. This method is DEPRECATED. Check https://github.com/pypa/setuptools/issues/581 for more details. """ import os ...
Read more >
Getting Started With setuptools and setup.py
This tutorial will focus on the bare minimum basics you need to get setuptools running so you can: Register your package on pypi....
Read more >
setuptools 3.7
The recommended way to bootstrap setuptools on any system is to download ez_setup.py and run it using the target Python environment.
Read more >
Bootstrapping a specific version of pip - Packaging
Install pip by adding the source code for pip/setuptools/wheel to the PYTHONPATH · Install wheel using pip by adding the source code for...
Read more >
How to Bootstrap numpy installation in setup.py
The following works at least with numpy1.8 and python{2.6,2.7,3.3}: from setuptools import setup from setuptools.command.build_ext import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found