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

MAINT make test_docstrings.py a regular test file #21899

Merged
merged 1 commit into from Dec 6, 2021

Conversation

@ogrisel
Copy link
Member

@ogrisel ogrisel commented Dec 6, 2021

I am not sure what was the original motivation to keep the test_docstrings.py file outside of the sklearn folder (under the maint_tools/ folder) but in retrospect I find it confusing.

I think it should be treated as a regular test file.

@ogrisel ogrisel requested a review from thomasjpfan Dec 6, 2021
@@ -344,7 +344,7 @@ def repr_errors(res, estimator=None, method: Optional[str] = None) -> str:
if estimator is not None:
obj = getattr(estimator, method)
try:
obj_signature = signature(obj)
obj_signature = str(signature(obj))
Copy link
Member Author

@ogrisel ogrisel Dec 6, 2021

Choose a reason for hiding this comment

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

Note to reviewers: this change was needed to make mypy happier.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Removing test_docstring.sh is nice. I am happy with this change. LGTM

@jeremiedbb
Copy link
Member

@jeremiedbb jeremiedbb commented Dec 6, 2021

The original motivation from @rth: "One point is that this needs numpydoc master, and generally I would rather see it as an optional linter than unit tests. Currently this validation is run in one of Azure CI jobs, maybe there is a better way to do it. The code style in the tests can also probably be improved."

I don't have a strong opinion but since we tend to include our consistency checks in the test suite I don't mind adding this one as well.

@ogrisel
Copy link
Member Author

@ogrisel ogrisel commented Dec 6, 2021

The original motivation from @rth: "One point is that this needs numpydoc master, and generally I would rather see it as an optional linter than unit tests. Currently this validation is run in one of Azure CI jobs, maybe there is a better way to do it. The code style in the tests can also probably be improved."

It's now using a released version of numpydoc. So at least that specific concern has been raised.

For the other points, I think having too much complexity in our CI setup is detrimental, both for maintenance and for understanding by users reading the report.

I checked in the Azure test report view that the tests are being executed as expected by the pylatest_pip_openblas_pandas config (they are skipped otherwise because numpydoc is not installed).

@ogrisel ogrisel merged commit b975c6f into scikit-learn:main Dec 6, 2021
31 of 34 checks passed
@ogrisel ogrisel deleted the move-test_docstrings.py branch Dec 6, 2021
glemaitre added a commit to glemaitre/scikit-learn that referenced this issue Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants