Configuring PyCharm for Oracle Developer Cloud Service

This blog is the first in series for Python application development and deployment on Oracle Cloud using Developer Cloud Service. This blog will help in understanding how PyCharm, one of the most popular IDE for Python code development along with Oracle Developer Cloud Service be used to manage the DevOps lifecycle to of the application developed.

The subsequent blogs will focus on the Development of the Python application, build and deploy on Oracle Cloud using Developer Cloud Service and use of Grunt and PSM Cli for the automation of the DevOps process.

Links to: Part 2 , Part 3

About PyCharm

PyCharm is an Integrated Development Environment (IDE) used in computer programming, specifically for the Python language. It is developed by JetBrains. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems, and supports web development with various Python frameworks.

PyCharm is cross-platform, with Windows, MacOS and Linux versions. The Community Edition is released under the Apache License. For the purpose of this blog, we will be using the Community Edition 2017. Please use the link to get detailed information on PyCharm.

You can download PyCharm Community Edition from this link by selecting OS as per your requirement. By default windows is selected.

Launching the PyCharm IDE:

Now create a new project in PyCharm IDE as shown below in the screenshots. Ensure that the Python Interpreter location on your machine is preset in PyCharm as shown in the second screenshot below. Else you will have to configure either for the project or for the IDE. For the purpose of this blog I am using Enthought Canopy Python Distribution as it was preinstalled on my machine.

Now it is time to establish the connection between the PyCharm IDE and the Oracle Developer Cloud Service. For this to work below are the prerequisites:

1. Having an Oracle Cloud account.

2. Have created a project on Oracle Developer Cloud Service.

3. Have created a Git repository in the project on Developer Cloud Service.

4. Oracle Application Container Cloud Service (for the upcoming blogs in the series).

Note: If you have a valid Oracle Cloud account then Developer Cloud Service will be provisioned for you as an entitlement.

Below screen shots show the Oracle Developer Cloud Service Project and the hosted Git repository. The Git repository that we would be using for the Python Blog Series has been highlighted in red.

PyCharm Developer Cloud Service Configuration

Once your project is created go to VCS tab in the PyCharm IDE menu. Select the menu item “Enable version Control Integration” as shown in the screenshot below.

Now select the Version Control System(VCS) you want to integrate with. Since Developer Cloud Service only supports Git as the hosted VCS, so you will have to select the same in the dropdown as shown below in the screenshot. Then click ‘OK’.

Once you have enabled the VCS integration as Git for the project. You can go ahead and right click the project and then select ‘Git’ from the menu. Then select Repository -> Remotes, to add the remote Git repository hosted on Developer Cloud Service.

Once the ‘Git Remotes’ dialog appears. Click on the ‘+’ button to add the remote Developer Cloud Service repository.

You can leave the name as origin in the ‘Define Remote’ dialog and give the URL which you can retrieve from the Git Repository on Developer Cloud Service. Please refer the screenshot above in the blog, which highlights the repository to be used for this blog series and the YRL shown. You can copy the URL of the Git repository that you have created on your Developer Cloud instance as part of the project. And then click ‘OK’ button to submit.

Once done it will ask for your credential to access the Git repository hosted on Oracle Developer Cloud. This will be your Oracle Cloud credentials that you use to access the Developer Cloud Service instance. And then click ‘OK’ button to submit.

Once done the remote Git repository hosted on Developer Cloud would be configured for your Project on PyCharm. This will enable you to push or pull your code from the Git repository, from your favorite Python IDE, PyCharm.

Read further in my second blog post on developing a simple Python application and how to automate the build on Oracle Developer Cloud Service.

Happy Coding!

**The views expressed in this post are my own and do not necessarily reflect the views of Oracle