<commit_before># README for Simplified Installation with PyCharm on a Mac
[Back to root README](../README.md)

## Installing WeVoteServer: On a new Mac
These instructions are for a new Mac, or at least a Mac that hasn't been used for 
Python development before.  Some of these tools may already be setup on your Mac, but
reinstalling them causes no harm, skip the parts you are sure you already have.

If you have never installed Postgres on your Mac (or don't mind fully deleting any Postgres that you have already 
installed on your Mac), these instructions should take an hour or so to complete. 

1. Install the Chrome browser for Mac

1. Open the Mac "App Store" app, and download the current version of Apple's Xcode, which includes "c" language compilers 
    and native git integration. This download also includes Apple's Xcode IDE for MacOS and iOS native development.

    **Note: Xcode requires about 30 GB of diskspace, if you don't have much that room on your Mac, it is sufficient 
    to download only the "Xcode Command Line Tools", but you need to sign up as an apple developer to do that.  Download (the latest version of) "Command Line Tools (macOS 10.14) for Xcode 10" at 
    [https://developer.apple.com/download/more/](https://developer.apple.com/download/more/)  These tools only require 185 MB 
    of disk space.  If you choose to download only the tools, skip on to Step 6.**
    
    If you have enough disk space, it is much easier to just install all of Xcode (including the full Xcode IDE) from 
    the app store:
    ![ScreenShot](images/DownloadXcodeFromAppStore.png)

1. Start xcode (you can find it with Spotlight, or in the Application folder)

    ![ScreenShot](images/FindXcode.png)

1. When prompted, download the "Additional Components" (the Command Line Tools).  This takes a many minutes to complete.

1. When you get to "Welcome to Xcode", quit out of the app. (For the WeVoteServer, we only need the command line tools that 
come with Xcode.)

    ![ScreenShot](images/WelcomeToXcode.png)

1. Download and install the Community version of PyCharm, it's free!
    [https://www.jetbrains.com/pycharm/download/#section=mac](https://www.jetbrains.com/pycharm/download/#section=mac)

1. Start PyCharm and enable the Markdown and BashSupport tools (this takes a while).  Feel free to add any other PyCharm tools
that you would like!

    ![ScreenShot](images/CustomizePyCharm.png)

1. Navigate in Chrome to [github](https://github.com).  Create a personal account if you don't already have one.
 
1. Within the github site, navigage to [https://github.com/wevote/WeVoteServer](https://github.com/wevote/WeVoteServer). 
    Create a fork of wevote/WeVoteServer.git by selecting the "Fork" button (in the upper right of screen).
    
     ![ScreenShot](images/Fork.png)
    
1. In PyCharm, check out the project development branch from github

    ![ScreenShot](images/CheckoutFromVcGit.png)
    ![ScreenShot](images/CheckoutFromVC-Clome.png)

    After the checkout, answer yes to the "Would you like to open the directory ..." dialog
    
    ![ScreenShot](images/AfterCheckoutFirstIDEshows.png)

11. In PyCharm, go to the VCS/Enable Version Control Integration menu choice dialog, and select "git".  But, if the Git option is
    already present in the middle of the pull down, and you don't see a "Enable Version Control Integration" option, don't worry
    about it -- PyCharm picked up that setting from a previous install or another JetBrains tool that you might have installed.

    ![ScreenShot](images/EnableVCIntegrationGit.png)

1. In PyCharm set your git remotes. Navigate to the remotes dialog

   ![ScreenShot](images/GitMenuRemotes.png)
   
   The WeVoteServer project defines upstream and origin differently than most projects.
   
   ![ScreenShot](images/IncorrectOrigin.png)
   
   Click the edit (pencil) icon, and change the word origin to upstream.  (We call the working development branch for the 
   project in GitHub "upstream"). This is how it looks after the change.
   
   ![ScreenShot](images/CorrectedToUpstream.png)
   
   To change manually from a terminal window, change into the WeVoteServer folder and then run, `vi .git/config`:
   
   ```
   \[remote "origin"\]
        url = <EMAIL>:YOUR_GITHUB_HANDLE_HERE/WeVoteServer.git
        fetch = +refs/heads/\*:refs/remotes/origin/\*
   \[remote "upstream"\]
        url = <EMAIL>:wevote/WeVoteServer.git
        fetch = +refs/heads/\*:refs/remotes/upstream/\*
<commit_msg>Update README_MAC_SIMPLIFIED_INSTALL.md<commit_after># README for Simplified Installation with PyCharm on a Mac
[Back to root README](../README.md)

## Installing WeVoteServer: On a new Mac
These instructions are for a new Mac, or at least a Mac that hasn't been used for 
Python development before.  Some of these tools may already be setup on your Mac, but
reinstalling them causes no harm, skip the parts you are sure you already have.

If you have never installed Postgres on your Mac (or don't mind fully deleting any Postgres that you have already 
installed on your Mac), these instructions should take an hour or so to complete. 

1. Install the Chrome browser for Mac

1. Open the Mac "App Store" app, and download the current version of Apple's Xcode, which includes "c" language compilers 
    and native git integration. This download also includes Apple's Xcode IDE for MacOS and iOS native development.

    **Note: Xcode requires about 30 GB of diskspace, if you don't have much that room on your Mac, it is sufficient 
    to download only the "Xcode Command Line Tools", but you need to sign up as an apple developer to do that.  Download (the latest version of) "Command Line Tools (macOS 10.14) for Xcode 10" at 
    [https://developer.apple.com/download/more/](https://developer.apple.com/download/more/)  These tools only require 185 MB 
    of disk space.  If you choose to download only the tools, skip on to Step 6.**
    
    If you have enough disk space, it is much easier to just install all of Xcode (including the full Xcode IDE) from 
    the app store:
    ![ScreenShot](images/DownloadXcodeFromAppStore.png)

1. Start xcode (you can find it with Spotlight, or in the Application folder)

    ![ScreenShot](images/FindXcode.png)

1. When prompted, download the "Additional Components" (the Command Line Tools).  This takes a many minutes to complete.

1. When you get to "Welcome to Xcode", quit out of the app. (For the WeVoteServer, we only need the command line tools that 
come with Xcode.)

    ![ScreenShot](images/WelcomeToXcode.png)

1. Download and install the Community version of PyCharm, it's free!
    [https://www.jetbrains.com/pycharm/download/#section=mac](https://www.jetbrains.com/pycharm/download/#section=mac)

1. Start PyCharm and enable the Markdown and BashSupport tools (this takes a while).  Feel free to add any other PyCharm tools
that you would like!

    ![ScreenShot](images/CustomizePyCharm.png)

1. Navigate in Chrome to [github](https://github.com).  Create a personal account if you don't already have one.
 
1. Within the github site, navigage to [https://github.com/wevote/WeVoteServer](https://github.com/wevote/WeVoteServer). 
    Create a fork of wevote/WeVoteServer.git by selecting the "Fork" button (in the upper right of screen).
    
     ![ScreenShot](images/Fork.png)
    
1. In PyCharm, check out the project development branch from github

    ![ScreenShot](images/CheckoutFromVcGit.png)
    ![ScreenShot](images/CheckoutFromVC-Clome.png)

    After the checkout, answer yes to the "Would you like to open the directory ..." dialog
    
    ![ScreenShot](images/AfterCheckoutFirstIDEshows.png)

11. In PyCharm, go to the VCS/Enable Version Control Integration menu choice dialog, and select "git".  But, if the Git option is
    already present in the middle of the pull down, and you don't see a "Enable Version Control Integration" option, don't worry
    about it -- PyCharm picked up that setting from a previous install or another JetBrains tool that you might have installed.

    ![ScreenShot](images/EnableVCIntegrationGit.png)

1. In PyCharm set your git remotes. Navigate to the remotes dialog

   ![ScreenShot](images/GitMenuRemotes.png)
   
   The WeVoteServer project defines upstream and origin differently than most projects.
   
   ![ScreenShot](images/IncorrectOrigin.png)
   
   Click the edit (pencil) icon, and change the word origin to upstream.  (We call the working development branch for the 
   project in GitHub "upstream"). This is how it looks after the change.
   
   ![ScreenShot](images/CorrectedToUpstream.png)
   
   To change origin and upstream manually from a terminal window, change into the WeVoteServer folder and then run, `vi .git/config`:
   
   ```
   [remote "origin"]
        url = <EMAIL>:YOUR_GITHUB_HANDLE_HERE/WeVoteServer.git
        fetch = +refs/heads/*:refs/remotes/origin/*
   [remote "upstream"]
        url = <EMAIL>:wevote/WeVoteServer.git
        fetch = +refs/heads/*:refs/remotes/upstream/*

{'fraction_non_alphanumeric': 0.07834663120567376, 'fraction_numerical': 0.005540780141843972, 'mean_word_length': 3.755005268703899, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 14, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '394251', 'n_tokens_mistral': 2694, 'n_tokens_neox': 2528, 'n_words': 1144}