-
-
Notifications
You must be signed in to change notification settings - Fork 26k
CI Adds CPython 3.10 testing [python-dev] #20942
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
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8170540
MAINT Adds CPython 3.10 testing [python-dev]
thomasjpfan 3c153db
MAINT Use 'wheel' instead for a flag
thomasjpfan 5f9152e
MAINT Removes pybind11 when it is not needed [python-dev]
thomasjpfan c4b9a74
CLN Depend on pep517 more [python-dev]
thomasjpfan bed166b
CLN Check skipping
thomasjpfan 51a4a32
WIP [python-dev]
thomasjpfan ae99c72
WIP [python-dev]
thomasjpfan 84403c5
WIP [python-dev]
thomasjpfan 8c1992b
WIP [python-dev]
thomasjpfan 8b4095f
WIP [python-dev]
thomasjpfan e7444ac
WIP [python-dev]
thomasjpfan c98f8f2
WIP [python-dev]
thomasjpfan d5df2ea
BUG Install wheel [python-dev]
thomasjpfan 72bf47b
MAINT Adds cache
thomasjpfan 7d4d06f
BLD [python-dev]
thomasjpfan a645d22
CLN Address comments
thomasjpfan 189ddfb
Merge remote-tracking branch 'upstream/main' into python-3.10-testing
thomasjpfan 8f2fb82
ENH Actually make it nightly
thomasjpfan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: CPython Nightly | ||
|
||
on: | ||
schedule: | ||
# Nightly build at 1:00 A.M. | ||
- cron: "0 1 * * *" | ||
pull_request: | ||
# Manual run | ||
workflow_dispatch: | ||
|
||
jobs: | ||
get_latest_commit: | ||
name: Check build trigger | ||
runs-on: ubuntu-latest | ||
if: "github.repository == 'scikit-learn/scikit-learn'" | ||
outputs: | ||
commit_msg: ${{ steps.get_commit.outputs.commit_msg }} | ||
|
||
steps: | ||
- name: Checkout scikit-learn | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- id: get_commit | ||
name: Get commit | ||
run: | | ||
echo "::set-output name=commit_msg::$(git log --no-merges -1 --oneline)" | ||
|
||
nightly-cpython: | ||
name: Nightly CPython-${{ matrix.python-version }} | ||
needs: get_latest_commit | ||
if: "contains(needs.get_latest_commit.outputs.commit_msg, '[python-dev]') || github.event_name == 'schedule' || github.event_name == 'workflow_run'" | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- python-version: '3.10.0-alpha - 3.10.x' | ||
install-numpy: 'wheel' | ||
install-scipy: 'git' | ||
env: | ||
INSTALL_NUMPY: ${{ matrix.install-numpy }} | ||
INSTALL_SCIPY: ${{ matrix.install-scipy }} | ||
OMP_NUM_THREADS: '2' | ||
OPENBLAS_NUM_THREADS: '2' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install build dependencies | ||
run: | | ||
sudo apt-get install libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev libmpc-dev | ||
pip install --upgrade pip setuptools | ||
- name: Setup cache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
with: | ||
max-size: 1000M | ||
- name: Install python dependencies | ||
run: | | ||
pip install pytest pytest-xdist cython wheel | ||
- name: Install numpy | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
if [[ $INSTALL_NUMPY == "wheel" ]]; then | ||
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy | ||
else | ||
git clone --recursive https://github.com/numpy/numpy.git ~/numpy | ||
cd ~/numpy && pip install -e . | ||
fi | ||
- name: Install scipy | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
if [[ $INSTALL_SCIPY == "wheel" ]]; then | ||
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy | ||
else | ||
git clone --recursive https://github.com/scipy/scipy.git ~/scipy | ||
cd ~/scipy && pip install -e . | ||
fi | ||
- name: Install scikit-learn | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
pip install -v --no-build-isolation -e . | ||
- name: Test scikit-learn | ||
run: | | ||
cd /tmp && python -m pytest -n 2 --pyargs sklearn | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if our OPENMP-based Cython code should now avoid oversubscription problems in docker containers, numpy/scipy might still use too many threads and slow down the execution.
To be safe I think we should set
OMP_NUM_THREADS=2
/OPENBLAS_NUM_THREADS=2
globally for this workflow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomasjpfan Shall we set the environment variable in this file as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variables are set globally in lines 42-45:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work and be useful?