Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b375e1e
Draft tidy of workflows
eddiebergman Dec 26, 2021
5ddf49a
Fix: mypy should not ignore missing imports
eddiebergman Jan 2, 2022
1509652
Added pydocstyle to checkers
eddiebergman Jan 2, 2022
1fee8b5
Added check and format make options
eddiebergman Jan 2, 2022
f8a5d50
Fix: mutiple entries in same line setup.py
eddiebergman Jan 2, 2022
a23c6fd
Change: black line length to 88
eddiebergman Jan 2, 2022
a2371cd
Fix: make check to only perform checks
eddiebergman Jan 2, 2022
4b7587d
Update: Flake8 ignores style (handled by black/isort)
eddiebergman Jan 2, 2022
afe98f0
Add: pydocstyle, disabled in pre-commit
eddiebergman Jan 2, 2022
a509517
Add: Makefile `make pre-commit`
eddiebergman Jan 2, 2022
b8edf97
Fix: Ignores for mypy on untyped modules
eddiebergman Jan 2, 2022
c072fe8
Limit scope of pre-commit steps
eddiebergman Jan 2, 2022
9425ecd
Fix: flake8 no longer concerned about line length
eddiebergman Jan 2, 2022
c6a27ab
Add: Flake8 to `make check`
eddiebergman Jan 2, 2022
b7d5752
Fix: reduce scope of black and isort
eddiebergman Jan 2, 2022
68d5e63
Fix: Pydocstyle now uses numpy convention
eddiebergman Jan 2, 2022
9a570b2
Fix: workaround for test imports of `automl_common`
eddiebergman Jan 2, 2022
88924e0
Fix: `mypy` ignores `automl_common` now
eddiebergman Jan 2, 2022
a70867d
Fix: Limit scope of `black` and `isort` formatting
eddiebergman Jan 2, 2022
5061826
Fix: pre-commit performs no file changes now
eddiebergman Jan 2, 2022
226b494
Add: `make pre-commit` to `make help`
eddiebergman Jan 3, 2022
0a434e2
Fix: `make help` docstring for `make pre-commit`
eddiebergman Jan 3, 2022
143d819
Fix: isort update sections autosklearn, types
eddiebergman Jan 4, 2022
9329ab0
Fix: warnings by flake8 for line length
eddiebergman Jan 4, 2022
88ee617
Fix: Types section for isort
eddiebergman Jan 4, 2022
e3afa70
Fix: reenable `flake8` formatting checking
eddiebergman Jan 4, 2022
8f8f348
Update: flake8 to use black's line length of 88
eddiebergman Jan 4, 2022
71f7032
add: ignore D205 pydocstyle
eddiebergman Jan 10, 2022
f409a4b
Fix: Import order for futures
eddiebergman Jan 10, 2022
2f9e71c
Merge branch 'development' into tool_update
eddiebergman Jan 10, 2022
206059d
Fix: flake8 ignore E203
eddiebergman Jan 10, 2022
d989b5a
Fix: Formatting and fixed long lines
eddiebergman Jan 10, 2022
174ede2
Del: black/isort checker, checked with pre-commit
eddiebergman Jan 10, 2022
dcf0587
Fix: test dummy prediction error msg
eddiebergman Jan 10, 2022
60da9d6
Add: `coverage` to `pyproject.yaml`
eddiebergman Jan 10, 2022
fed8668
Add: coverage ignore for `if TYPE_CHECKING`
eddiebergman Jan 11, 2022
f26d574
Fix: missing coma
eddiebergman Jan 11, 2022
45a6c7b
Fix: `toml` dependency for pydoctyle in pre-commit
eddiebergman Jan 11, 2022
9ae6879
Merge: dev
eddiebergman Jan 14, 2022
f9378d3
Fix: isort src path
eddiebergman Jan 21, 2022
bb7eaae
Add: `make test`
eddiebergman Jan 21, 2022
b9de92d
Fix: Add name of module to check coverage of
eddiebergman Jan 21, 2022
a4ec68f
Merge branch 'development' into tool_update
eddiebergman Feb 3, 2022
760145c
Maint: isort and black most recent dev
eddiebergman Feb 3, 2022
8e5abe9
Fix: import typo
eddiebergman Feb 3, 2022
b16d154
Change: format now performs individually on each directory
eddiebergman Feb 3, 2022
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
48 changes: 26 additions & 22 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
#see https://github.com/codecov/support/wiki/Codecov-Yaml
codecov:
notify:
require_ci_to_pass: yes
require_ci_to_pass: yes

coverage:
precision: 2 # 2 = xx.xx%, 0 = xx%
round: nearest # how coverage is rounded: down/up/nearest
range: 10...90 # custom range of coverage colors from red -> yellow -> green

# 2 = xx.xx%, 0 = xx%
precision: 2

# https://docs.codecov.com/docs/commit-status
status:
# https://codecov.readme.io/v1.0/docs/commit-status

# We want our total main project to always remain above 87% coverage, a
# drop of 0.20% is allowed. It should fail if coverage couldn't be uploaded
# of the CI fails otherwise
project:
default:
against: auto
target: 70% # specify the target coverage for each commit status
threshold: 50% # allow this little decrease on project
# https://github.com/codecov/support/wiki/Filtering-Branches
# branches: master
target: 87%
threshold: 0.20%
if_not_found: failure
if_ci_failed: error
# https://github.com/codecov/support/wiki/Patch-Status

# The code changed by a PR should have 90% coverage. This is different from the
# overall number shown above.
# This encourages small PR's as they are easier to test.
patch:
default:
against: auto
target: 30% # specify the target "X%" coverage to hit
threshold: 50% # allow this much decrease on patch
changes: false
target: 90%
if_not_found: failure
if_ci_failed: error

# We upload additional information on branching with pytest-cov `--cov-branch`
# This information can be used by codecov.com to increase analysis of code
parsers:
gcov:
branch_detection:
conditional: true
loop: true
method: true
macro: false
method: false
javascript:
enable_partials: false


comment:
layout: header, diff
layout: diff, reach
behavior: default
require_changes: false
behavior: default # update if exists else create new
branches: *
9 changes: 6 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[flake8]
max-line-length = 100
show-source = True
application-import-names = autosklearn
exclude =
max-line-length = 88
extend-exclude =
venv
.venv
build
extend-ignore =
# No lambdas — too strict
E731
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ env:
# Arguments used for code-cov which is later used to annotate PR's on github
code-cov-args: >-
--cov=autosklearn
--cov-branch
--cov-report=xml

jobs:
Expand Down
98 changes: 51 additions & 47 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,61 @@
# If you see me, please update my `rev` field using the provided links
# Click the repo and update to latest tags.
# If things break on update, raise an issue
repos:

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort imports autosklearn
files: autosklearn/.*
args: [--check]

- id: isort
name: isort imports test
files: test/.*
args: [--check]

- repo: https://github.com/ambv/black
rev: 21.12b0
hooks:
- id: black
name: black formatter autosklearn
files: autosklearn/.*
args: [--check]

- id: black
name: black formatter test
files: test/.*
args: [--check]

- id: black
name: black formatter examples
files: examples/.*
args: [--check]

# This is disabled as most modules fail this
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
files: DISABLED # autosklearn/.*
always_run: false

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
rev: v0.930
hooks:
- id: mypy
args: [--show-error-codes]
name: mypy auto-sklearn-ensembles
files: autosklearn/ensembles
- id: mypy
args: [--show-error-codes]
name: mypy auto-sklearn-metrics
files: autosklearn/metrics
- id: mypy
args: [--show-error-codes]
name: mypy auto-sklearn-data
files: autosklearn/data
- id: mypy
args: [--show-error-codes]
name: mypy auto-sklearn-util
files: autosklearn/util
- id: mypy
args: [--show-error-codes]
name: mypy auto-sklearn-evaluation
files: autosklearn/evaluation
- id: mypy
args: [--show-error-codes]
name: mypy auto-sklearn-datapreprocessing
files: autosklearn/pipeline/components/data_preprocessing/
name: mypy auto-sklearn
files: autosklearn/.*

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
rev: 4.0.1
hooks:
- id: flake8
name: flake8 auto-sklearn
name: flake8 autosklearn
files: autosklearn/.*

- id: flake8
name: flake8 file-order-data
files: autosklearn/data
additional_dependencies:
- flake8-import-order
- id: flake8
name: flake8 file-order-ensemble
files: autosklearn/ensembles
additional_dependencies:
- flake8-import-order
- id: flake8
name: flake8 file-order-metrics
files: autosklearn/metrics
additional_dependencies:
- flake8-import-order
- id: flake8
name: flake8 file-order-util
files: autosklearn/util
additional_dependencies:
- flake8-import-order
- id: flake8
name: flake8 autosklearn-test
name: flake8 test
files: test/.*
118 changes: 100 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,114 @@
# simple makefile to simplify repetitive build env management tasks under posix
# NOTE: Used on linux, limited support outside of Linux
#
# A simple makefile to help with small tasks related to development of autosklearn
# These have been configured to only really run short tasks. Longer form tasks
# are usually completed in github actions.

.PHONY: help install-dev clean clean-doc clean-build build doc links examples publish

help:
@echo "Makefile autosklearn"
@echo "* install-dev to install all dev requirements and install pre-commit"
@echo "* check to check the source code for issues"
@echo "* format to format the code with black and isort"
@echo "* pre-commit to run the pre-commit check"
@echo "* clean to clean the dist and doc build files"
@echo "* build to build a dist"
@echo "* doc to generate and view the html files"
@echo "* linkcheck to check the documentation links"
@echo "* examples to run and generate the examples"
@echo "* publish to help publish the current branch to pypi"

PYTHON ?= python
CYTHON ?= cython
PYTEST ?= python -m pytest
CTAGS ?= ctags
PIP ?= python -m pip
MAKE ?= make
BLACK ?= black
ISORT ?= isort
PYDOCSTYLE ?= pydocstyle
MYPY ?= mypy
PRECOMMIT ?= pre-commit
FLAKE8 ?= flake8

DIR := ${CURDIR}
DIST := ${CURDIR}/dist
DOCDIR := ${DIR}/doc
INDEX_HTML := file://${DOCDIR}/html/build/index.html

install-dev:
$(PIP) install -e ".[test,examples,docs]"
pre-commit install

check-black:
$(BLACK) autosklearn examples test --check || :

check-isort:
$(ISORT) autosklearn test --check || :

check-pydocstyle:
$(PYDOCSTYLE) autosklearn || :

check-mypy:
$(MYPY) autosklearn || :

all: clean inplace test
check-flake8:
$(FLAKE8) autosklearn || :
$(FLAKE8) test || :

clean:
# pydocstyle does not have easy ignore rules, instead, we include as they are covered
check: check-black check-isort check-mypy check-flake8 # check-pydocstyle

pre-commit:
$(PRECOMMIT) run --all-files

format-black:
$(BLACK) autosklearn test examples

format-isort:
$(ISORT) autosklearn test

format: format-black format-isort

clean-doc:
$(MAKE) -C ${DOCDIR} clean

clean-build:
$(PYTHON) setup.py clean
rm -rf dist
rm -rf ${DIST}

# Clean up any builds in ./dist as well as doc
clean: clean-doc clean-build

in: inplace # just a shortcut
inplace:
$(PYTHON) setup.py build_ext -i
# Build a distribution in ./dist
build:
$(PYTHON) setup.py bdist

doc:
cd ./doc
make html
cd ..
$(MAKE) -C ${DOCDIR} html-noexamples
@echo
@echo "View docs at:"
@echo ${INDEX_HTML}

test-code: in
$(PYTEST) -s -v test
test-doc:
$(PYTEST) -s -v doc/*.rst
links:
$(MAKE) -C ${DOCDIR} linkcheck

test-coverage:
rm -rf coverage .coverage
$(PYTEST) -s -v --with-coverage test
examples:
$(MAKE) -C ${DOCDIR} html
@echo
@echo "View docs at:"
@echo ${INDEX_HTML}

test: test-code test-sphinxext test-doc
# Publish to testpypi
# Will echo the commands to actually publish to be run to publish to actual PyPi
# This is done to prevent accidental publishing but provide the same conveniences
publish: clean-build build
$(PIP) install twine
$(PYTHON) -m twine upload --repository testpypi ${DIST}/*
@echo
@echo "Test with the following line:"
@echo "pip install --index-url https://test.pypi.org/simple/ auto-sklearn"
@echo
@echo "Once you have decided it works, publish to actual pypi with"
@echo "python -m twine upload dist/*"
8 changes: 0 additions & 8 deletions mypy.ini

This file was deleted.

Loading