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 pypi install test script #32

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
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
27 changes: 25 additions & 2 deletions .github/workflows/install-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,31 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: [ "3.9", "3.10", "3.11" ]
# Check both 'library' install and the 'application' (i.e. locked) install
install-target: ["openscm-calibration", "openscm-calibration[locked]"]
# Check 'library' install,
# 'library' install with all extras
# and the 'application' (i.e. locked) install
install-target: [
"openscm-calibration",
"openscm-calibration[locked]",
"openscm-calibration[plots,scmdata]",
]
# Check installation with extras too, but not for all operating systems
include:
- os: ubuntu-latest
python-version: 3.11
install-target: "openscm-calibration[plots]"
- os: ubuntu-latest
python-version: 3.11
install-target: "openscm-calibration[plots-locked]"
- os: ubuntu-latest
python-version: 3.11
install-target: "openscm-calibration[scmdata]"
- os: ubuntu-latest
python-version: 3.11
install-target: "openscm-calibration[scmdata-locked]"
- os: ubuntu-latest
python-version: 3.11
install-target: "openscm-calibration[plots-locked,scmdata-locked]"
steps:
- name: Set up Python "${{ matrix.python-version }}"
id: setup-python
Expand Down
1 change: 1 addition & 0 deletions changelog/32.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed up the test PyPI install workflow and made the tests work even if all optional extas are not installed.
5 changes: 3 additions & 2 deletions tests/unit/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import numpy as np
import numpy.testing as npt
import pytest
from multiprocess import Manager

from openscm_calibration.store import OptResStore

Expand Down Expand Up @@ -550,10 +549,12 @@ def test_from_n_runs_manager(n_runs, dummy_parameters):

@pytest.mark.parametrize("n_runs", (3, 5, 23))
def test_from_n_runs_manager_multiprocess(n_runs, dummy_parameters):
multiprocess = pytest.importorskip("multiprocess")

exp_res = [None] * n_runs
exp_avail_indices = list(range(n_runs))[::-1]

with Manager() as manager:
with multiprocess.Manager() as manager:
init = OptResStore.from_n_runs_manager(
n_runs, manager=manager, params=dummy_parameters, add_iteration_to_res=None
)
Expand Down
Loading