Skip to content

Commit

Permalink
Updated CONTRIBUTING.md and link in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Apr 19, 2018
1 parent 5dc43a4 commit 9e57047
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 59 deletions.
58 changes: 0 additions & 58 deletions .github/CONTRIBUTING.md

This file was deleted.

68 changes: 68 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Contributing to Surprise
========================

Pull requests are always welcome! Before submitting a new pull request, please
make sure that:

* Your code is [clean](https://www.youtube.com/watch?v=wf-BqAjZb8M),
[pythonic](https://www.youtube.com/watch?v=OSGv2VnC0go), well commented and
also well documented (see below for building the docs).
* The tests are passing. Also, write some tests for the changes you're
proposing. If you're not willing to write tests, it's best not to submit a PR
(it's just a waste of time for everyone).
* Your code follows [PEP 8](https://www.python.org/dev/peps/pep-0008/) as much
as possible. Coding style is automatically checked when tests are run.
* For new prediction algorithms or similarity metrics, please submit a
relevent benchmark outlining the performance of the new feature (in terms of
accuracy, computation time, etc.). You can take a look at
[`examples/benchmarks`](https://github.com/NicolasHug/Surprise/blob/master/examples/benchmark.py)
for inspiration.

Set up
------

It's highly recommended to use a virtual environment. All the packages needed
for the development of Surprise (sphinx, flake8, etc...) can be installed by
running

pip install -r requirements_dev.txt

Then, you can install your local copy of the repo:

pip install -e .

Any change to the code should now be immediately reflected during execution. If
you're modifying Cython code (`.pyx` files), you'll need to compile the code in
order to see the chanes. This can be achieved by running `pip install -e .`
again.

Running and writing tests
-------------------------

Our testing tool is [pytest](http://doc.pytest.org/en/latest/). Running the tests is as
simple as running

pytest

in the root directory.

For writing new tests, check out pytest getting started guide and / or take
inspiration from the current tests in the `tests` directory.


Building the docs locally
-------------------------

The docs can be compiled with

cd doc
make html

You can check the results in `doc/build/html`. Please make sure that the docs
compile without errors. Run `make clean` from time to time in order to avoid
hidden warnings. You can check spelling mistakes by running

make spelling

Legit words that are not recognized can be added in the
`source/spelling_wordlist.txt` file.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ If you'd like to see some features or algorithms implemented in
[Surprise](http://surpriselib.com), please let us know!

Please feel free to contribute (see
[guidelines](https://github.com/NicolasHug/Surprise/blob/master/.github/CONTRIBUTING.md))
[guidelines](https://github.com/NicolasHug/Surprise/blob/master/CONTRIBUTING.md))
and send pull requests!

For bugs, issues or questions about [Surprise](http://surpriselib.com), you can
Expand Down

0 comments on commit 9e57047

Please sign in to comment.