diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000000..e4b924767b --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,84 @@ +name: pytest + +on: + pull_request: + push: + branches: [master] + +jobs: + pytest: + strategy: + matrix: + python-version: ["3.6"] + os: [ubuntu-18.04] + floatx: [float32, float64] + test-subset: + - | + --ignore=pymc3/tests/test_examples.py + --ignore=pymc3/tests/test_distributions_random.py + --ignore=pymc3/tests/test_variational_inference.py + --ignore=pymc3/tests/test_shared.py + --ignore=pymc3/tests/test_smc.py + --ignore=pymc3/tests/test_updates.py + --ignore=pymc3/tests/test_posteriors.py + --ignore=pymc3/tests/test_sampling.py + --ignore=pymc3/tests/test_parallel_sampling.py + --ignore=pymc3/tests/test_dist_math.py + --ignore=pymc3/tests/test_distribution_defaults.py + --ignore=pymc3/tests/test_distributions_timeseries.py + --ignore=pymc3/tests/test_random.py + --ignore=pymc3/tests/test_gp.py + --ignore=pymc3/tests/test_shape_handling + --ignore=pymc3/tests/test_quadpotential.py + - | + pymc3/tests/test_distributions_random.py + pymc3/tests/test_shared.py + pymc3/tests/test_smc.py + pymc3/tests/test_sampling.py + pymc3/tests/test_parallel_sampling.py + pymc3/tests/test_dist_math.py + pymc3/tests/test_distribution_defaults.py + pymc3/tests/test_distributions_timeseries.py + pymc3/tests/test_random.py + - | + pymc3/tests/test_examples.py + pymc3/tests/test_posteriors.py + pymc3/tests/test_gp.py + pymc3/tests/test_quadpotential.py + - | + pymc3/tests/test_variational_inference.py + pymc3/tests/test_updates.py + pymc3/tests/test_shape_handling.py + runs-on: ${{ matrix.os }} + env: + TEST_SUBSET: ${{ matrix.test-subset }} + THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native' + defaults: + run: + shell: bash -l {0} + steps: + - uses: actions/checkout@v2 + - name: Cache conda + uses: actions/cache@v1 + env: + # Increase this value to reset cache if environment-dev.yml has not changed + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ + hashFiles('environment-dev.yml') }} + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: testenv + channel-priority: strict + environment-file: environment-dev.yml + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + - run: | + conda activate testenv + python -m pytest -v --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 98579caa85..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: python - -cache: - directories: - - $HOME/.theano - - $HOME/miniconda3 - -addons: - apt_packages: - - pandoc - -before_install: - - . ./scripts/install_miniconda.sh - - export MKL_THREADING_LAYER=GNU - -services: - - xvfb - -install: - - . ./scripts/create_testenv.sh - - pip install codecov - - conda list && pip freeze - -env: - - FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py --ignore=pymc3/tests/test_quadpotential.py" - - FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - - FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py pymc3/tests/test_quadpotential.py" - - FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py --ignore=pymc3/tests/test_parallel_sampling.py --ignore=pymc3/tests/test_dist_math.py --ignore=pymc3/tests/test_distribution_defaults.py --ignore=pymc3/tests/test_distributions_timeseries.py --ignore=pymc3/tests/test_random.py --ignore=pymc3/tests/test_gp.py --ignore=pymc3/tests/test_shape_handling.py --ignore=pymc3/tests/test_quadpotential.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py pymc3/tests/test_parallel_sampling.py pymc3/tests/test_dist_math.py pymc3/tests/test_distribution_defaults.py pymc3/tests/test_distributions_timeseries.py pymc3/tests/test_random.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_posteriors.py pymc3/tests/test_gp.py pymc3/tests/test_quadpotential.py" - - FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_shape_handling.py" - -script: - - . ./scripts/test.sh $TESTCMD - -after_success: - - codecov - -stages: - - test - - name: binder - if: (branch = master) AND (NOT (type IN (pull_request))) - -jobs: - include: - - name: ArviZ compatibility - stage: test - install: - - . ./scripts/create_testenv.sh - - conda activate testenv - # replace ArviZ with the latest master - - pip install git+git://github.com/arviz-devs/arviz.git - - pip install codecov - - conda list && pip freeze - - export FLOATX='float64' - script: - - . ./scripts/test.sh --durations=10 --cov-append pymc3/tests/test_sampling.py - after_success: skip - - name: Update Binder - stage: binder - before_install: skip - install: skip - script: - # Use Binder build API to trigger repo2docker to build image on GKE and OVH Binder Federation clusters - - bash binder/trigger_binder.sh https://gke.mybinder.org/build/gh/pymc-devs/pymc3/"${TRAVIS_BRANCH}" - - bash binder/trigger_binder.sh https://ovh.mybinder.org/build/gh/pymc-devs/pymc3/"${TRAVIS_BRANCH}" - after_success: skip diff --git a/environment-dev.yml b/environment-dev.yml index ab6ac70b6d..c4ea7693cb 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python=3.6 + - python>=3.6 - arviz>=0.9 - theano-pymc==1.0.11 - numpy>=1.13 @@ -22,9 +22,6 @@ dependencies: - nose-parameterized>=0.6 - numpydoc>=0.9 - pre-commit>=2.8.0 - - pycodestyle>=2.3 - - pyflakes>=1.5 - - pylint>=1.7 - pytest-cov>=2.5 - pytest>=3.0 - recommonmark>=0.4 @@ -33,12 +30,9 @@ dependencies: - sphinx>=1.5 - watermark - parameterized - - black - ipywidgets - dataclasses # python_version < 3.7 - contextvars # python_version < 3.7 - mkl-service - dill - libblas=*=*mkl - - pip: - - black_nbconvert