Skip to content

Commit 5d6bbe8

Browse files
author
y-p
committed
Merge pull request #5721 from y-p/PR_contributing
DOC: trim CONTRIBUTING.MD
2 parents 4b1cfbb + fde69e4 commit 5d6bbe8

File tree

1 file changed

+31
-81
lines changed

1 file changed

+31
-81
lines changed

CONTRIBUTING.md

+31-81
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,39 @@ All contributions, bug reports, bug fixes, documentation improvements,
44
enhancements and ideas are welcome.
55

66
The [GitHub "issues" tab](https://github.com/pydata/pandas/issues)
7-
contains some issues labeled "Good as first PR"; these are
8-
tasks which do not require deep knowledge of the package. Look those up if you're
7+
contains some issues labeled "Good as first PR"; Look those up if you're
98
looking for a quick way to help out.
109

11-
Please try and follow these guidelines, as this makes it easier for us to accept
12-
your contribution or address the issue you're having.
13-
1410
#### Bug Reports
1511

1612
- Please include a short, self-contained Python snippet reproducing the problem.
1713
You can have the code formatted nicely by using [GitHub Flavored Markdown](http://github.github.com/github-flavored-markdown/) :
1814

1915
```python
20-
16+
2117
print("I ♥ pandas!")
2218

2319
```
2420

25-
- A [test case](https://github.com/pydata/pandas/tree/master/pandas/tests) may be more helpful.
26-
- Specify the pandas (and NumPy) version used. (check `pandas.__version__`
27-
and `numpy.__version__`)
28-
- Explain what the expected behavior was, and what you saw instead.
29-
- If the issue seems to involve some of [pandas' dependencies](https://github.com/pydata/pandas#dependencies)
30-
such as
31-
[NumPy](http://numpy.org),
32-
[matplotlib](http://matplotlib.org/), and
33-
[PyTables](http://www.pytables.org/)
34-
you should include (the relevant parts of) the output of
21+
- Specify the pandas version used and those of it's dependencies. You can simply include the output of
3522
[`ci/print_versions.py`](https://github.com/pydata/pandas/blob/master/ci/print_versions.py).
23+
- Explain what the expected behavior was, and what you saw instead.
3624

3725
#### Pull Requests
3826

39-
- **Make sure the test suite passes** for both python2 and python3.
40-
You can use `test_fast.sh`, **tox** locally, and/or enable **Travis-CI** on your fork.
41-
See "Getting Travis-CI going" below.
27+
- **Make sure the test suite passes** on your box, Use the provided `test_*.sh` scripts or tox.
28+
- Enable [Travis-Ci](http://travis-ci.org/pydata/pandas). See "Getting Travis-CI going" below.
29+
- Use [proper commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html):
30+
- a subject line with `< 80` chars.
31+
- One blank line.
32+
- Optionally, a commit message body.
33+
- Please reference relevant Github issues in your commit message using `GH1234`
34+
or `#1234`. Either style is fine but the '#' style generates nose when your rebase your PR.
35+
- `doc/source/release.rst` and `doc/source/vx.y.z.txt` contain an ongoing
36+
changelog for each release. Add entries to these files
37+
as needed in a separate commit in your PR: document the fix, enhancement,
38+
or (unavoidable) breaking change.
39+
- Keep style fixes to a separate commit to make your PR more readable.
4240
- An informal commit message format is in effect for the project. Please try
4341
and adhere to it. Check `git log` for examples. Here are some common prefixes
4442
along with general guidelines for when to use them:
@@ -49,69 +47,25 @@ your contribution or address the issue you're having.
4947
- **BLD**: Updates to the build process/scripts
5048
- **PERF**: Performance improvement
5149
- **CLN**: Code cleanup
52-
- Commit messages should have:
53-
- a subject line with `< 80` chars
54-
- one blank line
55-
- a commit message body, if there's a need for one
56-
- If you are changing any code, you should enable Travis-CI on your fork
57-
to make it easier for the team to see that the PR does indeed pass all the tests.
58-
- **Backward-compatibility really matters**. Pandas already has a large user base and
59-
a lot of existing user code.
60-
- Don't break old code if you can avoid it.
61-
- If there is a need, explain it in the PR.
62-
- Changes to method signatures should be made in a way which doesn't break existing
63-
code. For example, you should beware of changes to ordering and naming of keyword
64-
arguments.
50+
- Maintain backward-compatibility. Pandas has lots of users with lots of existing code. Don't break it.
51+
- If you think breakage is required clearly state why as part of the PR.
52+
- Be careful when changing method signatures.
6553
- Add deprecation warnings where needed.
66-
- Performance matters. You can use the included `test_perf.sh`
67-
script to make sure your PR does not introduce any new performance regressions
68-
in the library.
54+
- Performance matters. Make sure your PR hasn't introduced perf regressions by using `test_perf.sh`.
6955
- Docstrings follow the [numpydoc](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt) format.
56+
- When writing tests, use 2.6 compatible `self.assertFoo` methods. Some polyfills such as `assertRaises`
57+
can be found in `pandas.util.testing`.
58+
- Generally, pandas source files should not contain attributions. You can include a "thanks to..."
59+
in the release changelog. The rest is `git blame`/`git log`.
60+
- For extra brownie points, you can squash and reorder the commits in your PR using `git rebase -i`.
61+
Use your own judgment to decide what history needs to be preserved. If git frightens you, that's OK too.
62+
- Use `raise AssertionError` over `assert` unless you want the assertion stripped by `python -o`.
7063
- **Don't** merge upstream into a branch you're going to submit as a PR.
7164
This can create all sorts of problems. Use `git rebase` instead. This ensures
7265
no merge conflicts occur when your code is merged by the core team.
73-
- Please reference the GH issue number in your commit message using `GH1234`
74-
or `#1234`. Either style is fine.
75-
- Use `raise AssertionError` rather then plain `assert` in library code (`assert` is fine
76-
for test code). `python -o` strips assertions. Better safe than sorry.
77-
- When writing tests, don't use "new" assertion methods added to the `unittest` module
78-
in 2.7 since pandas currently supports 2.6. The most common pitfall is:
79-
80-
with self.assertRaises(ValueError):
81-
foo
82-
83-
84-
which fails with Python 2.6. You need to use `assertRaises` from
85-
`pandas.util.testing` instead (or use `self.assertRaises(TheException,func,args)`).
86-
87-
- `doc/source/release.rst` and `doc/source/vx.y.z.txt` contain an ongoing
88-
changelog for each release. Add entries to these files
89-
as needed in a separate commit in your PR: document the fix, enhancement,
90-
or (unavoidable) breaking change.
91-
- For extra brownie points, use `git rebase -i` to squash and reorder
92-
commits in your PR so that the history makes the most sense. Use your own
93-
judgment to decide what history needs to be preserved.
94-
- Pandas source code should not -- with some exceptions, such as 3rd party licensed code --
95-
generally speaking, include an "Authors" list or attribution to individuals in source code.
96-
`RELEASE.rst` details changes and enhancements to the code over time.
97-
A "thanks goes to @JohnSmith." as part of the appropriate entry is a suitable way to acknowledge
98-
contributions. The rest is `git blame`/`git log`.
99-
Feel free to ask the commiter who merges your code to include such an entry
100-
or include it directly yourself as part of the PR if you'd like to.
101-
**We're always glad to have new contributors join us from the ever-growing pandas community.**
102-
You may also be interested in the copyright policy as detailed in the pandas [LICENSE](https://github.com/pydata/pandas/blob/master/LICENSE).
66+
- The pandas copyright policy is detailed in the pandas [LICENSE](https://github.com/pydata/pandas/blob/master/LICENSE).
10367
- On the subject of [PEP8](http://www.python.org/dev/peps/pep-0008/): yes.
104-
- On the subject of massive PEP8 fix PRs touching everything, please consider the following:
105-
- They create noisy merge conflicts for people working in their own fork.
106-
- They make `git blame` less effective.
107-
- Different tools / people achieve PEP8 in different styles. This can create
108-
"style wars" and churn that produces little real benefit.
109-
- If your code changes are intermixed with style fixes, they are harder to review
110-
before merging. Keep style fixes in separate commits.
111-
- It's fine to clean-up a little around an area you just worked on.
112-
- Generally it's a BAD idea to PEP8 on documentation.
113-
114-
Having said that, if you still feel a PEP8 storm is in order, go for it.
68+
- On the subject of a massive PEP8-storm touching everything: not too often (once per release works).
11569

11670
### Notes on plotting function conventions
11771

@@ -137,11 +91,7 @@ Here's a few high-level notes:
13791

13892
See the Green "Good to merge!" banner? that's it.
13993

140-
This is especially important for new contributors, as members of the pandas dev team
141-
like to know that the test suite passes before considering it for merging.
142-
Even regular contributors who test religiously on their local box (using tox
143-
for example) often rely on a PR+travis=green to make double sure everything
144-
works ok on another system, as occasionally, it doesn't.
94+
It's important to get travis working as PRs won't generally get merged until travis is green.
14595

14696
#### Steps to enable Travis-CI
14797

0 commit comments

Comments
 (0)