Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ac68acb
Add Flake8 configuration
PGijsbers Jun 25, 2020
e7ef1f5
Add mypy configuration file
PGijsbers Jun 25, 2020
956c9e0
Pre-commit mypy flake8, add flake8 excludes
PGijsbers Jun 26, 2020
d8e4a28
Add Black to pre-commit
PGijsbers Jun 26, 2020
20fa286
Set max line length to 100
PGijsbers Jun 26, 2020
e48b9ed
Blacken code
PGijsbers Jun 26, 2020
e037d90
Add unit tests to flake8 and mypy pre-commit
PGijsbers Jun 26, 2020
04b6b3f
Use pre-commit for flake8, mypy and black checks
PGijsbers Jun 26, 2020
d46c72a
Update docs, add 'test' dependencies
PGijsbers Jun 26, 2020
6708821
Uninstall pytest-cov on appveyor ci
PGijsbers Jun 26, 2020
4c332a7
Add -y to uninstall
PGijsbers Jun 26, 2020
5a31f8e
Sphinx issue fix (#923)
Neeratyoy Jul 1, 2020
861600b
More robust handling of openml_url (#921)
joaquinvanschoren Jul 1, 2020
f49c3eb
format for black artifacts
PGijsbers Jul 2, 2020
7d8a6a3
Add Flake8 configuration
PGijsbers Jun 25, 2020
74cce61
Add mypy configuration file
PGijsbers Jun 25, 2020
ffffab4
Pre-commit mypy flake8, add flake8 excludes
PGijsbers Jun 26, 2020
f4aa438
Add Black to pre-commit
PGijsbers Jun 26, 2020
64002cd
Set max line length to 100
PGijsbers Jun 26, 2020
8a3c6ae
Blacken code
PGijsbers Jun 26, 2020
d4c6150
Add unit tests to flake8 and mypy pre-commit
PGijsbers Jun 26, 2020
3596c87
Use pre-commit for flake8, mypy and black checks
PGijsbers Jun 26, 2020
d77606e
Update docs, add 'test' dependencies
PGijsbers Jun 26, 2020
d9d25af
Uninstall pytest-cov on appveyor ci
PGijsbers Jun 26, 2020
477238c
Add -y to uninstall
PGijsbers Jun 26, 2020
6bfbb69
format for black artifacts
PGijsbers Jul 2, 2020
887810e
Resolve merge conflicts
PGijsbers Jul 2, 2020
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
Prev Previous commit
Next Next commit
Update docs, add 'test' dependencies
Add two other developer dependencies not strictly required for unit
tests, but required for development.
I think the overlap between people who want to execute unit tests and
perform commits is (close to) 100% anyway.
  • Loading branch information
PGijsbers committed Jul 2, 2020
commit d77606e82d3b030ac29fdd3aa0c4d78703b64f72
42 changes: 25 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,37 @@ following rules before you submit a pull request:
- If any source file is being added to the repository, please add the BSD 3-Clause license to it.


You can also check for common programming errors with the following
tools:

- Code with good unittest **coverage** (at least 80%), check with:

First install openml with its test dependencies by running
```bash
$ pip install pytest pytest-cov
$ pytest --cov=. path/to/tests_for_package
$ pip install -e .[test]
```

- No style warnings, check with:

from the repository folder.
This will install dependencies to run unit tests, as well as [pre-commit](https://pre-commit.com/).
To run the unit tests, and check their code coverage, run:
```bash
$ pip install flake8
$ flake8 --ignore E402,W503 --show-source --max-line-length 100
$ pytest --cov=. path/to/tests_for_package
```

- No mypy (typing) issues, check with:

Make sure your code has good unittest **coverage** (at least 80%).

Pre-commit is used for various style checking and code formatting.
Before each commit, it will automatically run:
- [black](https://black.readthedocs.io/en/stable/) a code formatter.
This will automatically format your code.
Make sure to take a second look after any formatting takes place,
if the resulting code is very bloated, consider a (small) refactor.
*note*: If Black reformats your code, the commit will automatically be aborted.
Make sure to add the formatted files (back) to your commit after checking them.
- [mypy](https://mypy.readthedocs.io/en/stable/) a static type checker.
In particular, make sure each function you work on has type hints.
- [flake8](https://flake8.pycqa.org/en/latest/index.html) style guide enforcement.
Almost all of the black-formatted code should automatically pass this check,
but make sure to make adjustments if it does fail.

If you want to run the pre-commit tests without doing a commit, run:
```bash
$ pip install mypy
$ mypy openml --ignore-missing-imports --follow-imports skip
$ pre-commit run --all-files
```
Make sure to do this at least once before your first commit to check your setup works.

Filing bugs
-----------
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"oslo.concurrency",
"flaky",
"pyarrow",
"pre-commit",
"pytest-cov",
],
"examples": [
"matplotlib",
Expand Down