-
Notifications
You must be signed in to change notification settings - Fork 2
1. Python Development Environment installation: Anaconda, Git, PyCharm
Python Development environment for FDMS*
In this document we will describe the different tools, settings and strategy used for the development of FDMS transformation rules using Python 3.
Ths document is written based on the Anaconda Python distribution 5.3, Python versions 3.6 and/or 3.7, Pytest 3.8, PyCharm 2018.2.5 (Community Edition).
The different sections of the document are:
- Anaconda: Python Distribution.
- Git: Version Control.
- PyCharm: Integrated Development Environment (IDE).
This section will describe the installation and used components of Anaconda for the Python development in the FDMS project.
At the date the latest version of Python 3 available is Python 3.7.
https://www.anaconda.com/download/
By typing: conda list in the (base) C:> , it will be shown all the packages that have been installed with the Anaconda distribution.
conda list
At the heart of GitHub is an open source version control system (VCS) called Git. Git is responsible for everything GitHub-related that happens locally on your computer. For Windows, in order to use Git on the command line, you'll need to download and install, Git on your computer using this link:
https://git-scm.com/download/win
https://www.jetbrains.com/pycharm/download/#section=windows
The Pycharm version to download is the Community version.
In PyCharm, File menu, Settings > Tools > Terminal, change the Shell path as following:
cmd.exe "/K" "C:\python\anaconda\Scripts\activate.bat" "C:\python\anaconda"
Here we assume that the directory where anaconda
is installed is C:\python\anaconda, otherwise replace accordingly.
Close the Terminal and reopen it, you will get the Anaconda Prompt.
To Start working with Pycharm, you can open one project from the ECFIN/FDMS repository:
Download Zip the branch Staging and unzip it to a local folder in your PC, lets say to:
C:\files\gitrepo
Then you will get all the files in the directory:
C:\files\gitrepo\FDMS-staging
In PyCharm, then, open the directory that you just created e.g C:\gitrepo\FDMS-staging. Once, it appears in the project window, right-click and select the option 'Open in Terminal'. This will open the terminal of PyCharm in the folder of the project just created. Once there, in order to see the example code, open in PyCharm the file:
FDMS-staging\fdms\tests\test_country_calculations
In order to test this code, write:
pytest
in the PyCharm terminal.
If the path of the test_country_calculations file appears in the PyCharm terminal the installation of PyCharm together with Anaconda is succesful!.
In the next chapters, we will learn more about the Git repository, working, debugging and pytest(ing) with the python code. The fun just starts!!!