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

DOC: more consistent flake8-commands in contributing.rst #23724

Merged
merged 5 commits into from
Nov 20, 2018

Conversation

h-vetinari
Copy link
Contributor

@h-vetinari h-vetinari commented Nov 15, 2018

After #23707, I was looking at the rendered results in https://pandas-docs.github.io/pandas-docs-travis/contributing.html#id54, and noticed some inconsistencies:

  • the linux commands use git diff master as opposed to git diff upstream/master; this is also in contrast to what's in the PR template
  • the windows command does not match .py (because the command was getting long)
  • we're already matching filenames directly as a parameter to git, which makes it redundant to pipe to grep.

This PR proposes to harmonize those things. Sorry I overlooked them in #23707.

@codecov
Copy link

codecov bot commented Nov 15, 2018

Codecov Report

Merging #23724 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23724   +/-   ##
=======================================
  Coverage   92.25%   92.25%           
=======================================
  Files         161      161           
  Lines       51383    51383           
=======================================
  Hits        47404    47404           
  Misses       3979     3979
Flag Coverage Δ
#multiple 90.64% <ø> (ø) ⬆️
#single 42.31% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/strings.py 98.58% <0%> (ø) ⬆️
pandas/plotting/_core.py 83.63% <0%> (ø) ⬆️
pandas/core/indexing.py 93.87% <0%> (ø) ⬆️
pandas/core/generic.py 96.82% <0%> (ø) ⬆️
pandas/core/arrays/categorical.py 95.34% <0%> (ø) ⬆️
pandas/core/window.py 96.4% <0%> (ø) ⬆️
pandas/core/arrays/datetimes.py 98.47% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a23f901...54cbc29. Read the comment docs.

@@ -575,7 +575,7 @@ the `flake8 <https://pypi.org/project/flake8>`_ tool
and report any stylistic errors in your code. Therefore, it is helpful before
submitting code to run the check yourself on the diff::

git diff master -u -- "*.py" | flake8 --diff
git diff upstream/master -u -- "pandas/*.py" | flake8 --diff
Copy link
Member

Choose a reason for hiding this comment

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

why "pandas/*.py"? I think we should also check .py files in scripts/, ci/ and everywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@datapythonista
Happy to remove that too, if desired. As the PR stands, this was another inconsistency, and all the other commands (i.a. also the raison-d'être for grep) are filtering to pandas/.

Copy link
Member

Choose a reason for hiding this comment

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

Don't think it's relevant here but want to call out that there can certainly be performance implications to not restricting queries to the pandas directory. For instance, when grepping from the top level if you don't restrict to that folder you could have a command that runs potentially much longer if it starts searching through the asv_bench environments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but it's only checking the diff anyway, which - even in the asv_bench - will be relatively small (or, for most PRs, non-existent)

@datapythonista datapythonista added Docs Code Style Code style, linting, code_checks labels Nov 15, 2018
@h-vetinari
Copy link
Contributor Author

Failure is due to #23726

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Rather than try to continually harmonize these can't we update the make rule and reference that instead?

@h-vetinari
Copy link
Contributor Author

@WillAyd

Rather than try to continually harmonize these can't we update the make rule and reference that instead?

AFAICT, the make.py is only for the docs (currently: https://pandas-docs.github.io/pandas-docs-travis/contributing.html#id49).

To me, these commands make sense to have, and it's not so much a continual harmonization, as a one-off (partly, but not only due to #23707, where I had focused more on just the windows side).

@WillAyd
Copy link
Member

WillAyd commented Nov 18, 2018

I'm not referring to make.py but rather the Makefile in the top level directory:

lint-diff:

@h-vetinari
Copy link
Contributor Author

@WillAyd, well, that part isn't windows-compatible (at least not out-of-the-box) - no make command... It would be another thing to harmonize in this PR though, as the grep in there is useless, and it should compare to upstream/master.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

@h-vetinari
Copy link
Contributor Author

Failure is just the rank segfault

@jreback jreback added this to the 0.24.0 milestone Nov 20, 2018
@jreback jreback merged commit df5eeec into pandas-dev:master Nov 20, 2018
@jreback
Copy link
Contributor

jreback commented Nov 20, 2018

thanks!

thoo added a commit to thoo/pandas that referenced this pull request Nov 20, 2018
…fixed

* upstream/master:
  DOC: more consistent flake8-commands in contributing.rst (pandas-dev#23724)
  DOC: Fixed the doctsring for _set_axis_name (GH 22895) (pandas-dev#22969)
  DOC: Improve GL03 message re: blank lines at end of docstrings. (pandas-dev#23649)
  TST: add tests for keeping dtype in Series.update (pandas-dev#23604)
  TST: For GH4861, Period and datetime in multiindex (pandas-dev#23776)
  TST: move .str-test to strings.py & parametrize it; precursor to pandas-dev#23582 (pandas-dev#23777)
  STY: isort tests/scalar, tests/tslibs, import libwindow instead of _window (pandas-dev#23787)
  BUG: fixed .str.contains(..., na=False) for categorical series (pandas-dev#22170)
  BUG: Maintain column order with groupby.nth (pandas-dev#22811)
  API/DEPR: replace kwarg "pat" with "sep" in str.[r]partition (pandas-dev#23767)
  CLN: Finish isort core (pandas-dev#23765)
  TST: Mark test_pct_max_many_rows with pytest.mark.single (pandas-dev#23799)
@h-vetinari h-vetinari deleted the contrib_flake8 branch November 20, 2018 06:53
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants