-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This script, and the associated changes, help avoid strange problems with Python 3, pdbpp, and concurrent.futures related to ordering and side effects from .pth files. Without them, under certain, possibly nondeterministic circumstances, installing zipline's dependencies in Python 3 will cause the concurrent.futures backport to shadow the stdlib module, which breaks pip (among other things) with a SyntaxError.
- Loading branch information
1 parent
cc6acf7
commit 26b07d6
Showing
5 changed files
with
83 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Consolidated installation script for use by both Travis and humans. | ||
# | ||
# First installs a known-good version of pip, then any requirements | ||
# specified in the EXTERNAL_REQUIREMENTS environment variable (e.g., | ||
# coveralls); then installs the project requirements, constrained by | ||
# etc/requirements.txt; then editably installs zipline itself. | ||
# | ||
# Forwards positional arguments to all invocations of pip install. | ||
|
||
set -euo pipefail # Safety mode. | ||
# (Travis' env command doesn't permit options in the shebang line.) | ||
|
||
echo | ||
echo "Installing zipline using $(which python)" | ||
echo | ||
|
||
# New releases of pip have frequently caused strange issues. Make sure | ||
# we know exactly which version we're working with. | ||
python -m pip install pip==19.2.2 $@ | ||
|
||
# Install external requirements first: if they share any of our | ||
# transitive dependencies, we want our pinned versions to win. | ||
if [ "${EXTERNAL_REQUIREMENTS:-}" ]; then | ||
# Note: If EXTERNAL_REQUIREMENTS is unset, the expression in the | ||
# above test expands to the empty string, which fails the test. | ||
# (Simply expanding $EXTERNAL_REQUIREMENTS causes an error with the | ||
# -u option, which helps prevent many other kinds of errors.) | ||
echo "Installing additional packages: $EXTERNAL_REQUIREMENTS" | ||
python -m pip install "$EXTERNAL_REQUIREMENTS" $@ | ||
fi | ||
|
||
# These have to be installed first so that the other requirements can be | ||
# compiled against the specific versions we use. | ||
python -m pip install numpy Cython -c etc/requirements.txt $@ | ||
|
||
# XXX: bcolz has to be compiled against our specific version of numpy: | ||
# by default, it uses an incompatible pre-compiled binary. | ||
python -m pip install --no-binary=bcolz -r etc/requirements.txt -c etc/requirements.txt $@ | ||
|
||
# TODO: resolve these error messages: | ||
# flake8 3.6.0 has requirement setuptools>=30, but you'll have setuptools 28.8.0 which is incompatible. | ||
# Running setup.py (path:[venv]/src/blaze-dev/setup.py) egg_info for package blaze-dev produced metadata for project name blaze. Fix your #egg=blaze-dev fragments. | ||
# blaze keepalive-30.g31060532 has requirement odo>=0.5.0, but you'll have odo 0.3.2+729.gda7f26d which is incompatible. | ||
|
||
python -m pip install -r etc/requirements_dev.txt -c etc/requirements.txt $@ | ||
python -m pip install -r etc/requirements_blaze.txt -c etc/requirements.txt $@ | ||
|
||
# All requirements should already be satisfied by this point. | ||
python -m pip install -e .[all] -c etc/requirements.txt $@ | ||
|
||
echo | ||
echo "Installation complete! Try running 'zipline --help'." | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters