setup: simplify makefile's path manipulation now that we rely on setup.py develop

This commit is contained in:
Zooko O'Whielacronx 2008-03-26 10:00:33 -07:00
parent f4d51ea366
commit 39272a1b6d
2 changed files with 8 additions and 36 deletions

View File

@ -48,26 +48,22 @@ endif
build-deps: build-deps:
echo "This is done automatically (by delegating to setuptools) now." echo "This is done automatically (by delegating to setuptools) now."
EGGSPATH = $(shell $(PYTHON) misc/find-dep-eggs.py)
ifneq ($(PYTHONPATH),) ifneq ($(PYTHONPATH),)
PYTHONPATH := $(PYTHONPATH)$(PATHSEP) PP=PYTHONPATH="$(PYTHONPATH)$(PATHSEP)$(SUPPORTLIB)"
else
PP=PYTHONPATH="$(SUPPORTLIB)"
endif endif
PP=PYTHONPATH="$(SRCPATH)$(PATHSEP)$(PYTHONPATH)$(PATHSEP)$(EGGSPATH)"
TRIALCMD = $(shell $(PP) $(PYTHON) misc/find_trial.py) TRIALCMD = $(shell $(PP) $(PYTHON) misc/find_trial.py)
TRIAL=PYTHONUNBUFFERED=1 $(TRIALCMD) --rterrors $(REACTOROPT) TRIAL=PYTHONUNBUFFERED=1 $(TRIALCMD) --rterrors $(REACTOROPT)
.PHONY: make-version build .PHONY: make-version build
show-eggspath:
@echo $(EGGSPATH)
# The 'darcsver' setup.py command comes in the 'darcsver' package: # The 'darcsver' setup.py command comes in the 'darcsver' package:
# http://pypi.python.org/pypi/darcsver It is necessary only if you want to # http://pypi.python.org/pypi/darcsver It is necessary only if you want to
# automatically produce a new _version.py file from the current darcs history. # automatically produce a new _version.py file from the current darcs history.
make-version: make-version:
$(PYTHON) ./setup.py darcsver --count-all-patches $(PP) $(PYTHON) ./setup.py darcsver --count-all-patches
# We want src/allmydata/_version.py to be up-to-date, but it's a fairly # We want src/allmydata/_version.py to be up-to-date, but it's a fairly
# expensive operation (about 6 seconds on a just-before-0.7.0 tree, probably # expensive operation (about 6 seconds on a just-before-0.7.0 tree, probably
@ -100,8 +96,7 @@ src/allmydata/_version.py:
build: src/allmydata/_version.py build: src/allmydata/_version.py
mkdir -p "$(SUPPORTLIB)" mkdir -p "$(SUPPORTLIB)"
PYTHONPATH="$(PYTHONPATH)$(PATHSEP)$(SUPPORTLIB)$(PATHSEP)" \ $(PP) $(PYTHON) ./setup.py develop --prefix="$(SUPPORT)"
$(PYTHON) ./setup.py develop --prefix="$(SUPPORT)"
chmod +x bin/tahoe chmod +x bin/tahoe
touch .built touch .built
@ -167,13 +162,13 @@ check-auto-deps:
check-all-deps: check-deps check-auto-deps check-all-deps: check-deps check-auto-deps
check-twisted-dep: check-twisted-dep:
@$(PYTHON) -c 'import twisted, zope.interface' || $(MAKE) signal-error-twisted-dep @$(PP) $(PYTHON) -c 'import twisted, zope.interface' || $(MAKE) signal-error-twisted-dep
check-pywin32-dep: check-pywin32-dep:
@$(PYTHON) -c 'import win32process' || $(MAKE) signal-error-pywin32-dep @$(PP) $(PYTHON) -c 'import win32process' || $(MAKE) signal-error-pywin32-dep
check-pyopenssl-dep: check-pyopenssl-dep:
@$(PYTHON) -c 'import OpenSSL' || $(MAKE) signal-error-pyopenssl-dep @$(PP) $(PYTHON) -c 'import OpenSSL' || $(MAKE) signal-error-pyopenssl-dep
check-deps: check-twisted-dep $(CHECK_PYWIN32_DEP) check-pyopenssl-dep check-deps: check-twisted-dep $(CHECK_PYWIN32_DEP) check-pyopenssl-dep

View File

@ -1,23 +0,0 @@
#! /usr/bin/python
import os.path, sys
path = []
if sys.platform == 'win32':
support_lib = "support/Lib/site-packages"
else:
pyver = "python%d.%d" % (sys.version_info[:2])
support_lib = "support/lib/%s/site-packages" % pyver
if os.path.exists(support_lib):
for fn in os.listdir(support_lib):
if fn.endswith(".egg"):
path.append(os.path.abspath(os.path.join(support_lib, fn)))
# We also need to include .egg's in the CWD, because if there is an .egg there
# then "make build-deps" will take that as satisfying its requirements.
for fn in os.listdir("."):
if fn.endswith(".egg"):
path.append(os.path.abspath(os.path.join(os.getcwd(), fn)))
print os.pathsep.join(path)