<commit_before># How to contribute

## How to prepare

* You need a [GitHub account](https://github.com/signup/free)
* Submit an [issue ticket](https://github.com/tomato42/tlslite-ng/issues) for
  your issue if there is none yet.
  * Describe the issue and include steps to reproduce if it's a bug, mention
    the earliest version that you know is affected and the version you're using.
  * Describe the enhancement and your general ideas on how to implement it
    if you want to add new feature or extend existing one. This is not
    necessary if the change is small.
* If you are able and want to fix the issue, fork the repository on GitHub

## Technical requirements

To be able to work on the code you will need few pieces of software installed.
The most important is `python` interpreter. Some development dependencies have
additional restrictions on the versions used, so I recommend Python 2.7 or
Python 3.4 as the lowest versions. Git client, make, text editor and ability to
install local python packages (ability to run pip).

The list goes as follows:
 * python (2.7 or 3.4)
 * git
 * GNU make
 * pip

The python module dependencies are as follows:
 * ecdsa
 * pylint
 * diff_cover
 * coverage
 * hypothesis

On Fedora they can be installed using:
```
dnf install python-ecdsa python3-ecdsa pylint python3-pylint python-diff-cover \
    python3-diff-cover python-coverage python3-coverage python2-hypothesis \
    python3-hypothesis
```

Optional module dependencies:
 * tackpy
 * m2crypto
 * pycrypto
 * gmpy

On Fedora they can be installed using:
```
pip install tackpy
dnf install m2crypto python-crypto python3-crypto python-gmpy2 python3-gmpy2
```

## Make changes

* In your forked repository, create a topic branch for your upcoming patch
  (e.g. 'implement-aria' or 'bugfix-osx-crash')
  * usually this is based on the master branch
  * to create branch based on master: `git branch <example-name>` then
    checkout the branch `git checkout <example-name>`. For your own convinience
    avoid working directly on the `master` branch.
* Make sure you stick to the coding style that is used in surrounding code
  * you can use `pylint --msg-template="{path}:{line}: [{msg_id}({symbol}),
    {obj}] {msg}" tlslite > pylint_report.txt; diff-quality --violations=pylint
    pylint_report.txt` to see if your changes do not violate the general
    guidelines (alternatively you can just run `make test-dev` as described<commit_msg>add dependency on unittest and mock for development<commit_after># How to contribute

## How to prepare

* You need a [GitHub account](https://github.com/signup/free)
* Submit an [issue ticket](https://github.com/tomato42/tlslite-ng/issues) for
  your issue if there is none yet.
  * Describe the issue and include steps to reproduce if it's a bug, mention
    the earliest version that you know is affected and the version you're using.
  * Describe the enhancement and your general ideas on how to implement it
    if you want to add new feature or extend existing one. This is not
    necessary if the change is small.
* If you are able and want to fix the issue, fork the repository on GitHub

## Technical requirements

To be able to work on the code you will need few pieces of software installed.
The most important is `python` interpreter. Some development dependencies have
additional restrictions on the versions used, so I recommend Python 2.7 or
Python 3.4 as the lowest versions (see .travis.yml if you want details).
Git client, make, text editor and ability to
install local python packages (ability to run pip).

The list goes as follows:
 * python (2.7 or 3.4)
 * git
 * GNU make
 * pip

The python module dependencies are as follows:
 * unittest (unittest2 on Python 2; should be part of Python 3 install)
 * mock (should be part of Python 3 distribution of unittest)
 * ecdsa
 * pylint
 * diff_cover
 * coverage
 * hypothesis

On Fedora they can be installed using:
```
dnf install python-ecdsa python3-ecdsa pylint python3-pylint python-diff-cover \
    python3-diff-cover python-coverage python3-coverage python2-hypothesis \
    python3-hypothesis python3-libs python-unittest2 python-mock
```

Optional module dependencies:
 * tackpy
 * m2crypto
 * pycrypto
 * gmpy

On Fedora they can be installed using:
```
pip install tackpy
dnf install m2crypto python-crypto python3-crypto python-gmpy2 python3-gmpy2
```

## Make changes

* In your forked repository, create a topic branch for your upcoming patch
  (e.g. 'implement-aria' or 'bugfix-osx-crash')
  * usually this is based on the master branch
  * to create branch based on master: `git branch <example-name>` then
    checkout the branch `git checkout <example-name>`. For your own convinience
    avoid working directly on the `master` branch.
* Make sure you stick to the coding style that is used in surrounding code
  * you can use `pylint --msg-template="{path}:{line}: [{msg_id}({symbol}),
    {obj}] {msg}" tlslite > pylint_report.txt; diff-quality --violations=pylint
    pylint_report.txt` to see if your changes do not violate the general
    guidelines (alternatively you can just run `make test-dev` as described
{'fraction_non_alphanumeric': 0.07259316770186336, 'fraction_numerical': 0.009704968944099378, 'mean_word_length': 3.9548076923076922, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3572342', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1440, 'n_words': 691}