Skip to content

Commit

Permalink
MAINT: Renamed requirements.txt to requirements_locked.txt
Browse files Browse the repository at this point in the history
since it's the generated lockfile
  • Loading branch information
richafrank committed Feb 11, 2020
1 parent 555d1df commit 23f1580
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
24 changes: 12 additions & 12 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ install:
# this installs the appropriate Miniconda (Py2/Py3, 32/64 bit),
- powershell .\ci\appveyor\install.ps1
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
- sed -i "s/numpy==.*/numpy==%NUMPY_VERSION%/" etc/requirements.txt
- sed -i "s/pandas==.*/pandas==%PANDAS_VERSION%/" etc/requirements.txt
- sed -i "s/scipy==.*/scipy==%SCIPY_VERSION%/" etc/requirements.txt
- IF NOT "%PANDAS_DATAREADER_VERSION%"=="" sed -i "s/pandas-datareader==.*/pandas-datareader==%PANDAS_DATAREADER_VERSION%/" etc/requirements.txt
- IF NOT "%DASK_VERSION%"=="" sed -i "s/dask\[dataframe\]==.*/dask\[dataframe\]==%DASK_VERSION%/" etc/requirements.txt
- cat etc/requirements.txt
- sed -i "s/numpy==.*/numpy==%NUMPY_VERSION%/" etc/requirements_locked.txt
- sed -i "s/pandas==.*/pandas==%PANDAS_VERSION%/" etc/requirements_locked.txt
- sed -i "s/scipy==.*/scipy==%SCIPY_VERSION%/" etc/requirements_locked.txt
- IF NOT "%PANDAS_DATAREADER_VERSION%"=="" sed -i "s/pandas-datareader==.*/pandas-datareader==%PANDAS_DATAREADER_VERSION%/" etc/requirements_locked.txt
- IF NOT "%DASK_VERSION%"=="" sed -i "s/dask\[dataframe\]==.*/dask\[dataframe\]==%DASK_VERSION%/" etc/requirements_locked.txt
- cat etc/requirements_locked.txt
- conda info -a
- conda install conda=4.3.30 conda-build=3.0.28 anaconda-client=1.6.3 --yes -q
- conda list
Expand All @@ -97,15 +97,15 @@ install:
# test that we can conda install zipline in a new env
- conda create -n installenv --yes -q --use-local python=%PYTHON_VERSION% numpy=%NUMPY_VERSION% zipline -c quantopian -c https://conda.anaconda.org/quantopian/label/ci

- ps: $env:BCOLZ_VERSION=(sls "bcolz==([^ ]*)" .\etc\requirements.txt -ca).matches.groups[1].value
- ps: $env:NUMEXPR_VERSION=(sls "numexpr==([^ ]*)" .\etc\requirements.txt -ca).matches.groups[1].value
- ps: $env:PYTABLES_VERSION=(sls "tables==([^ ]*)" .\etc\requirements.txt -ca).matches.groups[1].value
- ps: $env:H5PY_VERSION=(sls "h5py==([^ ]*)" .\etc\requirements.txt -ca).matches.groups[1].value
- ps: $env:TALIB_VERSION=(sls "ta-lib==([^ ]*)" .\etc\requirements.txt -ca).matches.groups[1].value
- ps: $env:BCOLZ_VERSION=(sls "bcolz==([^ ]*)" .\etc\requirements_locked.txt -ca).matches.groups[1].value
- ps: $env:NUMEXPR_VERSION=(sls "numexpr==([^ ]*)" .\etc\requirements_locked.txt -ca).matches.groups[1].value
- ps: $env:PYTABLES_VERSION=(sls "tables==([^ ]*)" .\etc\requirements_locked.txt -ca).matches.groups[1].value
- ps: $env:H5PY_VERSION=(sls "h5py==([^ ]*)" .\etc\requirements_locked.txt -ca).matches.groups[1].value
- ps: $env:TALIB_VERSION=(sls "ta-lib==([^ ]*)" .\etc\requirements_locked.txt -ca).matches.groups[1].value
# We conda install certifi at the pinned exact version because it is a transitive dependency of zipline via requests and uses distutils for packaging.
# Since conda installs latest certifi by default, we would fail to uninstall that new version when trying to install the pinned version using pip later in the build:
# "Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall."
- ps: $env:CERTIFI_VERSION=(sls "certifi==([^ ]*)" .\etc\requirements.txt -ca).matches.groups[1].value
- ps: $env:CERTIFI_VERSION=(sls "certifi==([^ ]*)" .\etc\requirements_locked.txt -ca).matches.groups[1].value
- conda create -n testenv --yes -q --use-local "pip<19" python=%PYTHON_VERSION% numpy=%NUMPY_VERSION% pandas=%PANDAS_VERSION% scipy=%SCIPY_VERSION% ta-lib=%TALIB_VERSION% bcolz=%BCOLZ_VERSION% numexpr=%NUMEXPR_VERSION% pytables=%PYTABLES_VERSION% h5py=%H5PY_VERSION% certifi=%CERTIFI_VERSION% -c quantopian -c https://conda.anaconda.org/quantopian/label/ci
- activate testenv
- bash etc/dev-install --cache-dir=%LOCALAPPDATA%\pip\Cache\pip_np%CONDA_NPY%py%CONDA_PY%
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ before_install:
NUMPY_VERSION=1.14.1 PANDAS_VERSION=0.22.0 SCIPY_VERSION=1.0.0 PANDAS_DATAREADER_VERSION=0.4.0 DASK_VERSION=0.17.1
fi
- source ./ci/travis/overwrite_requirements.sh
- cat etc/requirements.txt
- cat etc/requirements_locked.txt

install:
- conda info -a
- conda install conda=4.3.30 conda-build=3.0.28 anaconda-client=1.6.3 --yes -q
- conda list

- TALIB_VERSION=$(cat ./etc/requirements.txt | grep "ta-lib" | sed "s/ta-lib==\([^ ]*\) *.*/\1/")
- CERTIFI_VERSION=$(cat ./etc/requirements.txt | grep "certifi" | sed "s/certifi==\([^ ]*\) *.*/\1/")
- TALIB_VERSION=$(cat ./etc/requirements_locked.txt | grep "ta-lib" | sed "s/ta-lib==\([^ ]*\) *.*/\1/")
- CERTIFI_VERSION=$(cat ./etc/requirements_locked.txt | grep "certifi" | sed "s/certifi==\([^ ]*\) *.*/\1/")
- IFS='.' read -r -a NPY_VERSION_ARR <<< "$NUMPY_VERSION"
- CONDA_NPY=${NPY_VERSION_ARR[0]}${NPY_VERSION_ARR[1]}
- CONDA_PY=$TRAVIS_PYTHON_VERSION
Expand Down
10 changes: 5 additions & 5 deletions ci/travis/overwrite_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ else
}
fi

sed_inplace "s/numpy==.*/numpy==$NUMPY_VERSION/" etc/requirements.txt
sed_inplace "s/pandas==.*/pandas==$PANDAS_VERSION/" etc/requirements.txt
sed_inplace "s/scipy==.*/scipy==$SCIPY_VERSION/" etc/requirements.txt
sed_inplace "s/numpy==.*/numpy==$NUMPY_VERSION/" etc/requirements_locked.txt
sed_inplace "s/pandas==.*/pandas==$PANDAS_VERSION/" etc/requirements_locked.txt
sed_inplace "s/scipy==.*/scipy==$SCIPY_VERSION/" etc/requirements_locked.txt
if [ -n "$PANDAS_DATAREADER_VERSION" ]; then
sed_inplace "s/pandas-datareader==.*/pandas-datareader==$PANDAS_DATAREADER_VERSION/" etc/requirements.txt
sed_inplace "s/pandas-datareader==.*/pandas-datareader==$PANDAS_DATAREADER_VERSION/" etc/requirements_locked.txt
fi
if [ -n "$DASK_VERSION" ]; then
sed_inplace "s/dask\[dataframe\]==.*/dask\[dataframe\]==$DASK_VERSION/" etc/requirements.txt
sed_inplace "s/dask\[dataframe\]==.*/dask\[dataframe\]==$DASK_VERSION/" etc/requirements_locked.txt
fi
8 changes: 4 additions & 4 deletions docs/source/development-guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Then run ``pip install`` TA-lib:

.. code-block:: bash
$ pip install -r ./etc/requirements_talib.in -c ./etc/requirements.txt
$ pip install -r ./etc/requirements_talib.in -c ./etc/requirements_locked.txt
You should now be free to run tests:

Expand Down Expand Up @@ -154,7 +154,7 @@ If you update the zipline codebase so that it now depends on a new version of a
then you should update the lower bound on that dependency in ``etc/requirements.in``
(or ``etc/requirements_dev.in`` as appropriate).
We use `pip-compile`__ to find mutually compatible versions of dependencies for the
``etc/requirements.txt`` lockfile used in our CI environments.
``etc/requirements_locked.txt`` lockfile used in our CI environments.

__ https://github.com/jazzband/pip-tools/

Expand All @@ -163,7 +163,7 @@ you need to re-run the ``pip-compile`` command included in the header of `the lo
otherwise the lockfile will not meet the constraints specified to pip by zipline
at install time (via ``etc/requirements.in`` via ``setup.py``).

__ https://github.com/quantopian/zipline/tree/master/etc/requirements.txt
__ https://github.com/quantopian/zipline/tree/master/etc/requirements_locked.txt

If the zipline codebase can still support an old version of a dependency, but you want
to update to a newer version of that library in our CI environments, then only the
Expand Down Expand Up @@ -194,7 +194,7 @@ __ http://www.sphinx-doc.org/en/stable/

.. code-block:: bash
$ pip install -r ./etc/requirements_docs.txt
$ pip install -r ./etc/requirements_docs.in -c ./etc/requirements_locked.txt
To build and view the docs locally, run:

Expand Down
6 changes: 3 additions & 3 deletions etc/dev-install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.
# etc/requirements_locked.txt; then editably installs zipline itself.
#
# Forwards positional arguments to all invocations of pip install.

Expand Down Expand Up @@ -34,11 +34,11 @@ 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 -r etc/requirements_build.in -c etc/requirements.txt $@
python -m pip install -r etc/requirements_build.in -c etc/requirements_locked.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 -e .[all] -r etc/requirements_blaze.in -c etc/requirements.txt $@
python -m pip install --no-binary=bcolz -e .[all] -r etc/requirements_blaze.in -c etc/requirements_locked.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.
Expand Down
2 changes: 1 addition & 1 deletion etc/requirements.txt → etc/requirements_locked.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --no-index --output-file=etc/requirements.txt etc/requirements.in etc/requirements_blaze.in etc/requirements_build.in etc/requirements_dev.in etc/requirements_docs.in etc/requirements_talib.in
# pip-compile --no-index --output-file=etc/requirements_locked.txt etc/requirements.in etc/requirements_blaze.in etc/requirements_build.in etc/requirements_dev.in etc/requirements_docs.in etc/requirements_talib.in
#
-e git+git://github.com/quantopian/blaze.git@f26375a6708eab85b7acc7869d6c518df2f974eb#egg=blaze
-e git+git://github.com/quantopian/datashape.git@cae16a85406ca4302ff1f985b74a3809be0a83a1#egg=datashape
Expand Down
4 changes: 2 additions & 2 deletions vagrant_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ echo "Installing pip and setuptools..." | tee -a "$VAGRANT_LOG"
wget https://bootstrap.pypa.io/get-pip.py 2>&1 | tee -a "$VAGRANT_LOG"
python get-pip.py 2>&1 >> "$VAGRANT_LOG" | tee -a "$VAGRANT_LOG"
echo "Installing zipline python dependencies..." | tee -a "$VAGRANT_LOG"
pip install -r /vagrant/etc/requirements.in -r 2>&1 /vagrant/etc/requirements_dev.in -c /vagrant/etc/requirements.txt | tee -a "$VAGRANT_LOG"
pip install -r /vagrant/etc/requirements.in -r 2>&1 /vagrant/etc/requirements_dev.in -c /vagrant/etc/requirements_locked.txt | tee -a "$VAGRANT_LOG"
echo "Installing zipline package itself..." | tee -a "$VAGRANT_LOG"
# Clean out any cython assets. The pip install re-builds them.
find /vagrant/ -type f -name '*.c' -exec rm {} +
pip install -e /vagrant[all] -c /vagrant/etc/requirements.txt 2>&1 | tee -a "$VAGRANT_LOG"
pip install -e /vagrant[all] -c /vagrant/etc/requirements_locked.txt 2>&1 | tee -a "$VAGRANT_LOG"
echo "Finished! zipline repo is in '/vagrant'." | tee -a "$VAGRANT_LOG"

0 comments on commit 23f1580

Please sign in to comment.