2015-10-11 14:53:32 +00:00
|
|
|
HOW TO CONTRIBUTE TO TQDM
|
2015-10-11 17:05:33 +00:00
|
|
|
=========================
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 17:05:33 +00:00
|
|
|
This file describes how to contribute changes to the project, and how to
|
|
|
|
upload to the pypi repository.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-13 13:15:11 +00:00
|
|
|
Most of the management commands have been directly placed inside
|
|
|
|
the Makefile, so you just have to run `make [alias]`.
|
|
|
|
|
2015-10-13 13:25:12 +00:00
|
|
|
Note: to use the Makefile on Windows, you need to install make.exe,
|
|
|
|
for example by installing [MinGW MSYS](http://www.mingw.org/wiki/msys).
|
|
|
|
|
2015-10-11 14:53:32 +00:00
|
|
|
|
2015-10-11 17:05:33 +00:00
|
|
|
HOW TO COMMIT YOUR CONTRIBUTIONS
|
|
|
|
--------------------------------
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 17:05:33 +00:00
|
|
|
Contributions to the project is made using the "Fork & Pull" model. Here's a
|
|
|
|
quickstart on how to do that (your mileage may vary depending on your git
|
|
|
|
config):
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 17:05:33 +00:00
|
|
|
- create an account on [github](https://github.com)
|
|
|
|
- fork [tqdm](https://github.com/tqdm/tqdm)
|
|
|
|
- make a local clone: `git clone https://github.com/your_account/tqdm.git`
|
|
|
|
- make your changes on your local copy
|
2015-10-11 10:18:26 +00:00
|
|
|
- commit your changes `git commit -m "my message"`
|
2015-10-11 17:05:33 +00:00
|
|
|
- TEST YOUR CHANGES (see below)
|
|
|
|
- `push` to your github account: `git push origin`
|
|
|
|
- finally, create a Pull Request (PR) from your github fork
|
|
|
|
(go to your fork's webpage and click on "Pull Request."
|
|
|
|
You can then add a message to describe your proposal.)
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
|
2015-10-11 14:53:32 +00:00
|
|
|
TESTING
|
2015-10-11 17:05:33 +00:00
|
|
|
-------
|
2015-10-11 11:35:16 +00:00
|
|
|
|
2015-10-11 17:05:33 +00:00
|
|
|
To test functionality on your machine (such as before submitting a Pull
|
|
|
|
Request), there are a number of unit tests.
|
2015-10-11 11:35:16 +00:00
|
|
|
|
2015-10-13 22:42:01 +00:00
|
|
|
|
|
|
|
Standard unit testing
|
|
|
|
~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The standard way to run the tests:
|
2015-10-11 17:05:33 +00:00
|
|
|
|
|
|
|
- install `tox`
|
|
|
|
- `cd` to the root of the `tqdm` directory (in the same folder as this file)
|
2015-10-13 13:15:11 +00:00
|
|
|
- run the following command:
|
2015-10-11 11:35:16 +00:00
|
|
|
|
|
|
|
```
|
2015-10-13 22:42:01 +00:00
|
|
|
make test
|
2015-10-11 11:35:16 +00:00
|
|
|
```
|
|
|
|
|
2015-10-13 22:42:01 +00:00
|
|
|
or
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
```
|
2015-10-13 22:42:01 +00:00
|
|
|
tox --skip-missing-interpreters
|
2015-10-11 10:18:26 +00:00
|
|
|
```
|
2015-10-13 13:15:11 +00:00
|
|
|
|
2015-10-13 22:42:01 +00:00
|
|
|
This will build the module and run the tests in a virtualized environment.
|
|
|
|
Wait a bit for tests to complete, and check the console/log for any error and
|
|
|
|
also check the coverage rate. Do not care about missing interpreters errors,
|
|
|
|
this is because tox tries to run the tests on several versions of Python and you
|
|
|
|
don't have them installed.
|
2015-10-13 20:49:38 +00:00
|
|
|
|
2015-10-13 22:42:01 +00:00
|
|
|
Note: to install all versions of the Python interpreter that are specified in
|
|
|
|
[tox.ini](tox.ini), you can use MiniConda to install a minimal setup.
|
2015-10-13 20:49:38 +00:00
|
|
|
You must also make sure that each distribution has an alias to call
|
|
|
|
the Python interpreter: python27 for Python 2.7's interpreter,
|
|
|
|
python32 for Python 3.2's, etc.
|
|
|
|
|
2015-10-13 22:42:01 +00:00
|
|
|
|
|
|
|
Alternative unit testing with Nose
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Alternatively, you can use `nose` to run the tests just for your Python version:
|
|
|
|
|
|
|
|
- install `nose` and `flake8`
|
|
|
|
- run the following commands:
|
|
|
|
|
|
|
|
```
|
|
|
|
make alltests
|
|
|
|
```
|
|
|
|
|
|
|
|
Or if you don't have `make`:
|
|
|
|
|
|
|
|
```
|
|
|
|
nosetests --with-coverage --cover-package=tqdm -v tqdm/
|
|
|
|
python -m flake8 tqdm/_tqdm.py
|
|
|
|
```
|