Skip to content

Commit

Permalink
Added CONTRIBUTING.md, updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaaun committed Jul 4, 2020
1 parent e13df3d commit 3941c4f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing to the backend

## Make sure you don't break the existing tests
Currently there are unit tests using `unittest` from the Python Standard Library in the
[backend/tests/](backend/tests/) directory. In addition, we have continuous integration
setup on Github. Everytime someone makes a pull request to `master`, Github
automatically starts testing the code and shows the result in the pull request. Have a
look at [this pull request](https://github.com/davidatbu/openFraming/pull/144) where
this continuous integration was setup for what that looks like.

Therefore, before making any pull requests that affect the backend, it is wise to make
sure that all the tests are passing locally on your machine. To run all the tests, you
can type the following command assuming your current working directory is `backend/`

$ python -m unittest

If you've never done unit testing before, have a look at
[backend/tests/test_utils.py](backend/tests/test_utils.py), which has a testing for one
method from the `Validate` class in
[backend/flask_app/utils.py](backend/flask_app/utils.py). Additionally, the
[official documentation on the `unittest`
library](https://docs.python.org/3/library/unittest.html) is pretty readable. If you
will be writing code dealing with Flask, I would suggest you try to understand the
`TestClassifiers.test_get` method in
[test_classifier.py](backend/tests/test_classifier.py), and you'll have to read parts of
[Flask's documentation on testing](https://flask.palletsprojects.com/en/1.1.x/testing/).

## You're encouraged to write your own tests
If you contribute new features, you'll have to make sure that they don't break existing
functionality. Feel free to make a pull request even if the tests are not passing
locally, and we can debug together.

You're not required to write new tests for new features, but you are welcome to!
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ Python 3.5 or higher is required (due to use of PEP 526 style annotations).

### Download additional requirements

### Install Redis
This step will depend on your operating system. On Ubuntu, this is as simple as:

$ sudo apt-get install redis

For Windows, you might have to look at [Memiurai](https://www.memurai.com), a drop-in replacement for
Redis.

### NLTK Corpora
$ python -m nltk.downloader stopwords wordnet

### Mallet
The installation of the Mallet library will depend on your platform. Have a look
The installation of the Mallet library will depend on your operating system. Have a look
at the [installation instructions on their website.](http://mallet.cs.umass.edu/download.php).
On Unix, it would look something like:

Expand All @@ -27,7 +35,7 @@ On Unix, it would look something like:
$ tar -xvf ~/mallet-2.0.8.tar.gz --one-top-level=$HOME/mallet

One then has to export the directory where the mallet executable is found as an environment variable.
(This also depends on your platform).
(This also depends on your operating system).

$ export MALLET_BIN_DIRECTORY=$HOME/mallet/mallet-2.0.8/bin

Expand Down

0 comments on commit 3941c4f

Please sign in to comment.