Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI run on ubuntu-latest-py3.12 #547

Closed
wants to merge 16 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 65 additions & 30 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
strategy:
matrix:
os:
- macos-13
- macos-latest
# - macos-13
# - macos-latest
- ubuntu-latest
- windows-latest
# - windows-latest
python-version:
- "3.8" # Earliest version supported by ixmp
- "3.9"
- "3.10"
# - "3.8" # Earliest version supported by ixmp
# - "3.9"
# - "3.10"
- "3.11"
- "3.12" # Latest supported by ixmp
gams-version:
Expand Down Expand Up @@ -67,39 +67,43 @@ jobs:
with:
fetch-depth: ${{ env.depth }}
fetch-tags: true

- name: Debug python path
run: python -c "import sys; print(sys.executable, sys.path)"
shell: bash

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"

- uses: ts-graphviz/setup-graphviz@v2
# TEMPORARY Work around ts-graphviz/setup-graphviz#630
if: ${{ ! startswith(matrix.os, 'macos-') }}
# - uses: ts-graphviz/setup-graphviz@v2
# # TEMPORARY Work around ts-graphviz/setup-graphviz#630
# if: ${{ ! startswith(matrix.os, 'macos-') }}

- uses: r-lib/actions/setup-r@v2
id: setup-r

- name: Cache GAMS installer and R packages
uses: actions/cache@v4
with:
path: |
gams
${{ env.R_LIBS_USER }}
key: ${{ matrix.os }}-R${{ steps.setup-r.outputs.installed-r-version }}
restore-keys: |
${{ matrix.os }}-

- uses: iiasa/actions/setup-gams@main
with:
version: ${{ matrix.gams-version }}
license: ${{ secrets.GAMS_LICENSE }}

- name: Set RETICULATE_PYTHON
# Use the environment variable set by the setup-python action, above.
run: echo "RETICULATE_PYTHON=$pythonLocation" >> $GITHUB_ENV
shell: bash
# - name: Cache GAMS installer and R packages
# uses: actions/cache@v4
# with:
# path: |
# gams
# ${{ env.R_LIBS_USER }}
# key: ${{ matrix.os }}-R${{ steps.setup-r.outputs.installed-r-version }}
# restore-keys: |
# ${{ matrix.os }}-

# - uses: iiasa/actions/setup-gams@main
# with:
# version: ${{ matrix.gams-version }}
# license: ${{ secrets.GAMS_LICENSE }}

# - name: Set RETICULATE_PYTHON
# # Use the environment variable set by the setup-python action, above.
# run: echo "RETICULATE_PYTHON=$pythonLocation" >> $GITHUB_ENV
# shell: bash

- name: Install Python package and dependencies
# [docs] contains [tests], which contains [report,tutorial]
Expand All @@ -116,21 +120,52 @@ jobs:
# TEMPORARY Work around pretenders/pretenders#153
pip install "bottle < 0.13"

- name: Debug jupyter kernelspec --version
run: jupyter kernelspec --version
shell: bash

- name: Debug which Rscript is used below
run: which Rscript
shell: bash

- name: Debug PATH
run: echo $PATH
shell: bash

- name: Debug python path
run: python -c "import sys; print(sys.executable, sys.path)"
shell: bash

- name: Install R dependencies and tutorial requirements
run: |
install.packages(c("remotes", "Rcpp"))
remotes::install_cran(
c("IRkernel", "reticulate"),
dependencies = TRUE,
# force = TRUE,
force = TRUE,
)

system2('which', 'python', TRUE, TRUE)
system2('python', '-c "import sys; print(sys.executable, sys.path)"', TRUE, TRUE)

system2('which', 'pip', TRUE, TRUE)
system2('pip', 'list', TRUE, TRUE)

system2('which', 'jupyter', TRUE, TRUE)
system2('which', 'jupyter-kernelspec', TRUE, TRUE)

paste(c(shQuote('jupyter'), c('kernelspec', '--version')), collapse = " ")

system('jupyter-kernelspec --version')

system2('jupyter-kernelspec', '--version', TRUE, TRUE)

IRkernel::installspec()

# commented: for debugging
# print(reticulate::py_config())
# reticulate::py_run_string("import os; print(os.environ)")
shell: Rscript {0}
shell: Rscript --verbose {0}

- name: Run test suite using pytest
run: |
Expand Down
Loading