<commit_before>Tutorial
========

.. note:: Did you find any of these instructions confusing? `Edit this file`_
          and submit a pull request with your improvements!

.. _`Edit this file`: https://github.com/audreyr/cookiecutter-pypackage/blob/master/docs/tutorial.rst

Step 1: Install Cookiecutter
----------------------------

First, create a virtualenv for your new package:

.. code-block:: bash

    virtualenv ~/.virtualenvs/mypackage


Here, `mypackage` is the name of the package that you'll create.

Activate your environment

.. code-block:: bash

    source bin/activate

On Windows

.. code-block:: bash

    > \path\to\env\Scripts\activate


Install cookiecutter

.. code-block:: bash

    pip install cookiecutter


Step 2: Generate Your Package
-----------------------------

Now it's time to generate your Python package.

Use cookiecutter, pointing it at the cookiecutter-pypackage repo:

.. code-block:: bash

    cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git

You'll be asked to enter a bunch of values to set the package up.
If you don't know what to enter, stick with the defaults.

Step 3: Create a GitHub Repo
----------------------------

Create a repo and put your package there.

``Be sure to add you environment folder into the .gitignore file.``

This can be accomplished with:

.. code-block:: bash

    git init .
    git add .
    git commit -m "Initial skeleton."
    git remote add origin git@github.com:myusername/mypackage.git
    git push -u origin master

Where `myusername` and `mypackage` are the adjusted for the specific project.

You'll need a ssh key to push the repo. You can `Generate`_ a key or `Add`_ existing one.

.. _`Generate`: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
.. _`Add`: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/


Step 4: Install Dev Requirements
--------------------------------

Make sure you are in the folder containing the ``requirements_dev.txt`` file.

Install the new project's local development requirements into a virtualenv:

.. code-block:: bash

    pip install -r requirements_dev.txt

If you have issues building the wheel for cryptography. Make sure that the required dependencies are installed. Follow the `Cryptography Instruction`_ for your OS

.. _ `Cryptography Instruction `:https://cryptography.io/en/latest/installation/


Step 5: Set Up Travis CI
------------------------

`Travis CI org`_ is a continuous integration tool used to prevent integration problems. Every commit to the master branch will trigger automated builds to create the necessary files to run the application.

Login using your Github credentials.

Add the public repo to your Travis CI account.
<commit_msg>Part 1 of tutorial update<commit_after>Tutorial
========

.. note:: Did you find any of these instructions confusing? `Edit this file`_
          and submit a pull request with your improvements!

.. _`Edit this file`: https://github.com/audreyr/cookiecutter-pypackage/blob/master/docs/tutorial.rst

Step 1: Install Cookiecutter
----------------------------

First, you need to create and activate a virtualenv for the package project. Use your favorite method, or create a virtualenv for your new package like this:

.. code-block:: bash

    virtualenv ~/.virtualenvs/mypackage


Here, `mypackage` is the name of the package that you'll create.

Activate your environment:

.. code-block:: bash

    source bin/activate

On Windows, activate it like this. You may find that using a Command Prompt window works better than gitbash.

.. code-block:: bash

    > \path\to\env\Scripts\activate


Install cookiecutter

.. code-block:: bash

    pip install cookiecutter


Step 2: Generate Your Package
-----------------------------

Now it's time to generate your Python package.

Use cookiecutter, pointing it at the cookiecutter-pypackage repo:

.. code-block:: bash

    cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git

You'll be asked to enter a bunch of values to set the package up.
If you don't know what to enter, stick with the defaults.

Step 3: Create a GitHub Repo
----------------------------

You will find one folder named after the `[project_slug]` from your answers to running cookiecutter. Move into this folder:

.. code-block:: bash

    cd mypackage

Now you need to create a GitHub repo and put your package there. In your GitHub account, create a repo named `mypackage`.

** Note: If your `virtualenv` folder is within your project folder, be sure to add the folder name to the ``.gitignore` file.

This can be accomplished with:

.. code-block:: bash

    git init .
    git add .
    git commit -m "Initial skeleton."
    git remote add origin <EMAIL>:myusername/mypackage.git
    git push -u origin master

Where `myusername` and `mypackage` are the adjusted for the specific project.

You'll need a ssh key to push the repo. You can `Generate`_ a key or `Add`_ existing one.

.. _`Generate`: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
.. _`Add`: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/


Step 4: Install Dev Requirements
--------------------------------

You should now be in the folder containing the ``requirements_dev.txt`` file.

Your virtualenv should still be activated. Install the new project's local development requirements:

.. code-block:: bash

    pip install -r requirements_dev.txt

If you have issues building the wheel for cryptography. Make sure that the required dependencies are installed. Follow the `Cryptography Instruction`_ for your OS

.. _ `Cryptography Instruction `:https://cryptography.io/en/latest/installation/


Step 5: Set Up Travis CI
------------------------

`Travis CI org`_ is a continuous integration tool used to prevent integration problems. Every commit to the master branch will trigger automated builds to create the necessary files to run the application.

Login using your Github credentials.

Add the public repo to your Travis CI account.

{'fraction_non_alphanumeric': 0.12360472751149047, 'fraction_numerical': 0.0018056467498358503, 'mean_word_length': 3.0032851511169514, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1021255', 'n_tokens_mistral': 1756, 'n_tokens_neox': 1616, 'n_words': 722}