-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Integrate flake8_rst into ./ci/code_check.sh #23381
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
Conversation
Added flake8-rst as development dependency Added flake8-rst configuration Added checks to code_checks.sh Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
cookbook.rst:971 -> python of .. code-block:: deleted to disable flake8-rst checks. %timeit is invalid Syntax, # noqa: E999 does not have an effect. Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
readding F401 detection Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
# Conflicts: # ci/code_checks.sh
Hello @FHaase! Thanks for submitting the PR.
|
adding flake8-rst to travis-36.yaml reverting changes to requirements-optional-pip.txt pytables seems to be tables on PyPI [running ./scripts/convert_deps.py previously changed it] Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
421577e
to
77df97f
Compare
Codecov Report
@@ Coverage Diff @@
## master #23381 +/- ##
=======================================
Coverage 92.25% 92.25%
=======================================
Files 161 161
Lines 51262 51262
=======================================
Hits 47292 47292
Misses 3970 3970
Continue to review full report at Codecov.
|
If this gets merged, an issue should be created for this. |
Really nice work, thank you for it. But I don't think this is really validating the docstrings, just the rst files. We surely have plenty of pep8 errors in docstrings that are not detected here. Besides that, in #23154, the goal was to validate pep8 of docstrings from Happy to merge this, but let's remove the "Closes #23154" from the description, and let's create the issues for the pep8 errors being ignored as @gfyoung says. Also, can't check well from my phone, but when adding flake8-rst to the dependencies, there are some files that are automatically generated. Did you edit them manually, or did you run @jorisvandenbossche, @WillAyd, if you can also take a look here. |
Okay let me summarize what I did:
What does flake8-rst do?
Does it find everything?
Regarding integration in Why do I think it closes #23154 ? |
3624260
to
ee36f34
Compare
@datapythonista
Is that what you had in mind? |
As I said, I was happy to merge the PR as it was. Just, we can't close the issue you referenced yet, as there is more to do. If you can add those new changes in a separate PR I can give you more precise feedback. But summarizing, Besides that, I don't like using subprocess. I guess flake8-rst is a Python program, so we should be able to import it and call the appropriate functions. In any case, validating the docstrings is for another PR, as it's independent of checking the code blocks. |
31fb4dd
to
77df97f
Compare
doc/source/basics.rst
Outdated
@@ -302,23 +302,17 @@ To evaluate single-element pandas objects in a boolean context, use the method | |||
|
|||
.. warning:: | |||
|
|||
You might be tempted to do the following: | |||
Using a DataFrame as a condition will raise errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the point of changing this? We always ask changes to have one focus to keep diff minimal. Would prefer if you could back out anything unrelated to the flake8 and do in a separate PR
Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
doc/source/contributing.rst
Outdated
@@ -744,15 +744,15 @@ Transitioning to ``pytest`` | |||
.. code-block:: python | |||
|
|||
class TestReallyCoolFeature(object): | |||
.... | |||
.... # noqa: E999 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WillAyd Would you prefer a pass
instead of the noqa
?
Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work. I'd possibly use pass
instead of the ...
everywhere, but just a preference.
Looking forward to have all these fixes merged, and to start validating pep8 in docstrings.
Btw, if you have rendered the output of the pep
directive and you can add a screenshot of it, would be nice, I don't know how that is being rendered.
doesn't seem like the rendering is correct, is it? I guess what's expected is that the text shown is Sorry if I'm misunderstanding. |
I'd rather use the
|
thanks for the clarification, if that's the case all good. @WillAyd can you take a look and merge if you're happy? |
Before merging I'd like to change two more things:
I'm just waiting for any more suggestions to not trigger ci-builds. [skip ci] seems to not work with circle ci and azure pipeline. |
I wouldn't worry that much about the CI, and I'd leave the PR in a state that you're happy and it can be merged. |
Okay can merge if wanted |
@WillAyd can you take another look, and merge on green if you're happy. Thanks @FHaase for the work on this, really nice PR. If you want to create two issues for the errors you're ignoring, that would be nice. I'm sure you'll be better than me at explaining what are the problems. You can mention this PR, and mention me too if you want. |
Signed-off-by: Fabian Haase <haase.fabian@gmail.com>
403cc95
to
816f26e
Compare
@datapythonista note this will slightly conflict with your revision of ci deps (need to add the new package) |
no problem, I can update the other two PRs, their CI is still waiting, so it's a good time |
@FHaase can you fix the conflicts please? Sorry this wasn't merged before. |
@datapythonista No Problem. Currently fixing issues within the docs getting covered by an updated flake8-rst. Is it possible to add a PR that builds on an unmerged PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Thanks @FHaase, nice work. It's great to have all those issues fixed, and validation in the rst files. |
…fixed * upstream/master: (47 commits) CLN: remove values attribute from datetimelike EAs (pandas-dev#23603) DOC/CI: Add linting to rst files, and fix issues (pandas-dev#23381) PERF: Speeds up creation of Period, PeriodArray, with Offset freq (pandas-dev#23589) PERF: define is_all_dates to shortcut inadvertent copy when slicing an IntervalIndex (pandas-dev#23591) TST: Tests and Helpers for Datetime/Period Arrays (pandas-dev#23502) Update description of Index._values/values/ndarray_values (pandas-dev#23507) Fixes to make validate_docstrings.py not generate warnings or unwanted output (pandas-dev#23552) DOC: Added note about groupby excluding Decimal columns by default (pandas-dev#18953) ENH: Support writing timestamps with timezones with to_sql (pandas-dev#22654) CI: Auto-cancel redundant builds (pandas-dev#23523) Preserve EA dtype in DataFrame.stack (pandas-dev#23285) TST: Fix dtype mismatch on 32bit in IntervalTree get_indexer test (pandas-dev#23468) BUG: raise if invalid freq is passed (pandas-dev#23546) remove uses of (ts)?lib.(NaT|iNaT|Timestamp) (pandas-dev#23562) BUG: Fix error message for invalid HTML flavor (pandas-dev#23550) ENH: Support EAs in Series.unstack (pandas-dev#23284) DOC: Updating DataFrame.join docstring (pandas-dev#23471) TST: coverage for skipped tests in io/formats/test_to_html.py (pandas-dev#22888) BUG: Return KeyError for invalid string key (pandas-dev#23540) BUG: DatetimeIndex slicing with boolean Index raises TypeError (pandas-dev#22852) ...
git diff upstream/master -u -- "*.py" | flake8 --diff
Integrated flake8-rst into
code_check.sh
in order to check code in .. code-blocks:: python directives