Over a million developers have joined DZone.

Hatching Python Eggs from NetBeans IDE

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

Support for building Python eggs  (IZ #150283) from NetBeans IDE is now available in the repository. (Refer this link to see how you can clone the repository and build the Python bits). Please try it and file bugs and suggestions here.

Now, I would like to talk a bit of Python Eggs and how to use the NetBeans IDE to build Eggs for your Python packages.

A Python Egg is to Python as JAR is to Java or a 'gem' is to Ruby. It comprises of your code, resources and all important metadata- version, dependency information, etc. All the gory details are here at http://peak.telecommunity.com/DevCenter/PythonEggs.

How to lay Python eggs in NetBeans IDE:

  1. Right-click on the Python project name and select 'Build Egg':

  2. If you already have a setup.py file (Please refer the 'assumptions' section below) , and a do a 'Build Egg' it uses that. (Do a 'Clean & Build Egg' to create a default setup.py file. If you don't have a setup.py, one is created for you.

  3. The process can be tracked in the Output window:
  4. Once the build process is over, you will see the the 'egg' has been deposited in the 'dist' directory (accessible in the Files window):

It is not viewable from the Projects window as it unnecessarily clutters the view.

Egg Formats

As you can see from the above view, there is also a file, EggDemo.egg-info, which is another format for Python Eggs as mentioned in http://peak.telecommunity.com/DevCenter/EggFormats

The wiki page has some more information.

Assumptions

These have to assumed, because that is the way it has to be:

  1. You have setuptools installed
  2. Your setup.py file lives in the top level directory- src or your existing sources' root directory
  3. Your packages or sub-packages (those containing __init.py__) are actually in the sub-(sub)-directories under your top-level directory, in which setup.py lives

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}