-
Notifications
You must be signed in to change notification settings - Fork 7
Installation
This guide is for a completely fresh set up of everything required to start working with the TLO project. Whilst we currently only have mac setup, windows and linux steps will be similar.
- Navigate to https://account.jetbrains.com/login and sign in or create an account, making sure to click the verify email link
- Once logged in, navigate to https://www.jetbrains.com/student/ to get a staff/student license,
scrolling down the page to the
Apply Now
button. Most likely using your university email and a picture of your university ID card. The process should take a couple of days. In the meantime you can use the professional version of pycharm as a trial evaluation.
- Navigate to https://www.anaconda.com/distribution/#download-section and click on the
Download
button underneath the Python 3.x version. - Run the installer, clicking continue and accept as required, using the default settings
- Navigate to https://www.jetbrains.com/pycharm/download/
- Click the
Download
button underneath the Professional version - Open the image and drag PyCharm into your Applications Folder
- Open PyCharm.app from your Applications folder, accepting the user agreement and clicking
Skip Remaining and Set Defaults
- A License Activation window will open, if you already have a license then enter in your login details
that you created your IntelliJ/PyCharm account with, otherwise click
evaluate for free
(You can activate PyCharm later by going to the Menu barHelp
>Register
)
-
From the PyCharm welcome page, click
Check out from Versino control
and selectgit
-
Select
Log in to Github...
and enter in your GitHub login information -
The TLOmodel repository should now be available from the dropdown
URL
input, select it and then click on theclone
button -
Click Yes on the dialogue box asking if you want to open the TLOmodel directory
-
Click the Menu bar
PyCharm
>Preferences...
-
In the dialogue box navigate to
Project: TLOmodel
>Project Interpreter
-
Click on the settings cog on the right and select
Add...
-
Select
Conda environment
from the left hand panel, and set the Python Version to3.6
, then clickOK
. -
In the Preferences window there will be a green circle button that is highlighted, click it to remove the highlighting and then click
Apply
(this will now install packages using pip, not conda). -
Still in the Preferences window, navigate to
Tools
>Python Integrated Tools
- Set the
Package requirements file
to be TLOmodel/requirements.dev.txt by clicking on the folder icon and browsing for the file. - Change the
Default test runner
topytest
and clickOK
to close the Preferences window
- Set the
-
Click on the
Terminal
button at the bottom of the pycharm window and enter in the following text, hitting the enter key after each line.pip install -r requirements/dev.txt pip install -e .
- At the top of your PyCharm window, click on
Add Configuration...
- Click on the Spanner Icon (Edit Defaults or Edit Templates)
- Select the Python Template from the side menu
- In the Working directory option, click on the folder icon and use this to set it to be the base of the TLOmodel directory and click
Apply
- Still in the
Configuration Window
from the last step - Click the plus icon to the top left of the Configuration window and select
Python tests
>pytest
- A new configuration will appear
- Set the Target input by clicking on the folder icon, and select
TLOmodel
>tests
, click theOpen
button - The configuration window should now look something like this, click
OK
- At the top of the screen, there will now be a configuration, you can click on the green arrow to run the tests
- A new run pane will open up and pytest will run for a fair while, after it completes it will say that all of the tests have passed
- You can scroll down the window and the final lines should look something like this
-
You can skip this section if you've set up your details in git
-
Click on the
Terminal
button as before and enter in the following commands, replacing your Name and Email but keeping the quotes. Hit enter after each linegit config --global user.name "Stefan Piatek" git config --global user.email "s.piatek@ucl.ac.uk"
TLO Model Wiki