Skip to content

Commit

Permalink
Avoid installing prereleased dependencies in github action
Browse files Browse the repository at this point in the history
The way the scikit-decide library was installed for tests was designed
so that pip find scikit-decide (in prelease mode) in the "wheels" directory.
However a side effect was that it also allowed pip to install preleased
dependencies, which can lead to some bugs, see issue airbus#192.

To avoid this we rather specify explicitely the path to the wheel (but
unsing wildcards to get easily the exact name) and get rid of the
"--pre" option.

We do that in a separate step for better readibility.

Fix airbus#192.
  • Loading branch information
nhuet committed May 30, 2022
1 parent 6f25359 commit f4bc742
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,14 @@ jobs:
with:
name: wheels

- name: Install scikit-decide
run: |
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*win*.whl)
pip install ${wheelfile}[all]
- name: Test with pytest
run: |
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
pytest -v -s tests/autocast
pytest -v -s tests/solvers/cpp
pytest -v -s tests/solvers/python
Expand Down Expand Up @@ -437,10 +442,14 @@ jobs:
with:
name: wheels

- name: Install scikit-decide
run: |
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*macos*.whl)
pip install ${wheelfile}[all]
- name: Test with pytest
run: |
env
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
pytest -v -s tests/autocast
pytest -v -s tests/solvers/cpp
pytest -v -s tests/solvers/python
Expand Down Expand Up @@ -473,9 +482,14 @@ jobs:
with:
name: wheels

- name: Install scikit-decide
run: |
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*manylinux*.whl)
pip install ${wheelfile}[all]
- name: Test with pytest
run: |
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
pytest -v -s tests/autocast
pytest -v -s tests/solvers/cpp
pytest -v -s tests/solvers/python
Expand Down Expand Up @@ -537,7 +551,9 @@ jobs:

- name: Install scikit-decide
run: |
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*manylinux*.whl)
pip install ${wheelfile}[all]
- name: generate documentation
run: yarn global add vuepress && yarn install && yarn docs:build && touch docs/.vuepress/dist/.nojekyll
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,13 @@ jobs:
with:
name: wheels

- name: Install scikit-decide
run: |
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*win*.whl)
pip install ${wheelfile}[all]
- name: Test with pytest
run: |
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
pytest -v -s tests/autocast
pytest -v -s tests/solvers/cpp
pytest -v -s tests/solvers/python
Expand Down Expand Up @@ -366,10 +370,13 @@ jobs:
with:
name: wheels

- name: Install scikit-decide
run: |
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*macos*.whl)
pip install ${wheelfile}[all]
- name: Test with pytest
run: |
env
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
pytest -v -s tests/autocast
pytest -v -s tests/solvers/cpp
pytest -v -s tests/solvers/python
Expand Down Expand Up @@ -402,9 +409,13 @@ jobs:
with:
name: wheels

- name: Install scikit-decide
run: |
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*manylinux*.whl)
pip install ${wheelfile}[all]
- name: Test with pytest
run: |
pip install --pre --find-links ./wheels/ "scikit-decide[all]"
pytest -v -s tests/autocast
pytest -v -s tests/solvers/cpp
pytest -v -s tests/solvers/python
Expand Down Expand Up @@ -468,6 +479,7 @@ jobs:
runs-on: ubuntu-latest
env:
DOCS_VERSION_PATH: /
python_version: "3.7"

steps:
- name: Get scikit-decide release version and update online docs path
Expand Down Expand Up @@ -517,7 +529,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: ${{ env.python_version }}

- name: Download artifacts
uses: actions/[email protected]
Expand All @@ -526,7 +538,8 @@ jobs:

- name: Install scikit-decide
run: |
pip install --pre --find-links ./wheels "scikit-decide[all]"
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*manylinux*.whl)
pip install ${wheelfile}[all]
- name: generate documentation
run: yarn global add vuepress && yarn install && yarn docs:build && touch docs/.vuepress/dist/.nojekyll
Expand Down

0 comments on commit f4bc742

Please sign in to comment.