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: flake8-per-pr for windows users #23707

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

h-vetinari
Copy link
Contributor

This was vaguely inspired by #23658, and by me finding out that windows has a built-in kinda-sorta-grep called findstr.

I've already started using it, and it's proven very useful. However, windows CLI tools are horrible, horribly documented, and just generally have terrible syntax. The command was built together from (approximately):

Some general notes for someone wanting to embark on a similar path:

  • use findstr /?
  • piping is easy (normally), with |
  • the /f in for is a flag for determining what's being iterated over, while %i is the variable
  • to execute a function in the "set" of the for, it must be in single quotes
  • inside those single quotes, the pipe must be "escaped" with ^.
  • order of flags matters
  • findstr has... suboptimal... regex mechanics.

Nevertheless, there could be an even better version (that makes sure we're only checking .py files), that I didn't put in this PR, because I fear it will exceed the line length that's rendered without being cut off:

for /f %i in ('git diff upstream/master --name-only ^| findstr /r "pandas/.*\.py"') do flake8 %i

@TomAugspurger
Copy link
Contributor

I'd be curious to hear your thoughts on #23616.

If we recommend using pre-commit hooks (after verifying that hey work on all platforms) we could remove this doc section entirely.

@jbrockmendel
Copy link
Member

Possibly a silly question: why not just do this in python? Being a cross-platform scripting language and all...

@h-vetinari
Copy link
Contributor Author

Possibly a silly question: why not just do this in python? Being a cross-platform scripting language and all...

Point taken. If/once there is a larger validation script for the user-side of a PR (before pushing), then obviously this isn't necessary.

It was more because the docs mentioned "this can't be done on windows", and I decided to see if that was true. ;-)

As a one-liner (without an additional script file to call), I do find it neat though (or at least as neat as the ugly syntax allows)...

@h-vetinari
Copy link
Contributor Author

Will not bother to restart the already-strained CI (at least Travis) with another restart due to a flaky hypothesis test that clearly cannot be caused by a change in the docs... :)

@gfyoung
Copy link
Member

gfyoung commented Nov 15, 2018

@h-vetinari : FYI, instead of pushing commits to trigger entirely new builds, just ping one of us. We can restart individual builds for you.

I like these doc changes. I would also advocate for a Python-based validation script, but this is a good step in the right direction. I actually have one myself (for more general purpose), if anyone is interested.

@gfyoung gfyoung added Docs Windows Windows OS labels Nov 15, 2018
@codecov
Copy link

codecov bot commented Nov 15, 2018

Codecov Report

Merging #23707 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23707      +/-   ##
==========================================
- Coverage   92.24%   92.24%   -0.01%     
==========================================
  Files         161      161              
  Lines       51339    51336       -3     
==========================================
- Hits        47360    47357       -3     
  Misses       3979     3979
Flag Coverage Δ
#multiple 90.64% <ø> (-0.01%) ⬇️
#single 42.34% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/formats/format.py 97.88% <0%> (-0.01%) ⬇️
pandas/core/series.py 93.68% <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 e413c49...2d5752e. Read the comment docs.

@h-vetinari
Copy link
Contributor Author

@gfyoung

@h-vetinari : FYI, instead of pushing commits to trigger entirely new builds, just ping one of us. We can restart individual builds for you.

I know, but:

  • often there's no-one around
  • I'm impatient (also auto-cancel seems to be finally working reliably again)
  • and most importantly, I feel I'm already pinging y'all too much (e.g. judging from the number of pings that go unanswered for >1 week; this is not a criticism, but a reality of OSS).

Would it be possible to grant "restart-CI" rights (without going into merge-rights and somesuch)?

@gfyoung
Copy link
Member

gfyoung commented Nov 15, 2018

often there's no-one around

I'm impatient (also auto-cancel seems to be finally working reliably again)

Sorry, not sure if can't help you on those 😉 . Time is a relatively limited resource for all of us, but also keep in mind that continually restarting the builds doesn't always work out if the builds already start, which can slow down everyone else's builds, which ultimately can then affect how quickly we can get to all of the PR's and issues that we have.

Would it be possible to grant "restart-CI" rights (without going into merge-rights and somesuch)?

Not for individual builds unfortunately.

@TomAugspurger TomAugspurger merged commit ac8cb03 into pandas-dev:master Nov 15, 2018
@TomAugspurger
Copy link
Contributor

Thanks!

thoo added a commit to thoo/pandas that referenced this pull request Nov 15, 2018
* upstream/master:
  BUG: to_html misses truncation indicators (...) when index=False (pandas-dev#22786)
  API/DEPR: replace "raise_conflict" with "errors" for df.update (pandas-dev#23657)
  BUG: Append DataFrame to Series with dateutil timezone (pandas-dev#23685)
  CLN/CI: Catch that stderr-warning! (pandas-dev#23706)
  ENH: Allow for join between two multi-index dataframe instances (pandas-dev#20356)
  Ensure Index._data is an ndarray (pandas-dev#23628)
  DOC: flake8-per-pr for windows users (pandas-dev#23707)
  DOC: Handle exceptions when computing contributors. (pandas-dev#23714)
  DOC: Validate space before colon docstring parameters pandas-dev#23483 (pandas-dev#23506)
  BUG-22984 Fix truncation of DataFrame representations (pandas-dev#22987)
@h-vetinari h-vetinari deleted the win_fu branch November 15, 2018 19:01
tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
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
Docs Windows Windows OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants