Skip to content

DOC: Mention black and PEP8 in pandas style guide #32043

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

Merged
merged 5 commits into from
Feb 19, 2020

Conversation

raisadz
Copy link
Contributor

@raisadz raisadz commented Feb 16, 2020

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

The idea looks good, just few comments.

@@ -128,6 +128,11 @@ For example:
value = str
f"Unknown received type, got: '{type(value).__name__}'"

PEP8 / black
Copy link
Member

Choose a reason for hiding this comment

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

This is in the wrong section, shouldn't be part of `String formatting.

I think it would make sense to have this as a note at the beginning, than a section of its own.

@@ -128,6 +128,11 @@ For example:
value = str
f"Unknown received type, got: '{type(value).__name__}'"

PEP8 / black
------------
pandas follows the PEP8 standard and uses Black and Flake8 to ensure a
Copy link
Member

Choose a reason for hiding this comment

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

Can you add links to PEP-8, Black,... please

------------
pandas follows the PEP8 standard and uses Black and Flake8 to ensure a
consistent code format throughout the project. For details see the
contributing guide https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#python-pep8-black.
Copy link
Member

Choose a reason for hiding this comment

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

This should be using a sphinx reference, so it's automativally rendered as a link, and not the url as text.

@datapythonista datapythonista added Docs Code Style Code style, linting, code_checks labels Feb 17, 2020
@jorisvandenbossche jorisvandenbossche changed the title Mention black and PEP8 in pandas style guide DOC: Mention black and PEP8 in pandas style guide Feb 17, 2020
and `Flake8 <https://flake8.pycqa.org/en/latest/>`_ to ensure a
consistent code format throughout the project. For details see the
`contributing guide to pandas
<https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#python-pep8-black>`_.
Copy link
Member

Choose a reason for hiding this comment

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

Sphinx can create links to our own documentation automatically, see for example: https://github.com/pandas-dev/pandas/blame/master/doc/source/ecosystem.rst#L181 which will link to this label: https://github.com/pandas-dev/pandas/blame/master/doc/source/user_guide/options.rst#L1

So, in this case something like:

:ref:`contributing guide to pandas<contributing.code-formatting>`

Should create the link to: https://github.com/pandas-dev/pandas/blame/master/doc/source/development/contributing.rst#L650

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me.

@@ -128,7 +134,6 @@ For example:
value = str
f"Unknown received type, got: '{type(value).__name__}'"


Copy link
Member

Choose a reason for hiding this comment

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

small thing, but do you mind restoring this?

@raisadz
Copy link
Contributor Author

raisadz commented Feb 18, 2020

Thanks a lot for your help @datapythonista. Seems that currently it fails tests because of issue #32060. Should work after it resolved.

@datapythonista
Copy link
Member

I think we've got a temporary fix, can you merge master into your branch? I think CI should pass after that.

@datapythonista
Copy link
Member

Something went wrong, the diff is huge now, can you have a look please?

@raisadz
Copy link
Contributor Author

raisadz commented Feb 18, 2020

Yes, sorry, I did something wrong. Will try to fix it now.

@ShaharNaveh
Copy link
Member

If all else fail, run the commands

git fetch upstream
git rebase upstream/master
git push origin issue_31838 --force

(USE ONLY AS LAST RESORT)


Can anyone show me a better way, I am sure that there is one, I just don't know how to do it.
This is the only thing that actually works for me when this kind of thing happened.

@datapythonista
Copy link
Member

In the first section of this post is explained what I do: https://datapythonista.me/blog/useful-git-commands.html

@raisadz
Copy link
Contributor Author

raisadz commented Feb 18, 2020

Thank you for your help! Very much appreciated.

@ShaharNaveh
Copy link
Member

In the first section of this post is explained what I do: https://datapythonista.me/blog/useful-git-commands.html

Bookmarked, thank you @datapythonista

@WillAyd WillAyd added this to the 1.1 milestone Feb 19, 2020
@WillAyd WillAyd merged commit 3cb81ea into pandas-dev:master Feb 19, 2020
@WillAyd
Copy link
Member

WillAyd commented Feb 19, 2020

Thanks @raisadz

roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
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.

DOC: Mention black and PEP8 in pandas style guide
4 participants