1.2. IDE

While PyCharm as an excellent IDE, some aspects of it require licensing, and the PyDev Plugin for Eclipse (packaged as LiClipse) is fully open source (although donations are welcome). Therefore this section focuses on using LiClipse for StorPerf development.

1.2.1. Download

http://www.liclipse.com/download.html

1.2.2. Storperf virtualenv Interpretor

Setting up interpreter under PyDev (LiClipse):

  • Go to Project -> Properties, PyDev Interpreter:

testing/developer/devguide/../images/PyDev_Interpreter.jpeg
  • Click to configure an interpreter not listed.

testing/developer/devguide/../images/PyDev_Interpreters_List.jpeg
  • Click New, and create a new interpreter called StorPerf that points to your Virtual Env.

testing/developer/devguide/../images/PyDev_New_Interpreter.jpeg
  • You should get a pop up similar to:

testing/developer/devguide/../images/PyDev_Interpreter_Folders.jpeg
  • And then you can change the Interpreter to StorPerf.

testing/developer/devguide/../images/PyDev_StorPerf_Interpreter.jpeg

1.2.3. Code Formatting

Pep8 and Flake8 rule. These are part of the Gerrit checks and I’m going to start enforcing style guidelines soon.

  • Go to Window -> Preferences, under PyDev, Editor, Code Style, Code Formatter and select autopep8.py for code formatting.

testing/developer/devguide/../images/Code_formatter.jpeg
  • Next, under Save Actions, enable “Auto-format editor contents before saving”, and “Sort imports on save”.

testing/developer/devguide/../images/Save_Actions.jpeg
  • And under Imports, select Delete unused imports.

testing/developer/devguide/../images/Unused_imports.jpeg
  • Go to PyDev -> Editor -> Code Analysis and under the pycodestye.py (pep8), select Pep8 as Error. This flag highlight badly formatted lines as errors. These must be fixed before Jenkins will +1 any review.

testing/developer/devguide/../images/Code_analysis.jpeg

1.2.4. Import Storperf as Git Project

I prefer to do the git clone from the command line, and then import that as a local project in LiClipse.

  • From the menu: File -> Import Project

testing/developer/devguide/../images/Import_Project.png

testing/developer/devguide/../images/Local_Repo.png

testing/developer/devguide/../images/Add_git.png

  • Browse to the directory where you cloned StorPerf

testing/developer/devguide/../images/Browse.png

  • You should now have storperf as a valid local git repo:

testing/developer/devguide/../images/Git_Selection.png

  • Choose Import as general project