Skip to content

Commit

Permalink
Bundle the build dependencies to re-enable source builds. Fixes #980.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 23, 2017
1 parent 92c5667 commit d801f47
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -13,4 +13,4 @@ setuptools.egg-info
*.swp
*~
.hg*
requirements.txt
build-deps.txt
6 changes: 6 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,9 @@
v34.3.0
-------

* #980: Re-enable building of setuptools from source by
bundling its build dependencies.

v34.2.0
-------

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -12,3 +12,4 @@ include launcher.c
include msvc-build-launcher.cmd
include pytest.ini
include tox.ini
include build-deps.zip
20 changes: 12 additions & 8 deletions bootstrap.py
Expand Up @@ -89,16 +89,20 @@ def install_deps():
shutil.rmtree(tmpdir)


def bundle_deps():
"""
Generate 'build-deps.zip'
"""
gen_deps()
with install_deps() as dir:
shutil.make_archive('build-deps', 'zip', dir)
os.remove('requirements.txt')


def main():
bundle_deps()
ensure_egg_info()
gen_deps()
try:
# first assume dependencies are present
run_egg_info()
except Exception:
# but if that fails, try again with dependencies just in time
with install_deps():
run_egg_info()
run_egg_info()


__name__ == '__main__' and main()
5 changes: 3 additions & 2 deletions setup.py
Expand Up @@ -8,9 +8,10 @@
import sys
import textwrap

import setuptools

here = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(here, 'build-deps.zip')))

import setuptools


def require_metadata():
Expand Down
1 change: 0 additions & 1 deletion tox.ini
@@ -1,7 +1,6 @@
[testenv]
deps=
-rtests/requirements.txt
-rrequirements.txt
passenv=APPDATA USERPROFILE HOMEDRIVE HOMEPATH windir APPVEYOR
commands=py.test {posargs:-rsx}
usedevelop=True
Expand Down

0 comments on commit d801f47

Please sign in to comment.