Skip to content

Commit

Permalink
Fix Python dependency issues breaking CI (#234)
Browse files Browse the repository at this point in the history
* Pin versions using conda

* Increment version number

* Add windows build

* Correctly set Julia version

* Add macOS build

* Simplify matrix

* Pin pandas also

* Test data home only on v1.8

* Install wget for windows

* Don't specify shell is bash

* Check approximate equality for extract_dataset
  • Loading branch information
sethaxen authored Oct 1, 2022
1 parent 0e3415d commit e1e9cd5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ env:

jobs:
test:
name: Julia ${{ matrix.julia-version }}
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ["1.6", "1"]
os: [ubuntu-latest]
julia-version: ["1"]
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- julia-version: "1.6"
os: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand All @@ -44,13 +47,17 @@ jobs:
with:
path: ${{ env.CMDSTAN_PATH }}
key: cmdstan-${{ env.CMDSTAN_VERSION }}-${{ runner.os }}
- name: Install wget for windows
if: matrix.os == 'windows-latest'
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install wget
- name: Download and build CmdStan
if: steps.cache-cmdstan.outputs.cache-hit != 'true'
run: |
wget -P ${{ env.CMDSTAN_PATH }} https://github.com/stan-dev/cmdstan/releases/download/v${{ env.CMDSTAN_VERSION }}/cmdstan-${{ env.CMDSTAN_VERSION }}.tar.gz
tar -xzpf ${{ env.CMDSTAN_PATH }}/cmdstan-${{ env.CMDSTAN_VERSION }}.tar.gz -C ${{ env.CMDSTAN_PATH }}
make -C ${{ env.CMDSTAN_PATH }}/cmdstan-${{ env.CMDSTAN_VERSION }}/ build
shell: bash
- uses: julia-actions/julia-buildpkg@latest
- name: Install ArviZ dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ArviZ"
uuid = "131c737c-5715-5e2e-ad31-c244f01c1dc7"
authors = ["Seth Axen <[email protected]>"]
version = "0.6.5"
version = "0.6.6"

[deps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
Expand Down
9 changes: 4 additions & 5 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Conda

# try to install scipy with pip if not yet installed
# temporary workaround for https://github.com/arviz-devs/ArviZ.jl/issues/188
Conda.pip_interop(true)
Conda.pip("uninstall -y", "scipy")
Conda.pip("install", "scipy")
# temporary workaround for
# - https://github.com/arviz-devs/ArviZ.jl/issues/188
# - https://github.com/arviz-devs/arviz/issues/2120
Conda.add(["matplotlib<3.6.0", "pandas<1.5.0", "scipy<=1.8.0"])
4 changes: 2 additions & 2 deletions test/test_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using ArviZ, DimensionalData, Test
post = extract_dataset(idata, :posterior; combined=false)
for k in keys(idata.posterior)
@test haskey(post, k)
@test post[k] == idata.posterior[k]
@test post[k] idata.posterior[k]
dims = DimensionalData.dims(post)
dims_exp = DimensionalData.dims(idata.posterior)
@test DimensionalData.name(dims) === DimensionalData.name(dims_exp)
Expand All @@ -14,7 +14,7 @@ using ArviZ, DimensionalData, Test
prior = extract_dataset(idata, :prior; combined=false)
for k in keys(idata.prior)
@test haskey(prior, k)
@test prior[k] == idata.prior[k]
@test prior[k] idata.prior[k]
dims = DimensionalData.dims(prior)
dims_exp = DimensionalData.dims(idata.prior)
@test DimensionalData.name(dims) === DimensionalData.name(dims_exp)
Expand Down
2 changes: 1 addition & 1 deletion test/test_example_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ using ArviZ, Test
data = @test_deprecated load_arviz_data("centered_eight")
datasets = @test_deprecated load_arviz_data()
@test datasets isa Dict
mktempdir() do data_home
VERSION >= v"1.8" && mktempdir() do data_home
@test_deprecated load_arviz_data("rugby", data_home)
@test readdir(data_home) == ["rugby.nc"]
end
Expand Down

0 comments on commit e1e9cd5

Please sign in to comment.