diff --git a/.travis.yml b/.travis.yml index 5580efe..011feea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,54 +1,27 @@ dist: xenial - language: python matrix: include: - - name: "Python 3.6 Unit Test" - python: 3.6 - env: PYTHON_VERSION=3.6 NAME="UNIT" - name: "Python 3.6 Lint" python: 3.6 env: PYTHON_VERSION=3.6 NAME="LINT" - -addons: - apt: - packages: - - docker-ce - -before_install: - - docker pull conda/miniconda3 - - docker --version + - name: "Python 3.6 Unit Test" + python: 3.6 + env: PYTHON_VERSION=3.6 NAME="UNIT" install: - # Build docker image - - . ./scripts/container.sh --build - - # Print conda details - - docker run --rm symbolic-pymc:latest bash -c "conda info -a" - - # Print conda environment details - - docker run --rm symbolic-pymc:latest bash -c "conda list && pip freeze" - - # Install packages needed for service integration - - if [[ $NAME == UNIT ]]; then pip install coveralls ; fi - - if [[ $NAME == LINT ]]; then pip install coveralls ; fi + - pip install -r requirements.txt + - pip install -r requirements-dev.txt + - if [[ $NAME == UNIT ]]; then pip install coveralls; fi + - pip freeze script: - - # Tests command is default in dockerfile cmd - - if [[ $NAME == UNIT ]]; then docker run --mount type=bind,source="$(pwd)",target=/opt/symbolic-pymc --name symbolic_pymc_test symbolic-pymc:latest bash -c \ - "pytest -v tests/ --cov=symbolic_pymc/"; - fi - - - if [[ $NAME == LINT ]]; then docker run symbolic-pymc:latest bash -c "make lint"; - fi + - if [[ $NAME == UNIT ]]; then pytest -v tests/ --cov=symbolic_pymc/; fi + - if [[ $NAME == LINT ]]; then make lint; fi after_success: - echo $(pwd) - ls -la - if [[ $NAME == UNIT ]]; then sed -i 's/\/opt\/symbolic-pymc/\/home\/travis\/build\/pymc-devs\/symbolic-pymc/g' .coverage; fi - if [[ $NAME == UNIT ]]; then coveralls; fi - - - if [[ $NAME == LINT ]]; then sed -i 's/\/opt\/symbolic-pymc/\/home\/travis\/build\/pymc-devs\/symbolic-pymc/g' .coverage; fi - - if [[ $NAME == LINT ]]; then coveralls; fi diff --git a/requirements.txt b/requirements.txt index 4292f5f..dbf38d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,11 @@ +scipy>=1.2.0 Theano>=1.0.4 -pymc3>=3.6 -tf-estimator-nightly>=1.14.0.dev2019021101 -tf-nightly>=1.14.1.dev20190320 +tf-nightly-2.0-preview>=2.0.0.dev20190526 tfp-nightly>=0.7.0.dev20190320 +pymc3>=3.6 pymc4 @ git+https://github.com/pymc-devs/pymc4.git@master#egg=pymc4-0.0.1 multipledispatch>=0.6.0 unification>=0.2.2 kanren @ git+https://github.com/pymc-devs/kanren.git@symbolic-pymc#egg=kanren-0.2.3 toolz>=0.9.0 sympy>=1.3 -scipy>=1.2.0 diff --git a/scripts/Dockerfile b/scripts/Dockerfile deleted file mode 100644 index e64e523..0000000 --- a/scripts/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -FROM conda/miniconda3 - -LABEL maintainer="PyMC Devs https://github.com/pymc-devs/symbolic-pymc" - -ARG SRC_DIR -ARG PYTHON_VERSION - -ENV PYTHON_VERSION=${PYTHON_VERSION} - - -# Change behavior of create_test.sh script -ENV DOCKER_BUILD=true - -# For Sphinx documentation builds -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 - -# Update container -RUN apt-get update && apt-get install -y git build-essential pandoc vim \ - && rm -rf /var/lib/apt/lists/* - - -# Copy requirements and environment installation scripts -COPY $SRC_DIR/requirements.txt opt/symbolic-pymc/ -COPY $SRC_DIR/requirements-dev.txt opt/symbolic-pymc/ -COPY $SRC_DIR/scripts/create_testenv.sh opt/symbolic-pymc/scripts/create_testenv.sh -WORKDIR /opt/symbolic-pymc - - -# Create conda environment. Defaults to Python 3.6 -RUN ./scripts/create_testenv.sh - - -# Set automatic conda activation in non interactive and shells -ENV BASH_ENV="/root/activate_conda.sh" -RUN echo ". /root/activate_conda.sh" > /root/.bashrc - - -# Remove conda cache -RUN conda clean --all - -COPY $SRC_DIR /opt/symbolic-pymc - -# Clear any cached files from copied from host filesystem -RUN find -type d -name __pycache__ -exec rm -rf {} + diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index e2ea806..0000000 --- a/scripts/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Docker FAQ - -* Image can be built locally using the command `make docker` or the command - `./scripts/container.sh --build` from the root `symbolic-pymc` directory - -* After image is built an interactive bash session can be run - `docker run -it symbolic-pymc bash` - -* Command can be issued to the container such as linting and testing - without interactive session - * `docker run symbolic-pymc bash -c "pytest tests"` diff --git a/scripts/container.sh b/scripts/container.sh deleted file mode 100755 index bf7333d..0000000 --- a/scripts/container.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/bash -SRC_DIR=${SRC_DIR:-`pwd`} - -# Build container for use of testing -if [[ $* == *--build* ]]; then - echo "Building Docker Image" - docker build \ - -t symbolic-pymc \ - -f $SRC_DIR/scripts/Dockerfile \ - --build-arg SRC_DIR=. $SRC_DIR \ - --rm -fi - -if [[ $* == *--clear_cache* ]]; then - echo "Removing cached files" - find -type d -name __pycache__ -exec rm -rf {} + -fi - -if [[ $* == *--test* ]]; then - echo "Testing symbolic-pymc" - docker run --mount type=bind,source="$(pwd)",target=/opt/symbolic-pymc/ symbolic-pymc:latest bash -c \ - "pytest -v tests/ --cov=symbolic-pymc/" -fi diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh deleted file mode 100755 index 346c6aa..0000000 --- a/scripts/create_testenv.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -set -ex # fail on first error, print commands - -command -v conda >/dev/null 2>&1 || { - echo "Requires conda but it is not installed. Run install_miniconda.sh." >&2; - exit 1; -} - -# if no python specified, use Travis version, or else 3.6 -PYTHON_VERSION=${PYTHON_VERSION:-${TRAVIS_PYTHON_VERSION:-3.6}} - - -if [[ $* != *--global* ]]; then - ENVNAME="testenv_${PYTHON_VERSION}" - - if conda env list | grep -q ${ENVNAME} - then - echo "Environment ${ENVNAME} already exists, keeping up to date" - else - echo "Creating environment ${ENVNAME}" - conda create -n ${ENVNAME} --yes pip python=${PYTHON_VERSION} - fi - - # Activate environment immediately - source activate ${ENVNAME} - - if [ "$DOCKER_BUILD" = true ] ; then - # Also add it to root bash settings to set default if used later - - echo "Creating .bashrc profile for docker image" - echo "set conda_env=${ENVNAME}" > /root/activate_conda.sh - echo "source activate ${ENVNAME}" >> /root/activate_conda.sh - - - fi -fi - - -# Install dependencies -pip install --upgrade pip - - -# Install editable using the setup.py -pip install --no-cache-dir -r requirements.txt -pip install --no-cache-dir -r requirements-dev.txt