|
| 1 | +# Development Guidelines |
| 2 | + |
| 3 | +This document describes tools, tasks and workflow that one needs to be familiar with in order to effectively maintain |
| 4 | +this project. If you use this package within your own software as is but don't plan on modifying it, this guide is |
| 5 | +**not** for you. |
| 6 | + |
| 7 | +## Tools |
| 8 | + |
| 9 | +* [Pip](https://pip.pypa.io/): a command line package installer for Python. This tool is typically |
| 10 | + included with recent versions of Python. |
| 11 | + |
| 12 | +* [virtualenv](https://virtualenv.pypa.io/): a tool to create isolated Python environments. The |
| 13 | + first thing you should do once you've cloned this repository is to run `pip install virtualenv; |
| 14 | + virtualenv venv; source venv/bin/activate` to create an environment and load it in your shell. |
| 15 | + This helps keep all the python packages you install and use isolated into a project specific |
| 16 | + location on your system, which helps keep you out of dependency hell. You can exit the |
| 17 | + environment using `$ deactivate`. |
| 18 | + |
| 19 | +* [tox](https://testrun.org/tox/): a testing automation tool that can load many Python versions. |
| 20 | + This tool allows the project to test against all the compatible versions of Python by leveraging |
| 21 | + virtualenv and describing the tasks in a metadata file. |
| 22 | + |
| 23 | +## Tasks |
| 24 | + |
| 25 | +### Building |
| 26 | + |
| 27 | +Building isn't necessarily required for a python package, but it is possible. By running the command |
| 28 | +`$ python setup.py build`, an installable package will be placed in the `build/` directory. |
| 29 | + |
| 30 | +A more useful command is `$ python setup.py develop` which will make the package importable from any |
| 31 | +other script in your environment, and continue to update and you make changes. |
| 32 | + |
| 33 | +### Testing |
| 34 | + |
| 35 | +This project's tests are kicked off by tox. The `tox.ini` file describes the automation. In |
| 36 | +a nutshell, it selects a Python version, installs test dependencies stored in |
| 37 | +`test_requirements.txt`, and then runs `nosetests`. [Nose](https://nose.readthedocs.org) is the |
| 38 | +actual test runner. All of this can be ran using the following command: `$ tox` |
| 39 | + |
| 40 | +### Generating Documentation |
| 41 | + |
| 42 | +**TODO** |
| 43 | + |
| 44 | +### Releasing |
| 45 | + |
| 46 | +In order to create a release, the following should be completed in order. |
| 47 | + |
| 48 | +1. Ensure all tests are passing (`tox`) and that there is enough test coverage. |
| 49 | +1. Make sure you are on the `master` branch of the repository, with all changes merged/committed already. |
| 50 | +1. Update the version number in the source code (`opentok/version.py`) and the README. See [Versioning](#versioning) for |
| 51 | + information about selecting an appropriate version number. |
| 52 | +1. Commit the version number change with the message ("Update to version v.x.x.x"), substituting the new version number. |
| 53 | +1. Create a git tag: `git tag -a vx.y.z -m "Release vx.y.z"` |
| 54 | +1. Ensure you have permission to update the `opentok` package on PyPI: <https://pypi.python.org/pypi/opentok>. |
| 55 | +1. Run `python setup.py sdist upload`, which will build and upload the package to PyPI. |
| 56 | +1. Change the version number for future development by adding "a1", then make another commit with the message |
| 57 | + "Beginning development on next version". |
| 58 | +1. Push the changes to the main repository (`git push origin master`). |
| 59 | +1. Upload the `dist/opentok-x.y.z.tar.gz` file to the |
| 60 | + [Github Releases](https://github.com/opentok/opentok-python-sdk/releases) page with a description and release notes. |
| 61 | + |
| 62 | +## Workflow |
| 63 | + |
| 64 | +### Versioning |
| 65 | + |
| 66 | +The project uses [semantic versioning](http://semver.org/) as a policy for incrementing version numbers. For planned |
| 67 | +work that will go into a future version, there should be a Milestone created in the Github Issues named with the version |
| 68 | +number (e.g. "v2.2.1"). |
| 69 | + |
| 70 | +During development the version number should end in "a1" or "bx", where x is an increasing number starting |
| 71 | +from 1. |
| 72 | + |
| 73 | +### Branches |
| 74 | + |
| 75 | +* `master` - the main development branch. |
| 76 | +* `feat.foo` - feature branches. these are used for longer running tasks that cannot be accomplished in one commit. |
| 77 | + once merged into master, these branches should be deleted. |
| 78 | +* `vx.x.x` - if development for a future version/milestone has begun while master is working towards a sooner |
| 79 | + release, this is the naming scheme for that branch. once merged into master, these branches should be deleted. |
| 80 | + |
| 81 | +### Tags |
| 82 | + |
| 83 | +* `vx.x.x` - commits are tagged with a final version number during release. |
| 84 | + |
| 85 | +### Issues |
| 86 | + |
| 87 | +Issues are labelled to help track their progress within the pipeline. |
| 88 | + |
| 89 | +* no label - these issues have not been triaged. |
| 90 | +* `bug` - confirmed bug. aim to have a test case that reproduces the defect. |
| 91 | +* `enhancement` - contains details/discussion of a new feature. it may not yet be approved or placed into a |
| 92 | + release/milestone. |
| 93 | +* `wontfix` - closed issues that were never addressed. |
| 94 | +* `duplicate` - closed issue that is the same to another referenced issue. |
| 95 | +* `question` - purely for discussion |
| 96 | + |
| 97 | +### Management |
| 98 | + |
| 99 | +When in doubt, find the maintainers and ask. |
0 commit comments