From 1cdd79c8e0ed04ed531848e302b62741a56bf3a6 Mon Sep 17 00:00:00 2001 From: mloubout Date: Fri, 1 Nov 2024 13:01:10 -0400 Subject: [PATCH] fix build with CondaEnv --- .github/workflows/ci-examples.yml | 2 +- .github/workflows/ci-op.yml | 2 +- .github/workflows/deploy_doc.yaml | 2 +- .github/workflows/docker-publish.yml | 4 ++-- Project.toml | 2 +- deps/build.jl | 10 +++++++++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-examples.yml b/.github/workflows/ci-examples.yml index 8179aab1c..06dd3f8f4 100644 --- a/.github/workflows/ci-examples.yml +++ b/.github/workflows/ci-examples.yml @@ -68,7 +68,7 @@ jobs: python3 -m pip install -U pip python3 -m pip install "matplotlib<3.9" seiscm colorcet echo "JULIA_PYTHONCALL_EXE=$(which python3)" >> $GITHUB_ENV - echo "JULIA_CONDAPKG_BACKEND=\"Null\"" >> $GITHUB_ENV + echo 'JULIA_CONDAPKG_BACKEND="Null"' >> $GITHUB_ENV echo "PYTHON=$(which python3)" >> $GITHUB_ENV echo "PYCALL_JL_RUNTIME_PYTHON=$(which python3)" >> $GITHUB_ENV diff --git a/.github/workflows/ci-op.yml b/.github/workflows/ci-op.yml index db4a82c33..47af8545f 100644 --- a/.github/workflows/ci-op.yml +++ b/.github/workflows/ci-op.yml @@ -101,7 +101,7 @@ jobs: echo "PYTHON=$(which python3)" >> $GITHUB_ENV echo "PYCALL_JL_RUNTIME_PYTHON=$(which python3)" >> $GITHUB_ENV echo "JULIA_PYTHONCALL_EXE=$(which python3)" >> $GITHUB_ENV - echo "JULIA_CONDAPKG_BACKEND=\"Null\"" >> $GITHUB_ENV + echo 'JULIA_CONDAPKG_BACKEND="Null"' >> $GITHUB_ENV - name: Build JUDI uses: julia-actions/julia-buildpkg@latest diff --git a/.github/workflows/deploy_doc.yaml b/.github/workflows/deploy_doc.yaml index 49a575878..6a3ed92c8 100644 --- a/.github/workflows/deploy_doc.yaml +++ b/.github/workflows/deploy_doc.yaml @@ -33,7 +33,7 @@ jobs: echo "PYTHON=$(which python3)" >> $GITHUB_ENV echo "PYCALL_JL_RUNTIME_PYTHON=$(which python3)" >> $GITHUB_ENV echo "JULIA_PYTHONCALL_EXE=$(which python3)" >> $GITHUB_ENV - echo "JULIA_CONDAPKG_BACKEND=\"Null\"" >> $GITHUB_ENV + echo 'JULIA_CONDAPKG_BACKEND="Null"' >> $GITHUB_ENV - name: Build JUDI uses: julia-actions/julia-buildpkg@latest diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 029998087..ce3e2ac61 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['1.6', '1.7', '1.8', '1.9', '1.10'] + version: ['1.10', '1.11'] steps: - name: Check event name @@ -69,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['1.6', '1.7', '1.8', '1.9', '1.10'] + version: ['1.10', '1.11'] steps: - name: Run simple test diff --git a/Project.toml b/Project.toml index 551fcde92..745d35b7a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "JUDI" uuid = "f3b833dc-6b2e-5b9c-b940-873ed6319979" authors = ["Philipp Witte, Mathias Louboutin"] -version = "4.0.0" +version = "4.0.1" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/deps/build.jl b/deps/build.jl index 7c1a2f720..b650ea1f4 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -5,7 +5,15 @@ struct DevitoException <: Exception msg::String end -pyexe = PythonCall.python_executable_path() +if string(get(ENV, "JULIA_CONDAPKG_BACKEND", "conda")) == "Null" + pyexe = PythonCall.python_executable_path() +else + @info "Using $(get(ENV, "JULIA_CONDAPKG_BACKEND", "conda")) as the CondaPkg backend" + pyexe = PythonCall.C.CondaPkg.withenv() do + condapy = PythonCall.C.CondaPkg.which("python") + return condapy + end +end pk = try pyimport("pkg_resources")