Skip to content
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

[WIP] Add 781 #922

Merged
merged 27 commits into from
Jul 2, 2020
Merged

[WIP] Add 781 #922

merged 27 commits into from
Jul 2, 2020

Conversation

PGijsbers
Copy link
Collaborator

@PGijsbers PGijsbers commented Jun 26, 2020

Add a pre-commit hook with flake8, mypy and black.
This is the first time black is used in the project, so this PR also reformats the code with black.

The noticeable files are:

  • .flake8: a flake8 configuration.
    Used by pre-commit but convenient for users too.
    Added ignore E203, which normally prohibits whitespace around the colon.
    Black inserts white-space around the colon sometimes as per PEP (Whitespace in expressions and statements).
    I could not find where examples where before explicitly ignored for flake8, but the develop branch examples raised problems with flake8, so I assumed we are excluding this folder.

  • mypy.ini: a mypy configuration. Used by pre-commit but convenient for users too.

  • .pre-commit-config.yaml: the pre-commit configuration
    I fixed the versions so everyone works with the same checkers. These are the versions used by GAMA, but not chosen for any particular reason (they were most recent at the time, I believe).

  • contribution guidelines in docs

Uses the configuration from ci_scripts
Based on the ci_scripts parameters.
Any venv folder does not need flake8.
The example directory got flake8 warnings so I assumed it should be
excluded.
Add ignore E203 as Black will observe PEPs specification for white space
around a colon it is next to an expression.
There are a few places where big indentation is introduced that may
warrant refactoring so it looks better.
I did not refactor anything yet, but did exlude three (?) lists (of ids)
to not be formatted.
This ensures it runs with the same versions and settings as developers.
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.
It seems to cause an error on import due to a missing sqlite3 dll.
As we don't check coverage anyway, hopefully just uninstalling is
sufficient.
@PGijsbers PGijsbers requested a review from mfeurer June 28, 2020 14:19
@PGijsbers
Copy link
Collaborator Author

I am getting some error from building docs/not finding a trace but I think they should be unrelated to this PR? Other than that I think it's good.

Neeratyoy and others added 2 commits July 1, 2020 16:35
* Sphinx issue fix

* Removing comment
I ran into issues when the openml server config is not exactly 'https://www.openml.org/api/v1/xml', e.g. I had 'https://www.openml.org/api/v1'.
I only noticed when getting a bad dataset url.

This edit makes the API more robust against how exactly the server URL is set in the config.
@mfeurer
Copy link
Collaborator

mfeurer commented Jul 1, 2020

I am getting some error from building docs/not finding a trace but I think they should be unrelated to this PR? Other than that I think it's good.

This was fixed by @Neeratyoy in #923

Copy link
Collaborator

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing!

I just left a few comments on user-facing code. Also, I'm afraid that you need to rebase/merge in a few recent changes.

examples/30_extended/create_upload_tutorial.py Outdated Show resolved Hide resolved
examples/30_extended/create_upload_tutorial.py Outdated Show resolved Hide resolved
examples/30_extended/create_upload_tutorial.py Outdated Show resolved Hide resolved
openml/runs/functions.py Outdated Show resolved Hide resolved
@PGijsbers
Copy link
Collaborator Author

I'll update the PR tomorrow. If after that only small stuff remains, would you be able to handle the rest of the PR? I have vacation this week :/ (not great timing, but I figured the pre-commit will help us with the hackathon).

@mfeurer
Copy link
Collaborator

mfeurer commented Jul 2, 2020

I'll update the PR tomorrow. If after that only small stuff remains, would you be able to handle the rest of the PR?

Thanks a lot and sure, I can do that.

I have vacation this week

Enjoy :)

Uses the configuration from ci_scripts
Based on the ci_scripts parameters.
Any venv folder does not need flake8.
The example directory got flake8 warnings so I assumed it should be
excluded.
Add ignore E203 as Black will observe PEPs specification for white space
around a colon it is next to an expression.
There are a few places where big indentation is introduced that may
warrant refactoring so it looks better.
I did not refactor anything yet, but did exlude three (?) lists (of ids)
to not be formatted.
This ensures it runs with the same versions and settings as developers.
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.
It seems to cause an error on import due to a missing sqlite3 dll.
As we don't check coverage anyway, hopefully just uninstalling is
sufficient.
@PGijsbers
Copy link
Collaborator Author

I think this should have done the trick 👍 (rebase and processed feedback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants