Skip to content

Prevent workflow double trigger, Add PEP 561 compliance #1348

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

Merged
merged 11 commits into from
Dec 21, 2021
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
16 changes: 15 additions & 1 deletion .github/workflows/black_checker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
name: black-format-check

on: [push, pull_request]
on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
branches:
- master
- development

env:
#If STRICT is set to true, it will fail on black check fail
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
name: dist-check

on: [push, pull_request]
on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
branches:
- master
- development

jobs:
dist:
Expand Down Expand Up @@ -36,5 +50,9 @@ jobs:
- name: PEP 561 Compliance
run: |
pip install mypy

cd .. # required to use the installed version of autosklearn
if ! python -c "import autosklearn"; then exit 1; fi

# Note this doesnt perform mypy checks, only
# that the types are exported
if ! mypy -c "import autosklearn"; then exit 1; fi
4 changes: 3 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#https://help.github.com/en/actions/language-and-framework-guides/publishing-docker-images#publishing-images-to-github-packages
name: Publish Docker image

on:

push:
# Push to `master` or `development`
branches:
- master
- development
- docker_workflow

jobs:

push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
name: Docs
on: [pull_request, push]

on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
branches:
- master
- development

jobs:

build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/isort_checker.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
name: isort-check

on: [push, pull_request, workflow_dispatch]
on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
branches:
- master
- development

env:
#If STRICT is set to true, it will fail on isort check fail
STRICT: false

jobs:

black-format-check:
isort-format-check:
runs-on: ubuntu-latest
steps:

Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
name: pre-commit

on: [push, pull_request]
on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
branches:
- master
- development

jobs:
run-all-files:
Expand Down
136 changes: 84 additions & 52 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,106 +1,138 @@
name: Tests

on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
workflow_dispatch:
branches:
- master
- development

schedule:
# Every Monday at 7AM UTC
- cron: '0 07 * * 1'
# Every day at 7AM UTC
- cron: '0 07 * * *'

env:

# Arguments used for pytest
pytest-args: >-
--forked
--durations=20
--timeout=300
--timeout-method=thread
-s

# Arguments used for code-cov which is later used to annotate PR's on github
code-cov-args: >-
--cov=autosklearn
--cov-report=xml

jobs:

ubuntu:
runs-on: ubuntu-20.04

name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
use-conda: [true, false]
use-dist: [false]
kind: ['conda', 'source', 'dist']

exclude:
# Exclude all configurations *-*-dist, include one later
- kind: 'dist'

# Exclude windows as bash commands wont work in windows runner
- os: windows-latest

# Exclude macos as there are permission errors using conda as we do
- os: macos-latest

include:
- python-version: '3.8'
# Add the tag code-cov to ubuntu-3.7-source
- os: ubuntu-latest
python-version: 3.7
kind: 'source'
code-cov: true
- python-version: '3.7'
use-conda: false
use-dist: true
fail-fast: false

# Include one config with dist, ubuntu-3.7-dist
- os: ubuntu-latest
python-version: 3.7
kind: 'dist'

steps:

- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
# A note on checkout: When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Otherwise, uses the default branch (master) is used.
with:
python-version: ${{ matrix.python-version }}

- name: Conda Install test dependencies
if: matrix.use-conda == true
- name: Conda install
if: matrix.kind == 'conda'
run: |
# Miniconda is available in $CONDA env var
$CONDA/bin/conda create -n testenv --yes pip wheel gxx_linux-64 gcc_linux-64 swig python=${{ matrix.python-version }}
$CONDA/envs/testenv/bin/python3 -m pip install --upgrade pip
$CONDA/envs/testenv/bin/pip3 install -e .[test]

- name: Install test dependencies
if: matrix.use-conda == false && matrix.use-dist == false
- name: Source install
if: matrix.kind == 'source'
run: |
python -m pip install --upgrade pip
if [[ `python -c 'import platform; print(platform.python_version())' | cut -d '.' -f 2` -eq 6 ]]; then
# Numpy 1.20 dropped suppert for Python3.6
pip install "numpy<=1.19"
fi
pip install -e .[test]
sudo apt-get update
sudo apt-get remove swig
sudo apt-get install swig3.0
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig

- name: Dist Install test dependencies
if: matrix.use-conda == false && matrix.use-dist == true
- name: Dist install
if: matrix.kind == 'dist'
run: |
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get remove swig
sudo apt-get install swig3.0
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
# We need to install for the dependencies, like pytest
python setup.py sdist
last_dist=$(ls -t dist/auto-sklearn-*.tar.gz | head -n 1)
pip install $last_dist[test]

- name: Store repository status
- name: Store git status
id: status-before
run: |
echo "::set-output name=BEFORE::$(git status --porcelain -b)"

- name: Conda Run tests
- name: Tests
timeout-minutes: 60
if: matrix.use-conda == true
run: |
export OPENBLAS_NUM_THREADS=1
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
# We activate conda as metalearning uses python directly, so we need
# to change the default python
export PATH="$CONDA/envs/testenv/bin:$PATH"
if [ ${{ matrix.code-cov }} ]; then codecov='--cov=autosklearn --cov-report=xml'; fi
$CONDA/envs/testenv/bin/python3 -m pytest --durations=20 --timeout=300 --timeout-method=thread -v $codecov test

- name: Run tests
timeout-minutes: 60
if: matrix.use-conda == false
run: |
export OPENBLAS_NUM_THREADS=1
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
if [ ${{ matrix.code-cov }} ]; then codecov='--cov=autosklearn --cov-report=xml'; fi
pytest --durations=20 --timeout=300 --timeout-method=thread -v $codecov test
if [[ ${{ matrix.kind }} == 'conda' ]]; then
PYTHON=$CONDA/envs/testenv/bin/python3

# As one of the tests runs a subprocess command and calls `python3`, we must
# explicitly add it to the path
export PATH="$CONDA/envs/testenv/bin:$PATH"

else
PYTHON=$(which python3)
fi

if [ ${{ matrix.code-cov }} ]; then
$PYTHON -m pytest ${{ env.pytest-args }} ${{ env.code-cov-args }} test
else
$PYTHON -m pytest ${{ env.pytest-args }} test
fi

- name: Check for files left behind by test
if: ${{ always() }}
Expand All @@ -116,7 +148,7 @@ jobs:

- name: Upload coverage
if: matrix.code-cov && always()
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true
12 changes: 8 additions & 4 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: 'Close stale issues'

on:
schedule:
- cron: '30 1 * * *'
- cron: '0 7 * * *'

jobs:

stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
days-before-stale: 60
days-before-close: 7
stale-issue-label: 'stale'
only-issue-labels: 'Answered,Feedback-Required,invalid,wontfix'
exempt-all-milestones: true

stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs for the
next 7 days. Thank you for your contributions.

close-issue-message: >
This issue has been automatically closed due to inactivity.
stale-issue-label: 'stale'
only-issue-labels: 'Answered,Feedback-Required,invalid,wontfix'
exempt-all-milestones: true
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include LICENSE.txt
include requirements.txt
include autosklearn/util/logging.yaml
include autosklearn/requirements.txt
include autosklearn/py.typed

# Meta-data
recursive-include autosklearn/metalearning/files *.arff *.csv *.txt
Expand Down
Empty file added autosklearn/py.typed
Empty file.