-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated CONTRIBUTING.md and link in README.md
- Loading branch information
1 parent
5dc43a4
commit 9e57047
Showing
3 changed files
with
69 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters