2015-10-11 10:18:26 +00:00
|
|
|
CONTRIBUTING TO TQDM
|
2015-10-11 11:35:16 +00:00
|
|
|
=====================
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +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-11 11:35:16 +00:00
|
|
|
HOW TO COMMIT YOUR CONTRIBUTIONS
|
|
|
|
-----------------------------------------------------------
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +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
|
|
|
|
|
|
|
- first create an account on github.
|
2015-10-11 11:35:16 +00:00
|
|
|
- then go on the tqdm page `https://github.com/tqdm/tqdm` and fork it
|
|
|
|
(click on the fork button).
|
|
|
|
- now make a local clone of the project:
|
|
|
|
`git clone https://github.com/your_account/tqdm.git`
|
2015-10-11 10:18:26 +00:00
|
|
|
- do your changes on your local copy.
|
|
|
|
- commit your changes `git commit -m "my message"`
|
|
|
|
- TEST YOUR CHANGES (see below).
|
|
|
|
- push to your github account `git push origin`
|
2015-10-11 11:35:16 +00:00
|
|
|
- and now you can make a `Pull Request` from your github fork by
|
|
|
|
going to the webpage and clicking on `Pull Request`. You can then add a
|
|
|
|
message to describe your proposal.
|
|
|
|
- Your changes will then be reviewed and integrated into the project if OK.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
TESTING -------------
|
|
|
|
|
|
|
|
Before submitting a Pull Request, you need to make sure that all the
|
|
|
|
unit tests pass. This will ensure that your changes did not introduce
|
|
|
|
any regression in the features that already working.
|
|
|
|
|
|
|
|
To run the test, cd to the root of the tqdm folder (in the same folder
|
2015-10-11 14:49:12 +00:00
|
|
|
as this file), and then type the following (you need to install `tox`):
|
2015-10-11 11:35:16 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
make test
|
|
|
|
make coverage
|
|
|
|
make flake8
|
|
|
|
```
|
|
|
|
|
|
|
|
Alternatively, if you can't use the Makefile, you can use the following to run
|
|
|
|
the tests (you need to install the `nosetest` python module before):
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
nosetests --with-coverage --cover-package=tqdm -v tqdm/
|
|
|
|
python -m flake8 tqdm/_tqdm.py
|
|
|
|
```
|
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
If all the tests pass, then everything's good, you can submit a Pull Request.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
SEMANTIC VERSIONING
|
2015-10-11 11:35:16 +00:00
|
|
|
----------------------------------
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
The tqdm repository managers should regularly bump the version number in
|
|
|
|
the VERSION file to follow the [Semantic Versioning](http://semver.org/)
|
|
|
|
convention.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
Tools can be used to automate this process, such as
|
|
|
|
[bumpversion](https://github.com/peritus/bumpversion) or
|
|
|
|
[python-semanticversion](https://github.com/rbarrois/python-semanticvers
|
|
|
|
ion/) to automate this task.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
The managers should take care of this instead of users to avoid PR
|
|
|
|
conflicts solely due to the VERSION file bumping.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
UPLOADING TO PYPI
|
2015-10-11 11:35:16 +00:00
|
|
|
------------------------------
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
First, we need to check the setup.py and MANIFEST.in files, which define
|
|
|
|
the packaging process and the infos that will be uploaded to pypi.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
You can check the result easily by using the following commands:
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
python setup.py develop --uninstall
|
|
|
|
python setup.py develop
|
2015-10-11 11:35:16 +00:00
|
|
|
```
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
Secondly, we need to build tqdm into a distributable python package:
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
```
|
2015-10-11 11:35:16 +00:00
|
|
|
python setup.py sdist --formats=gztar,zip bdist_wininst
|
|
|
|
--plat-name=win32 python setup.py sdist bdist_egg bdist_wheel
|
|
|
|
--plat-name=win32
|
|
|
|
```
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
This will generate several builds in the dist/ folder.
|
2015-10-11 10:18:26 +00:00
|
|
|
|
2015-10-11 11:35:16 +00:00
|
|
|
Finally, we can upload everything to pypi. Uploading to pypi can be done
|
|
|
|
easily using the [twine](https://github.com/pypa/twine) module:
|
2015-10-11 10:18:26 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
twine upload dist/*
|
2015-10-11 11:35:16 +00:00
|
|
|
```
|
|
|
|
|