PyEgg
Creating Python Eggs from NetBeans
[[{TableOfContentsTitle=TableOfContents} | {TableOfContents title='Table of Contents'}]]
This page shall track the progress of work on Issue #150283 which will enable creating Python eggs from NetBeans IDE for Python
The code is now available in the repository, as of rev# http://hg.netbeans.org/main/rev/cb31bcf8ae14. See this link for more information: http://amitksaha.blogspot.com/2009/01/hatching-python-eggs-from-netbeans.html
Deliverables
Python Egg creation from within NetBeans.
Use case in NetBeans
- Right-click on the Python project name and select 'Build Egg'
- A Python Egg should be created and deposited in a new sub-directory -'dist' with a default 'setup.py' which will be opened for the user to customise
- Clean and Build Egg should be available
- If you already have a 'setup.py' file, and a do a 'Build Egg' it uses that. (Do a 'Clean & Build Egg' to create a default setup.py file)
- The process can be tracked in the 'Output' TAB:
- Once the build process is over, you will see the the 'egg' has been deposited in the 'dist' directory (accessible in the 'Files' View)
It is not viewable from the 'Projects' view 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
Assumptions
These have to assumed, because that is the way it has to be:
- You have setuptools installed
- Your setup.py file lives in the top level directory- src or your existing sources' root directory
- 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
Notes
Creating Python eggs:
Basically Python eggs are created via a 4-step process
- Install setuptools.
- Create the files you want to be in your egg.
- Create a setup.py file.
- Run: python setup.py bdist_egg
For eg.
$ cd /tmp $ mkdir egg-example $ cd egg-example $ touch hello-egg.py
In this case, it will only contain an empty Python module named 'hello-egg.py'.
Next, create the simplest possible setup.py file:
from setuptools import setup, find_packages
setup(
name = "HelloWorld",
version = "0.1",
packages = find_packages(),
)
python setup.py bdist_egg
Your Python egg should be ready in a new directory- dist



