<commit_before>============
Contributing
============

.. _hacking:

Hacking
=======

Start by :doc:`installing dependencies and setting up Let's Encrypt
<using>`.

When you're done activate the virtualenv:

.. code-block:: shell

   source ./venv/bin/activate

This step should prepend you prompt with ``(venv)`` and save you from
typing ``./venv/bin/...``. It is also required to run some of the
`testing`_ tools. Virtualenv can be disabled at any time by typing
``deactivate``. More information can be found in `virtualenv
documentation`_.

Install the development packages:

.. code-block:: shell

   pip install -r requirements.txt -e acme -e .[dev,docs,testing] -e letsencrypt-apache -e letsencrypt-nginx -e letshelp-letsencrypt

.. note:: `-e` (short for `--editable`) turns on *editable mode* in
          which any source code changes in the current working
          directory are "live" and no further `pip install ...`
          invocations are necessary while developing.

          This is roughly equivalent to `python setup.py develop`. For
          more info see `man pip`.

The code base, including your pull requests, **must** have 100% unit
test coverage, pass our `integration`_ tests **and** be compliant with
the :ref:`coding style <coding-style>`.

.. _`virtualenv documentation`: https://virtualenv.pypa.io


Testing
-------

The following tools are there to help you:

- ``tox`` starts a full set of tests. Please make sure you run it
  before submitting a new pull request.

- ``tox -e cover`` checks the test coverage only. Calling the
  ``./tox.cover.sh`` script directly (or even ``./tox.cover.sh $pkg1
  $pkg2 ...`` for any subpackages) might be a bit quicker, though.

- ``tox -e lint`` checks the style of the whole project, while
  ``pylint --rcfile=.pylintrc path`` will check a single file or
  specific directory only.

- For debugging, we recommend ``pip install ipdb`` and putting
  ``import ipdb; ipdb.set_trace()`` statement inside the source
  code. Alternatively, you can use Python'd standard library `pdb`,
  but you won't get TAB completion...


Integration
~~~~~~~~~~~

First, install `Go`_ 1.5 and start Boulder_, an ACME CA server::

  ./tests/boulder-start.sh

The script will download, compile and run the executable; please be
patient - it will take some time... Once its ready, you will see
``Server running, listening on 127.0.0.1:4000...``. You may now run
(in a separate terminal)::

  ./tests/boulder-integration.sh && echo OK || echo FAIL

If you would like to test `letsencrypt_nginx` plugin (highly
encouraged) make sure to install prerequisites as listed in
``tests/integration/nginx.sh``:

.. include:: ../letsencrypt-nginx/tests/boulder-integration.sh
   :start-line: 1
   :end-line: 2
   :code: shell

and rerun the integration tests suite.

.. _Boulder: https://github.com/letsencrypt/boulder
.. _Go: https://golang.org


Vagrant
-------
<commit_msg>fix path to script with nginx prerequisites<commit_after>============
Contributing
============

.. _hacking:

Hacking
=======

Start by :doc:`installing dependencies and setting up Let's Encrypt
<using>`.

When you're done activate the virtualenv:

.. code-block:: shell

   source ./venv/bin/activate

This step should prepend you prompt with ``(venv)`` and save you from
typing ``./venv/bin/...``. It is also required to run some of the
`testing`_ tools. Virtualenv can be disabled at any time by typing
``deactivate``. More information can be found in `virtualenv
documentation`_.

Install the development packages:

.. code-block:: shell

   pip install -r requirements.txt -e acme -e .[dev,docs,testing] -e letsencrypt-apache -e letsencrypt-nginx -e letshelp-letsencrypt

.. note:: `-e` (short for `--editable`) turns on *editable mode* in
          which any source code changes in the current working
          directory are "live" and no further `pip install ...`
          invocations are necessary while developing.

          This is roughly equivalent to `python setup.py develop`. For
          more info see `man pip`.

The code base, including your pull requests, **must** have 100% unit
test coverage, pass our `integration`_ tests **and** be compliant with
the :ref:`coding style <coding-style>`.

.. _`virtualenv documentation`: https://virtualenv.pypa.io


Testing
-------

The following tools are there to help you:

- ``tox`` starts a full set of tests. Please make sure you run it
  before submitting a new pull request.

- ``tox -e cover`` checks the test coverage only. Calling the
  ``./tox.cover.sh`` script directly (or even ``./tox.cover.sh $pkg1
  $pkg2 ...`` for any subpackages) might be a bit quicker, though.

- ``tox -e lint`` checks the style of the whole project, while
  ``pylint --rcfile=.pylintrc path`` will check a single file or
  specific directory only.

- For debugging, we recommend ``pip install ipdb`` and putting
  ``import ipdb; ipdb.set_trace()`` statement inside the source
  code. Alternatively, you can use Python'd standard library `pdb`,
  but you won't get TAB completion...


Integration
~~~~~~~~~~~

First, install `Go`_ 1.5 and start Boulder_, an ACME CA server::

  ./tests/boulder-start.sh

The script will download, compile and run the executable; please be
patient - it will take some time... Once its ready, you will see
``Server running, listening on 127.0.0.1:4000...``. You may now run
(in a separate terminal)::

  ./tests/boulder-integration.sh && echo OK || echo FAIL

If you would like to test `letsencrypt_nginx` plugin (highly
encouraged) make sure to install prerequisites as listed in
``letsencrypt-nginx/tests/boulder-integration.sh``:

.. include:: ../letsencrypt-nginx/tests/boulder-integration.sh
   :start-line: 1
   :end-line: 2
   :code: shell

and rerun the integration tests suite.

.. _Boulder: https://github.com/letsencrypt/boulder
.. _Go: https://golang.org


Vagrant
-------

{'fraction_non_alphanumeric': 0.12512750765045902, 'fraction_numerical': 0.006460387623257395, 'mean_word_length': 3.4874141876430205, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2932466', 'n_tokens_mistral': 1826, 'n_tokens_neox': 1697, 'n_words': 730}